Class Mover

java.lang.Object
  |
  +--Mover

public class Mover
extends java.lang.Object

This class generates all legal moves. There are two fields, moves and jumps. moves is a LinkedList of elements of type aMove. jumps is a LinkedList of elements of type LinkedLists of Integers (the representation for jump). If there is at least one jump, then the jump must be taken. Therefore, if there is at least one jump, then move = null. If there are no legal jumps, then jump = null.


Field Summary
 java.util.LinkedList jumps
           
 java.util.LinkedList moves
           
 
Method Summary
 void GetMoves(CheckerBoard b, char player)
          Given a CheckerBoard and a player (indicated by either 'p'.
 void GetMoves(CheckerBoard b, int pos)
          Given a CheckerBoard and a position on the board, sets moves to be all legal moves and jumps to be all legal jumps.
 java.util.LinkedList Jumps()
          Returns jumps
 java.util.LinkedList Moves()
          Returns moves.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

moves

public java.util.LinkedList moves

jumps

public java.util.LinkedList jumps
Method Detail

Moves

public java.util.LinkedList Moves()
Returns moves.


Jumps

public java.util.LinkedList Jumps()
Returns jumps


GetMoves

public void GetMoves(CheckerBoard b,
                     char player)
Given a CheckerBoard and a player (indicated by either 'p'. 'P', 'o', or 'O'), sets moves to be all legal moves and jumps to be all legal jumps. Note the comment at the beginning of this classes documentation.


GetMoves

public void GetMoves(CheckerBoard b,
                     int pos)
Given a CheckerBoard and a position on the board, sets moves to be all legal moves and jumps to be all legal jumps. Note the comment at the beginning of this classes documentation.