hex_core.EdgeLocation Class
This class represent an edge location. It consists of a hex location and an edge direction This takes a hex location and a direction. Alternatively you can use (x,y,direction)
Constructor
hex_core.EdgeLocation
-
hexLocation
-
direction
Parameters:
-
hexLocation
HexLocationThe location of the parent hex
-
direction
hex_core.EdgeDirectionThe direction of the edge relative to the hex
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.EdgeLocation
This function returns this Edge location as well as the edge location for the other hex that this edge touches.
Returns:
[Array] The list of all edge locations that this object is equivalent to (reflexive). Size = 2.
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