wyvern.lib.classes.games.sokoban
Class Sokoban

java.lang.Object
  extended bywyvern.kernel.properties.PList
      extended bywyvern.kernel.maps.MapObject
          extended bywyvern.lib.classes.Teleporter
              extended bywyvern.lib.classes.games.sokoban.Sokoban
All Implemented Interfaces:
Applyable, Broadcaster, GameObject, MethodHookable, PropertyList, WalkNotify

public class Sokoban
extends Teleporter

This class implements a dungeon (or tower, take your pick) whose floors are Sokoban levels.

Version:
1.0, Jun 07, 1998
Author:
Steve Yegge

Field Summary
static int MAX_LEVELS
           
 
Fields inherited from class wyvern.lib.classes.Teleporter
FORCE_PLAYERS, MAX_DISTANCE, PLEASE_WAIT_MSG
 
Fields inherited from class wyvern.kernel.maps.MapObject
IN_MAP_EDITOR, listenerList_
 
Fields inherited from class wyvern.kernel.properties.PList
readOnly_
 
Fields inherited from interface wyvern.lib.PropertyList
PROPERTY_PACKAGE
 
Constructor Summary
Sokoban()
           
 
Method Summary
 void advanceLevel(SokobanLevel map, Commandable agent)
          Advances the agent to the next level.
 void createBag(SokobanLevel level, Archetype bag, int x, int y)
          Creates a bag at the passed location.
 Terrain getSafeTerrain()
          Returns the Terrain to use for safe spots.
 void initialize()
          Sets default properties.
 void setSafeSpot(SokobanLevel level, Terrain safe, java.util.List safe_points, int x, int y)
          Sets safe spot at passed location.
 void startTeleport(Commandable agent)
          User has applied the teleporter.
 
Methods inherited from class wyvern.lib.classes.Teleporter
apply, checkBounds, checkPerPlayer, checkRelativePath, chooseRandomLocation, getDestination, getDestLoc, getDestMap, getWaitMessage, loadMap, parseDestination, passedClaim, pathOutIsBlocked, printLoadMessage, setDestination, setDestination, setMap, steppedOn, teleport, teleport, teleport, teleport, toString, tryForcing, validateLevel
 
Methods inherited from class wyvern.kernel.maps.MapObject
addContainerChangeListener, addDefaultProperty, addMapChangeListener, addMapMotionListener, addMethodHook, addMotionTracker, addObjectTracker, addPrefix, addSuffix, addToMap, bless, broadcast, broadcast, broadcast, broadcast, broadcast, canEnter, canEnterBlockedBy, canMove, canMove, canMoveBlockedBy, canMoveBlockedBy, canMoveTo, canMoveToBlockedBy, checkDrop, curse, cycleFrame, destroy, ensureListenerList, ensureWeight, externalize, fireContainerEntered, fireContainerExited, fireEnteredMap, fireExitedMap, fireMovedInMap, getAlpha, getAppearance, getArchetype, getBaseName, getBaseWeight, getBitmap, getBounds, getCanonicalClassName, getCategory, getContainer, getCreator, getDamagedDescription, getDescription, getDirection, getGenderPossessive, getGenderPronoun, getImage, getImageDescriptor, getImageDescriptors, getLayer, getLocations, getMap, getMapLink, getMaterial, getMaterialDescription, getMover, getOwningPlayer, getParentMap, getPrefixes, getQuantity, getReferenceLoc, getRelativeLocs, getShortDesc, getSuffixes, getTile, getTile, getValue, getWeight, groupString, inContainer, initLocs, inMapEditor, invalidate, invalidateImage, invalidateParent, invalidateText, isAnimated, isAttackable, isBlessed, isCommandable, isCursed, isDamned, isGroupable, isIdentified, isMonster, isMonsterOrPlayer, isPlayer, isTerrain, isUncursed, isUnpaid, isWizard, makeClone, markPaid, markUnpaid, move, occupies, positionAt, positionAtMap, remove, removeContainerChangeListener, removeFromMap, removeMapChangeListener, removeMapMotionListener, removeMethodHook, removeMotionTracker, removeObjectTracker, removePrefix, removeSuffix, runMethodHook, setAlpha, setAnimated, setBitmap, setCategory, setContainer, setDefaultBitmap, setDefaultCategory, setDefaultDesc, setDefaultImage, setDefaultIntProperty, setDefaultLayer, setDefaultMaterial, setDefaultProperty, setDefaultShortDesc, setDirection, setImage, setImage, setLayer, setLocations, setMapLink, setQuantity, setShape, setSize, setTransientSize, setWeight, setWeight, teleport, updateMapLocation
 
