|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcheckers.model.Rules
public class Rules
This class is used to check the validity of the moves made by the players. It also checks to see if the conditions for the end of the game have been met.
Field Summary |
---|
Fields inherited from interface checkers.CheckersConstants |
---|
ACCEPT, BLUE, CLIENTGAME, DRAW, HOST, HOSTGAME, JOIN, KING, LOCAL, LOCALGAME, NUM_SPACES, PLAYER1SET, PLAYER2SET, RESIGN, SINGLE, UPDATE, WHITE |
Method Summary | |
---|---|
static Rules |
getInstance()
getInstance Creates the singleton instance of the Rules object |
int |
getJumpIndex()
getJumpIndex get the index of the jumped piece |
boolean |
isJump(int start,
int end)
isJump Checks to see if the move is a valid jump |
void |
setBoard(Board theBoard)
setBoard Sets the board |
boolean |
validateMove(Move move)
This method checks to see if the move that was just made was valid and returns a boolean indicating that. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Rules getInstance()
public void setBoard(Board theBoard)
theBoard
- the checker boardpublic boolean validateMove(Move move)
move
- The move that is to be validated.
public boolean isJump(int start, int end)
start
- the start position of the given moveend
- the end position of the given move
public int getJumpIndex()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |