Class Hexagonal
java.lang.Object
application.model.rules.misc.turmites.Neighbourhood
application.model.rules.misc.turmites.Hexagonal
public class Hexagonal extends Neighbourhood
Implements turmites on the hexagonal neighbourhood
-
Constructor Summary
Constructors Constructor Description Hexagonal()
-
Method Summary
Modifier and Type Method Description int[]
getActions()
Gets the actions the turmite can takeCoordinate[]
getNeighbourhood()
Gets the neighbourhood of the turmiteint
getNewDirection(int action, int turmiteDirection)
Gets the new direction of the turmiteint
getOppositeDirection(int direction)
Gets direction opposite to the direction passed inTiling
getTiling()
Gets the tiling the neighbourhood applies to
-
Constructor Details
-
Hexagonal
public Hexagonal()
-
-
Method Details
-
getTiling
Description copied from class:Neighbourhood
Gets the tiling the neighbourhood applies to- Specified by:
getTiling
in classNeighbourhood
- Returns:
- Returns the tiling of the neighbourhood
-
getActions
public int[] getActions()Description copied from class:Neighbourhood
Gets the actions the turmite can take- Specified by:
getActions
in classNeighbourhood
- Returns:
- Returns the actions that the turmite can take
-
getNeighbourhood
Description copied from class:Neighbourhood
Gets the neighbourhood of the turmite- Specified by:
getNeighbourhood
in classNeighbourhood
- Returns:
- Returns the neighbourhood of the turmite
-
getOppositeDirection
public int getOppositeDirection(int direction)Description copied from class:Neighbourhood
Gets direction opposite to the direction passed in- Specified by:
getOppositeDirection
in classNeighbourhood
- Parameters:
direction
- The direction- Returns:
- Returns the opposite direction of the direction passed in
-
getNewDirection
public int getNewDirection(int action, int turmiteDirection)Description copied from class:Neighbourhood
Gets the new direction of the turmite- Specified by:
getNewDirection
in classNeighbourhood
- Parameters:
action
- The action taken by the turmiteturmiteDirection
- The turmite's direction- Returns:
- Returns the new direction of the turmite
-