Package jadex.bdiv3.examples.puzzle
Interface IBoard
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addPropertyChangeListener(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(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.
-
-
-
Field Detail
-
MOVE
static final java.lang.String MOVE
Property event for move made.- See Also:
- Constant Field Values
-
TAKEBACK
static final java.lang.String TAKEBACK
Property event for move taken back.- See Also:
- Constant Field Values
-
-
Method Detail
-
getPossibleMoves
java.util.List<Move> getPossibleMoves()
Get possible moves.- Returns:
- Get all possible move.
-
move
boolean move(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
java.util.List<Move> getMoves()
Get all moves made so far.
-
getLastMove
Move getLastMove()
Get all moves made so far.
-
getSize
int getSize()
Get the board size.
-
getCurrentPosition
java.util.List<Piece> getCurrentPosition()
Get the current board position.
-
isFreePosition
boolean isFreePosition(Position pos)
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
void addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. The listener is registered for all properties.- Parameters:
listener
- The PropertyChangeListener to be added.
-
removePropertyChangeListener
void removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.- Parameters:
listener
- The PropertyChangeListener to be removed.
-
-