hex_core.BaseLocation Class
This is the base class for VertexLocation and EdgeLocation
*
* -- This is NOT instantiable by itself --
*
Constructor
hex_core.BaseLocation
()
Item Index
Methods
equals
-
otherLocation
This is used to check if two locations are equal
Parameters:
-
otherLocation
hex_core.HexLocation
Returns:
boolean Returns true if the other location has the same x,y
getCanonical
()
hex_core.BaseLocation
Abstract Returns a canonical representation of this location (ie unique and consistent - all locations that are equal have the same canonical representation.)
Returns:
The canonical representation of this location
getConnectedEdges
()
hex_core.VertexLocation
Abstract function to be overridden in child-class
Returns:
[Array] edges touching this locaiton
getEquivalenceGroup
()
hex_core.BaseLocation
Edge and VertexLocation's have class-specific implementations
This function should return all Locations that refer to this spot on the map
Returns:
[Array] A list of equivalent locations including this one
getIDString
()
String
Abstract Returns a unique string id for this location All locations in any equivalence group will have the same id string.
Returns:
getNeighborLocation
-
hexDirection
This gets the surrounding hex locations
Parameters:
-
hexDirection
HexDirection
Returns:
hex_core.HexLocation Returns a location next to this one, in the direction of the 'hexDirection' given
getNeighborVertexes
()
hex_core.VertexLocation
Abstract function to be overridden in child-class
Returns:
[Array] vertexes touching this location
rotateAboutHexCCW
()
hex_core.BaseLocation
Get the next logical location by traveling about the center of the hex in a counter-clockwise direction
Returns:
[Array] The next location CCW
rotateAboutHexCW
()
hex_core.HexLocation
Returns a reference to the hex that this location is on.
Returns:
The hex this is referencing
rotateAboutHexCW
()
hex_core.BaseLocation
Get the next logical location by traveling about the center of the hex in a clockwise direction
Returns:
The next location CW