|
Jadex 0.96 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjadex.examples.puzzle.JackBoard
public class JackBoard
The View Board represents the puzzle board and the pegs.
Field Summary | |
---|---|
SimplePropertyChangeSupport |
pcs
|
Fields inherited from interface jadex.examples.puzzle.IBoard |
---|
MOVE, TAKEBACK |
Constructor Summary | |
---|---|
JackBoard()
|
Method Summary | |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. |
List |
getCurrentPosition()
Get the current board position. |
Move |
getLastMove()
Get all moves made so far. |
List |
getMoves()
Get all moves made so far. |
Piece |
getPiece(Position pos)
Get a piece for a location. |
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(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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public SimplePropertyChangeSupport pcs
Constructor Detail |
---|
public JackBoard()
Method Detail |
---|
public Piece getPiece(Position pos)
getPiece
in interface IBoard
public List getPossibleMoves()
getPossibleMoves
in interface IBoard
public boolean move(Move move)
move
in interface IBoard
move
- The move.public boolean takeback()
takeback
in interface IBoard
public boolean isSolution()
isSolution
in interface IBoard
public List getMoves()
getMoves
in interface IBoard
public Move getLastMove()
getLastMove
in interface IBoard
public boolean wasLastMoveWhite()
wasLastMoveWhite
in interface IBoard
public int getSize()
getSize
in interface IBoard
public List getCurrentPosition()
getCurrentPosition
in interface IBoard
public boolean isFreePosition(Position pos)
isFreePosition
in interface IBoard
public void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
in interface IBoard
listener
- The PropertyChangeListener to be added.public void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener
in interface IBoard
listener
- The PropertyChangeListener to be removed.
|
Jadex 0.96 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.