public class JackBoard extends java.lang.Object implements IBoard, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
protected Piece |
black_piece |
protected java.util.ArrayList |
moves |
jadex.commons.SimplePropertyChangeSupport |
pcs |
protected Piece |
white_piece |
| Constructor and Description |
|---|
JackBoard() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(jadex.commons.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list.
|
java.util.List |
getCurrentPosition()
Get the current board position.
|
Move |
getLastMove()
Get all moves made so far.
|
java.util.List |
getMoves()
Get all moves made so far.
|
Piece |
getPiece(Position pos)
Get a piece for a location.
|
java.util.List |
getPossibleMoves()
Get possible moves.
|
int |
getSize()
Get the board size.
|
boolean |
isFreePosition(Position pos)
Test if a position 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.
|
protected Piece white_piece
protected Piece black_piece
protected java.util.ArrayList moves
public jadex.commons.SimplePropertyChangeSupport pcs
public java.util.List getPossibleMoves()
getPossibleMoves in interface IBoardpublic boolean move(Move move)
public boolean isSolution()
isSolution in interface IBoardpublic java.util.List getMoves()
public Move getLastMove()
getLastMove in interface IBoardpublic boolean wasLastMoveWhite()
wasLastMoveWhite in interface IBoardpublic java.util.List getCurrentPosition()
getCurrentPosition in interface IBoardpublic boolean isFreePosition(Position pos)
isFreePosition in interface IBoardpublic void addPropertyChangeListener(jadex.commons.beans.PropertyChangeListener listener)
addPropertyChangeListener in interface IBoardlistener - The PropertyChangeListener to be added.public void removePropertyChangeListener(jadex.commons.beans.PropertyChangeListener listener)
removePropertyChangeListener in interface IBoardlistener - The PropertyChangeListener to be removed.