Methods inherited from class wyvern.kernel.properties.PList
addProperty, addTransientProperty, adjustDoubleProperty, adjustIntProperty, adjustLongProperty, adjustTransientDoubleProperty, adjustTransientIntProperty, adjustTransientLongProperty, countLocalProperties, debugProperties, dismantlePropertyList, getDoubleProperty, getInheritedProperty, getInteger, getIntProperty, getLocalProperties, getLocalProperty, getLongProperty, getParent, getPersistentDoubleProperty, getPersistentIntProperty, getPersistentLocalProperties, getPersistentLongProperty, getPersistentProperty, getProfilingInfo, getProperties, getProperties, getPropertiesIncludingTransients, getPropertiesIncludingTransients, getProperty, getSerializableProperties, getSerializableProperty, getStringProperty, getTransientDoubleProperty, getTransientIntProperty, getTransientLongProperty, getTransientProperties, getTransientProperty, hasLocalProperty, hasPersistentProperty, hasProperty, hasTransientProperty, inheritProperty, isReadOnly, isRemoved, isTransientlyRemoved, printLocalProperties, printProperties, printProperties, printTransientProperties, removeProperty, removeTransientProperty, setDoubleProperty, setIntProperty, setLongProperty, setParent, setProperty, setReadOnly, setTransientDoubleProperty, setTransientIntProperty, setTransientLongProperty, setTransientProperty, toString, transientlyRemoveProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wyvern.lib.PropertyList
addProperty, addTransientProperty, adjustDoubleProperty, adjustIntProperty, adjustLongProperty, adjustTransientDoubleProperty, adjustTransientIntProperty, adjustTransientLongProperty, countLocalProperties, getDoubleProperty, getInheritedProperty, getIntProperty, getLocalProperties, getLocalProperty, getLongProperty, getParent, getPersistentDoubleProperty, getPersistentIntProperty, getPersistentLocalProperties, getPersistentLongProperty, getPersistentProperty, getProperties, getProperties, getPropertiesIncludingTransients, getPropertiesIncludingTransients, getProperty, getSerializableProperties, getSerializableProperty, getStringProperty, getTransientDoubleProperty, getTransientIntProperty, getTransientLongProperty, getTransientProperties, getTransientProperty, hasLocalProperty, hasPersistentProperty, hasProperty, hasTransientProperty, inheritProperty, isReadOnly, isRemoved, isTransientlyRemoved, printLocalProperties, printProperties, printProperties, printTransientProperties, removeProperty, removeTransientProperty, setDoubleProperty, setIntProperty, setLongProperty, setParent, setProperty, setReadOnly, setTransientDoubleProperty, setTransientIntProperty, setTransientLongProperty, setTransientProperty, toString, transientlyRemoveProperty
 

Field Detail

MAX_LEVELS

public static final int MAX_LEVELS
See Also:
Constant Field Values
Constructor Detail

Sokoban

public Sokoban()
Method Detail

initialize

public void initialize()
Sets default properties.

Specified by:
initialize in interface GameObject
Overrides:
initialize in class Teleporter

startTeleport

public void startTeleport(Commandable agent)
User has applied the teleporter. Figure out which level to load, and send them there.

Overrides:
startTeleport in class Teleporter
Parameters:
agent - the Commandable to teleport to our destination

setSafeSpot

public void setSafeSpot(SokobanLevel level,
                        Terrain safe,
                        java.util.List safe_points,
                        int x,
                        int y)
Sets safe spot at passed location.


createBag

public void createBag(SokobanLevel level,
                      Archetype bag,
                      int x,
                      int y)
               throws java.lang.Exception
Creates a bag at the passed location.

Throws:
java.lang.Exception

getSafeTerrain

public Terrain getSafeTerrain()
                       throws java.lang.Exception
Returns the Terrain to use for safe spots.

Throws:
java.lang.Exception

advanceLevel

public void advanceLevel(SokobanLevel map,
                         Commandable agent)
Advances the agent to the next level.

Parameters:
agent - the agent to move down