|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--be.madoka.aardbei.sokoban.logic.World
Represents a World where Pieces can live in.
Constructor Summary | |
World(SokoLogic logic,
Dimension dimension)
Default constructor. |
Method Summary | |
boolean |
add(Piece piece)
Adds a Piece to this World. |
Piece |
findPiece(java.lang.String name)
Returns a Piece with the given name. |
java.util.Vector |
findPieces(java.lang.String name)
Returns all the Pieces with the givin name |
Dimension |
getDimension()
Gives the Dimension of this World. |
boolean |
move(int direction)
Moves all the Pieces into a given direction. |
boolean |
move(Piece piece,
int direction)
Moves a Piece into a given direction. |
java.util.Vector |
pieces()
Returns all the pieces. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
|
boolean |
removePiece(Piece piece)
Removes a given Piece from this World. |
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 World(SokoLogic logic, Dimension dimension)
logic
- the Logicdimension
- the DimensionMethod Detail |
public boolean move(int direction)
direction
-
boolean
specifying if the move was succesfull or notpublic boolean move(Piece piece, int direction)
piece
- the Piecedirection
- the direction
boolean
specifying if the move was succesfull or notpublic boolean add(Piece piece)
piece
- the Piece
boolean
specifying if the Piece was added or notpublic boolean removePiece(Piece piece)
piece
- the Piece
boolean
specifying if the piece was removed or notpublic Dimension getDimension()
Dimension
specifying the Dimension of this Worldpublic java.util.Vector pieces()
Vector
containing all the piecespublic Piece findPiece(java.lang.String name)
name
- the name
Piece
as requestedpublic java.util.Vector findPieces(java.lang.String name)
name
- the name
Vector
containing all the Piecespublic 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 |