Package be.belegkarnil.game.board.tak
Class Action
java.lang.Object
be.belegkarnil.game.board.tak.Action
This class represents all possible actions during a
Game.- Author:
- Belegkarnil
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal PointThe destination iff action is a move, null otherwhisestatic final PointConstant that is used to specify the destination value (null) if the action is not a move actionstatic final PieceConstat that is used to specify the piece value (null) if the action is not a place actionfinal PieceThe piece played during the actionfinal PointThe position at which to put the piece during the action, or the src of a move -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
NO_MOVE
Constant that is used to specify the destination value (null) if the action is not a move action -
NO_PIECE
Constat that is used to specify the piece value (null) if the action is not a place action -
piece
The piece played during the action -
position
The position at which to put the piece during the action, or the src of a move -
destination
The destination iff action is a move, null otherwhise
-
-
Constructor Details
-
Action
Constructor of a Place Action, put the piece at a position -
Action
Constructor of a Move Action, move amount of pieces along a path -
Action
public Action()Construct an action to skip turn, no action
-
-
Method Details
-
isPlace
public boolean isPlace()Know if the action is to place aPiece- Returns:
- true iff the action is to place a
Piece
-
isMove
public boolean isMove()Know if the action is to replace/swap aPiece- Returns:
- true iff the action is to replace/swap a
Piece
-
isSkip
public boolean isSkip()Know if the action is to skip the turn- Returns:
- true iff the action is to skip the turn
-
getAmount
public int[] getAmount()Get a copy of the amount array (move action)- Returns:
- the amount array
-