public class BarMovement extends Movement
Modifier and Type | Field and Description |
---|---|
protected int |
end |
Constructor and Description |
---|
BarMovement(int player,
int end)
Constructor, taking the player and
the end location
|
Modifier and Type | Method and Description |
---|---|
void |
apply(Board board)
Validates this movement given the provided
board situation.
|
boolean |
canUse(Board board,
int die)
Returns whether or not this movement can use the given
dice roll to perfrom it's movement
|
boolean |
equals(java.lang.Object o)
Returns whether not this movement equals the object
|
int |
getEnd()
Returns the end location movement
|
static boolean |
movePossible(int die,
int player,
Board board)
Return whether or not a move is possible using
the given dice roll by the given player in the given board.
|
java.lang.String |
toString()
Returns a String representation of this move
|
public BarMovement(int player, int end)
player
- The player making the movementstart
- The start locationend
- The end locationpublic int getEnd()
public boolean canUse(Board board, int die)
public void apply(Board board) throws IllegalMoveException
apply
in class Movement
board
- The current setupIllegalMoveException
public static boolean movePossible(int die, int player, Board board)
int
- die The dice rollplayer
- The playerboard
- The boardpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object