|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Implementations of this interface can be registered in
the BoardState
and will receive events when the state changes.
BoardStateListener
is used for low-level reports when pieces should
be moved on a gui, etc.
Method Summary | |
void |
gameFinished(boolean whiteWinner,
int loserPiecesLeft,
int points)
Called from BoardState when a game is finished |
void |
pieceMoved(boolean white,
int from,
int to)
Called from BoardState whenever a piece is moved. |
void |
turnChange(boolean whiteTurn)
Called from BoardState when turn changes. |
void |
undoAdded(int undos,
int diceValue)
Called from BoardState when a possible undo has been added |
void |
undoPerformed(int undos,
int diceValue)
Called from BoardState when an undo is performed. |
Method Detail |
public void turnChange(boolean whiteTurn)
whiteTurn
- true if white turn, false if black.public void pieceMoved(boolean white, int from, int to)
white
- true if white piece, false otherwisefrom
- piece source indexto
- piece destination indexpublic void undoAdded(int undos, int diceValue)
undos
- Number of current undosdiceValue
- The dice value that can be used for undo (1-6)public void undoPerformed(int undos, int diceValue)
undos
- Number of current undosdiceValue
- The dice value that was used for undo (1-6)public void gameFinished(boolean whiteWinner, int loserPiecesLeft, int points)
whiteWinner
- True if white player wins, false if black player winsloserPiecesLeft
- Total number of loser pieces leftpoints
- Point per piece
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |