|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.properties.PList wyvern.kernel.maps.AbstractGameMap wyvern.kernel.maps.DenseMap wyvern.lib.classes.games.sokoban.SokobanLevel
This class implements a single Sokoban level.
Nested Class Summary |
Nested classes inherited from class wyvern.lib.GameMap |
GameMap.UnloadMapConstants |
Field Summary |
Fields inherited from class wyvern.kernel.maps.DenseMap |
addRemoveListeners_, cachedBounds_, count_, lighting_, objects_, outOfBoundsTerrain_, size_ |
Fields inherited from class wyvern.kernel.maps.AbstractGameMap |
ambient_, changeList_, commands_, dark_, defaultTerrain_, dense_, dirtyRegions_, lights_, locals_, mapHooks_, monsters_, name_, opaqueMap_, path_, perPlayer_, players_, proxHooks_, roomHooks_, suspended_, suspendTime_, suspendTimer_, teleporters_, unloadImmediately_, unloading_, visUpdates_, vpath_ |
Fields inherited from class wyvern.kernel.properties.PList |
readOnly_ |
Fields inherited from interface wyvern.lib.GameMap |
MAX_HEIGHT, MAX_SEARCH_RADIUS, MAX_WIDTH |
Fields inherited from interface wyvern.lib.PropertyList |
PROPERTY_PACKAGE |
Fields inherited from interface wyvern.lib.GameMap.UnloadMapConstants |
MAP_CONTAINS_PLAYERS, MAP_NOT_LOADED, SUCCESS |
Constructor Summary | |
SokobanLevel(Sokoban parent,
int width,
int height,
int level)
Constructs a new SokobanLevel. |
Method Summary | |
CommandEvent |
createEvent(CommandEvent event)
Creates the event for one of our commands. |
boolean |
execute(CommandEvent event)
Executes one of our commands. |
Location |
getExit()
Returns the Location to dump the player on exiting the dungeon. |
int |
getLevel()
Returns our level number. |
int |
getPushes()
Returns the number of times a bag has been pushed successfully. |
java.util.List |
getSafePoints()
Returns the safe-points list for the level. |
boolean |
handleMouse(Commandable agent,
Point loc)
(Try to) run to the location they clicked on. |
void |
hookEvent(java.lang.String hookname,
CommandEvent event)
Player moved, pushed, or whatever. |
boolean |
knowsCommand(java.lang.String cmd)
Says which commands we provide. |
void |
mouseClicked(MouseCommandEvent event)
Called when an agent clicks the mouse (any button) over the object. |
void |
setExit(java.lang.String path,
int x,
int y)
Sets the exit map for this level. |
void |
setSafePoints(java.util.List points)
Stores the safe-point list for this level. |
boolean |
undo(Commandable agent)
Undoes the last push. |
Methods inherited from class wyvern.kernel.maps.DenseMap |
add, add, addIntensityArray, adjustIntensity, checkBounds, checkBounds, createLightMatrix, dismantle, getBounds, getLightLevel, getObjectCount, getOrCreatecell, getOutOfBoundsTerrain, getProperties, getPropertyList, getSize, initialize, initialize, isSparse, iterator, keySet, objectsAt, objectsInRect, registerAddRemoveListener, remove, remove, setOutOfBoundsTerrain, setOutOfBoundsTerrain, setSize, setTerrain, terrainAt, unregisterAddRemoveListener, visitRect |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SokobanLevel(Sokoban parent, int width, int height, int level)
Method Detail |
public void hookEvent(java.lang.String hookname, CommandEvent event)
hookEvent
in interface HookCallback
hookname
- the name of the hook, such as "movePreHook".event
- the CommandEvent encapsulating the event parameterspublic void setExit(java.lang.String path, int x, int y)
path
- the map pathx
- map xy
- map ypublic Location getExit()
public void setSafePoints(java.util.List points)
points
- the list of safe pointspublic java.util.List getSafePoints()
public int getLevel()
public int getPushes()
public void mouseClicked(MouseCommandEvent event)
mouseClicked
in interface MouseInterest
event
- the command event. event.getAgent() will
return the Player who clicked the mouse.public boolean handleMouse(Commandable agent, Point loc)
public boolean undo(Commandable agent)
public boolean knowsCommand(java.lang.String cmd)
knowsCommand
in interface Command
cmd
- the entire command string, including arguments
public CommandEvent createEvent(CommandEvent event)
createEvent
in interface Command
event
- a "blank" CommandEvent containing only the
command text and the agent who's performing the command. This
initial event is created by the originator of the event (e.g.
the AI or player's command preprocessor).
public boolean execute(CommandEvent event)
execute
in interface Command
event
- the CommandEvent to execute
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |