|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--be.madoka.aardbei.sokoban.logic.Piece
Represents an item that can exist in a World.
Constructor Summary | |
Piece(Position position)
Default constructor. |
Method Summary | |
void |
addPropertyListener(java.beans.PropertyChangeListener pcl)
Adds the given PropertyListener. |
void |
addVetoableChangeListener(java.beans.VetoableChangeListener vcl)
Adds the given VetoAbleChangeListener. |
int |
getMoves()
Gives the number moves this Piece has made. |
abstract java.lang.String |
getName()
Returns the name of this Piece. |
Position |
getOldPosition()
Returns the previous Position of this Piece. |
Position |
getPosition()
Returns the Position of this Piece. |
boolean |
move(int direction)
Moves into the given direction. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
|
void |
removePropertyListener(java.beans.PropertyChangeListener pcl)
Removes the given PropertyListener. |
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener vcl)
Removes the given VetoAbleChangeListener. |
void |
vetoableChange(java.beans.PropertyChangeEvent e)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Piece(Position position)
position
- the PositionMethod Detail |
public void addVetoableChangeListener(java.beans.VetoableChangeListener vcl)
vcl
- the VetoAbleChangeListenerpublic void removeVetoableChangeListener(java.beans.VetoableChangeListener vcl)
vcl
- the VetoAbleChangeListenerpublic void addPropertyListener(java.beans.PropertyChangeListener pcl)
pcl
- the PropertyListenerpublic void removePropertyListener(java.beans.PropertyChangeListener pcl)
pcl
- the PropertyListenerpublic abstract java.lang.String getName()
String
specifying the name of this Piecepublic Position getPosition()
Position
specifying the Position of this Piecepublic Position getOldPosition()
Position
specifying the previous Position of this Piecepublic boolean move(int direction)
direction
- the direction
boolean/ specifying if the move was succesfull or not
public int getMoves()
int
specifying the number of movespublic void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange
in interface java.beans.PropertyChangeListener
public void vetoableChange(java.beans.PropertyChangeEvent e) throws java.beans.PropertyVetoException
vetoableChange
in interface java.beans.VetoableChangeListener
java.beans.PropertyVetoException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |