edu.rice.comp440.move
Class Movement

java.lang.Object
  |
  +--edu.rice.comp440.move.Movement
Direct Known Subclasses:
BarMovement, BearOffMovement, NormalMovement

public abstract class Movement
extends java.lang.Object


Field Summary
protected  int player
           
 
Constructor Summary
Movement(int player)
          Constructor, taking the player
 
Method Summary
abstract  void apply(Board board)
          Validates this movement given the provided board situation.
abstract  boolean canUse(Board board, int die)
          Returns whether or not this movement can use the given dice roll to perfrom it's movement
 int getPlayer()
          Returns the player making this movement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

player

protected int player
Constructor Detail

Movement

public Movement(int player)
Constructor, taking the player
Parameters:
player - The player
Method Detail

getPlayer

public int getPlayer()
Returns the player making this movement
Returns:
The die used for this movement

apply

public abstract void apply(Board board)
                    throws IllegalMoveException
Validates this movement given the provided board situation.
Parameters:
board - The current setup

canUse

public abstract boolean canUse(Board board,
                               int die)
Returns whether or not this movement can use the given dice roll to perfrom it's movement
Parameters:
die - The dice roll
Returns:
Wether or not that roll can make this move