API Docs for:
Show:

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 HexLocation

    The location of the parent hex

  • direction hex_core.EdgeDirection

    The direction of the edge relative to the hex

Methods

equals

(
  • otherLocation
)

This is used to check if two locations are equal

Parameters:

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:

hex_core.BaseLocation:

The canonical representation of this location

getConnectedEdges

() hex_core.VertexLocation

Abstract function to be overridden in child-class

Returns:

hex_core.VertexLocation:

[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:

hex_core.EdgeLocation:

[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:

String:

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:

hex_core.VertexLocation:

[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:

hex_core.BaseLocation:

[Array] The next location CCW

rotateAboutHexCW

() hex_core.HexLocation

Returns a reference to the hex that this location is on.

Returns:

hex_core.HexLocation:

The hex this is referencing