|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--Jump
This class defines what a jump is and provides methods for obtaining jumps. A jump is a LinkedList of Integers. The first element in the list is the starting position of the piece, the other elements are the positions on the board where the piece lands after jumping over an opponent's piece.
| Constructor Summary | |
Jump()
|
|
| Method Summary | |
static boolean |
CanJump(CheckerBoard b,
int pos)
Given a CheckerBoard and a position on the board, returns true if the piece at position pos can make a jump, false otherwise. |
static java.util.LinkedList |
GetJumps(CheckerBoard b,
char player)
Given a CheckerBoard and a player, returns a LinkedList containing all jumps that the player can make. |
static java.util.LinkedList |
GetJumps(CheckerBoard b,
int p)
Given a CheckerBoard and a position on the board, returns a LinkedList all possible jumps the piece at the position can make. |
static CheckerBoard |
MakeJump(CheckerBoard b,
java.util.LinkedList jump)
Given a CheckerBoard and a jump, returns a new CheckerBoard after the jump has been taken. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Jump()
| Method Detail |
public static java.util.LinkedList GetJumps(CheckerBoard b,
char player)
public static java.util.LinkedList GetJumps(CheckerBoard b,
int p)
public static boolean CanJump(CheckerBoard b,
int pos)
public static CheckerBoard MakeJump(CheckerBoard b,
java.util.LinkedList jump)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||