Package com.takenoko.actors
Class Panda
java.lang.Object
com.takenoko.actors.Actor
com.takenoko.actors.Panda
Panda class. The panda is an actor that can move on the board.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionPanda()Constructor for the Panda class.Panda(PositionVector position) Constructor for the Panda class. -
Method Summary
Modifier and TypeMethodDescriptionAfter the panda moves, he can eat bamboo if there is bamboo on the tile he moved to.copy()protected booleanisMovePossible(PositionVector vector, Board board) If the weather is a storm, the panda can move wherever he wants.Methods inherited from class com.takenoko.actors.Actor
equals, getPosition, getPositionVector, getPossibleMoves, hashCode, move
-
Constructor Details
-
Panda
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
-
-
Method Details
-
positionMessage
- Returns:
- a string explaining where the panda is on the board
-
isMovePossible
If the weather is a storm, the panda can move wherever he wants. Otherwise, the panda can only move like a normal actor.- Overrides:
isMovePossiblein classActor- Parameters:
vector- the vector to move the pandaboard- the board on which the panda is moving- Returns:
- true if the move is possible, false otherwise
-
afterMove
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. -
copy
-