Class Actor

java.lang.Object
com.takenoko.actors.Actor
Direct Known Subclasses:
Gardener, Panda

public abstract class Actor extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • getPosition

      public PositionVector getPosition()
      Returns:
      the position of the actor
    • isMovePossible

      protected boolean isMovePossible(PositionVector vector, Board board)
      Check if the move is possible. The actor can only move in a straight line on the board tiles.
      Parameters:
      vector - the vector to move the actor
      Returns:
      true if the move is possible, false otherwise
    • getPossibleMoves

      public List<PositionVector> getPossibleMoves(Board board)
      Returns possible moves for the actor.
      Returns:
      the possible moves
    • move

      public Map<PositionVector,LayerBambooStack> move(PositionVector vector, Board board)
      Move the panda with a vector and try to eat bamboo.
      Parameters:
      vector - the vector to move the panda
    • afterMove

      public abstract Map<PositionVector,LayerBambooStack> afterMove(Board board)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getPositionVector

      public PositionVector getPositionVector()