Class Panda

java.lang.Object
com.takenoko.actors.Actor
com.takenoko.actors.Panda

public class Panda extends Actor
Panda class. The panda is an actor that can move on the board.
  • Constructor Details

    • Panda

      public Panda(PositionVector position)
      Constructor for the Panda class.
      Parameters:
      position - the position of the panda
    • Panda

      public Panda()
      Constructor for the Panda class. Instantiate the panda at the origin.
    • Panda

      public Panda(Panda panda)
  • Method Details

    • positionMessage

      public String positionMessage()
      Returns:
      a string explaining where the panda is on the board
    • isMovePossible

      protected boolean isMovePossible(PositionVector vector, Board board)
      If the weather is a storm, the panda can move wherever he wants. Otherwise, the panda can only move like a normal actor.
      Overrides:
      isMovePossible in class Actor
      Parameters:
      vector - the vector to move the panda
      board - the board on which the panda is moving
      Returns:
      true if the move is possible, false otherwise
    • afterMove

      public Map<PositionVector,LayerBambooStack> afterMove(Board board)
      After the panda moves, he can eat bamboo if there is bamboo on the tile he moved to. If there is bamboo, the panda eats it and a map with the bamboo stack is returned.
      Specified by:
      afterMove in class Actor
      Parameters:
      board - the board on which the panda is moving
      Returns:
      the bamboo stack that the panda ate
    • copy

      public Panda copy()