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 IBoard
public boolean move(Move move)
public boolean isSolution()
isSolution
in interface IBoard
public java.util.List getMoves()
public Move getLastMove()
getLastMove
in interface IBoard
public boolean wasLastMoveWhite()
wasLastMoveWhite
in interface IBoard
public java.util.List getCurrentPosition()
getCurrentPosition
in interface IBoard
public boolean isFreePosition(Position pos)
isFreePosition
in interface IBoard
public void addPropertyChangeListener(jadex.commons.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface IBoard
listener
- The PropertyChangeListener to be added.public void removePropertyChangeListener(jadex.commons.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface IBoard
listener
- The PropertyChangeListener to be removed.