Package jadex.bdi.puzzle
Interface IBoard
public interface IBoard
The interface for the playing board.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a PropertyChangeListener to the listener list.Get the current board position.Get all moves made so far.getMoves()
Get all moves made so far.Get a piece for a location.Get possible moves.int
getSize()
Get the board size.boolean
isFreePosition
(Position pos) Test if aposition is free.boolean
Test if it is a solution.boolean
Do a move.void
Remove a PropertyChangeListener from the listener list.boolean
takeback()
Takeback a move.boolean
Test if the last move was with a white piece.
-
Field Details
-
MOVE
Property event for move made.- See Also:
-
TAKEBACK
Property event for move taken back.- See Also:
-
-
Method Details
-
getPiece
Get a piece for a location. -
getPossibleMoves
Get possible moves.- Returns:
- Get all possible move.
-
move
Do a move.- Parameters:
move
- The move.
-
takeback
boolean takeback()Takeback a move. -
isSolution
boolean isSolution()Test if it is a solution.- Returns:
- True, if solution.
-
getMoves
List getMoves()Get all moves made so far. -
getLastMove
Move getLastMove()Get all moves made so far. -
getSize
int getSize()Get the board size. -
getCurrentPosition
List getCurrentPosition()Get the current board position. -
isFreePosition
Test if aposition is free. -
wasLastMoveWhite
boolean wasLastMoveWhite()Test if the last move was with a white piece. When no move was made, it return true.- Returns:
- True, is last move was with white piece.
-
addPropertyChangeListener
Add a PropertyChangeListener to the listener list. The listener is registered for all properties.- Parameters:
listener
- The PropertyChangeListener to be added.
-
removePropertyChangeListener
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.- Parameters:
listener
- The PropertyChangeListener to be removed.
-