API Docs for:
Show:

hex_core.BaseLocation Class

This is the base class for VertexLocation and EdgeLocation

    * 
    * -- This is NOT instantiable by itself --
    *

Constructor

hex_core.BaseLocation

()

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.BaseLocation

Edge and VertexLocation's have class-specific implementations

This function should return all Locations that refer to this spot on the map

Returns:

hex_core.BaseLocation:

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

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

rotateAboutHexCW

() hex_core.BaseLocation

Get the next logical location by traveling about the center of the hex in a clockwise direction

Returns:

hex_core.BaseLocation:

The next location CW