public class NormalMovement extends Movement
Constructor and Description |
---|
NormalMovement(int player,
int start,
int end)
Constructor, taking the player, the start 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
|
int |
getStart()
Returns the starting 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 NormalMovement(int player, int start, int end)
player
- The player making the movementstart
- The start locationend
- The end locationpublic int getStart()
public 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