Package jadex.bdi.puzzle
Class JackBoard
java.lang.Object
jadex.bdi.puzzle.JackBoard
- All Implemented Interfaces:
IBoard,Serializable
The View Board represents the puzzle board and the pegs.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd 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.intgetSize()Get the board size.booleanisFreePosition(Position pos) Test if a position is free.booleanTest if it is a solution.booleanDo a move.voidRemove a PropertyChangeListener from the listener list.booleantakeback()Takeback a move.booleanTest if the last move was with a white piece.
-
Field Details
-
white_piece
-
black_piece
-
moves
-
pcs
-
-
Constructor Details
-
JackBoard
public JackBoard()
-
-
Method Details
-
getPiece
Get a piece for a location. -
getPossibleMoves
Get possible moves.- Specified by:
getPossibleMovesin interfaceIBoard- Returns:
- Get all possible move.
-
move
Do a move. -
takeback
public boolean takeback()Takeback a move. -
isSolution
public boolean isSolution()Test if it is a solution.- Specified by:
isSolutionin interfaceIBoard- Returns:
- True, if solution.
-
getMoves
Get all moves made so far. -
getLastMove
Get all moves made so far.- Specified by:
getLastMovein interfaceIBoard
-
wasLastMoveWhite
public boolean wasLastMoveWhite()Test if the last move was with a white piece. When no move was made, it return true.- Specified by:
wasLastMoveWhitein interfaceIBoard- Returns:
- True, is last move was with white piece.
-
getSize
public int getSize()Get the board size. -
getCurrentPosition
Get the current board position.- Specified by:
getCurrentPositionin interfaceIBoard
-
isFreePosition
Test if a position is free.- Specified by:
isFreePositionin interfaceIBoard
-
addPropertyChangeListener
Add a PropertyChangeListener to the listener list. The listener is registered for all properties.- Specified by:
addPropertyChangeListenerin interfaceIBoard- 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.- Specified by:
removePropertyChangeListenerin interfaceIBoard- Parameters:
listener- The PropertyChangeListener to be removed.
-