edu.rice.comp440.move
Class MovementFactory

java.lang.Object
  |
  +--edu.rice.comp440.move.MovementFactory

public class MovementFactory
extends java.lang.Object


Constructor Summary
MovementFactory()
           
 
Method Summary
protected static java.util.Collection generateMoves(Move base)
           
static Move[] getAllMoves(int player, Dice dice, Board board)
          Returns all possible distinct moves for the given player given the starting board and the given dice roll.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MovementFactory

public MovementFactory()
Method Detail

movePossible

public 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. Checks to see if a bar, bear off, or normal movement are possible.
Parameters:
int - die The dice roll
player - The player
board - The board
Returns:
Wether or not a move is possible

getAllMoves

public static Move[] getAllMoves(int player,
                                 Dice dice,
                                 Board board)
Returns all possible distinct moves for the given player given the starting board and the given dice roll.
Parameters:
player - The player who is active
dice - The dice roll
board - The current board
Returns:
All of the possible moves

generateMoves

protected static java.util.Collection generateMoves(Move base)