|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--aMove
This class defines what a move is and provides methods for generating moves for a player or for a piece. There are two fields, both ints, start and end. start is the number of position of the piece before the move is made, while end is the number of the position where the piece ends up after making the move.
| Constructor Summary | |
aMove()
The start and end are both initialized to -1. |
|
aMove(int i,
int j)
Start is set to be i, and end is set to be j. |
|
| Method Summary | |
int |
GetEnd()
Returns end |
static java.util.LinkedList |
GetMoves(CheckerBoard b,
char c)
Given a CheckerBoard and a player, returns a LinkedList of aMoves that includes all legal moves (but no jumps) that the player can make. |
static java.util.LinkedList |
GetMoves(CheckerBoard b,
int pos)
Given a checkerboard and an int specifying a board position, returns a LinkedList of all possible moves (but no jumps) that can be made by the piece in that position. |
int |
GetStart()
Returns start |
static CheckerBoard |
MakeMove(CheckerBoard b,
aMove m)
Given a CheckerBoard and an aMove, returns a new CheckerBoard where the move has been executed. |
void |
Set(int i,
int j)
Start is set to be i, and end is set to be j. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public aMove()
public aMove(int i,
int j)
| Method Detail |
public void Set(int i,
int j)
public int GetStart()
public int GetEnd()
public static java.util.LinkedList GetMoves(CheckerBoard b,
char c)
public static java.util.LinkedList GetMoves(CheckerBoard b,
int pos)
public static CheckerBoard MakeMove(CheckerBoard b,
aMove m)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||