Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MOVE
Property event for move made.
|
static java.lang.String |
TAKEBACK
Property event for move taken back.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(jadex.commons.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list.
|
java.util.List<Piece> |
getCurrentPosition()
Get the current board position.
|
Move |
getLastMove()
Get all moves made so far.
|
java.util.List<Move> |
getMoves()
Get all moves made so far.
|
Piece |
getPiece(Position pos)
Get a piece for a location.
|
java.util.List<Move> |
getPossibleMoves()
Get possible moves.
|
int |
getSize()
Get the board size.
|
boolean |
isFreePosition(Position pos)
Test if aposition is free.
|
boolean |
isSolution()
Test if it is a solution.
|
boolean |
move(Move move)
Do a move.
|
void |
removePropertyChangeListener(jadex.commons.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list.
|
boolean |
takeback()
Takeback a move.
|
boolean |
wasLastMoveWhite()
Test if the last move was with a white piece.
|
static final java.lang.String MOVE
static final java.lang.String TAKEBACK
java.util.List<Move> getPossibleMoves()
boolean move(Move move)
move
- The move.boolean takeback()
boolean isSolution()
java.util.List<Move> getMoves()
Move getLastMove()
int getSize()
java.util.List<Piece> getCurrentPosition()
boolean isFreePosition(Position pos)
boolean wasLastMoveWhite()
void addPropertyChangeListener(jadex.commons.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener to be added.void removePropertyChangeListener(jadex.commons.beans.PropertyChangeListener listener)
listener
- The PropertyChangeListener to be removed.