wyvern.lib.classes.construct
Class SpiralStair

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

public class SpiralStair
extends Teleporter
implements Command

A staircase that has 2 destination teleporters, one for "up" and one for "down".

Version:
1.0, Mar 15, 2000
Author:
Steve Yegge

Field Summary
 
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
SpiralStair()
           
 
Method Summary
 void apply(Commandable agent)
          User applied the staircase.
 CommandEvent createEvent(CommandEvent initial)
          Creates an event to encapsulate the move.
 boolean execute(CommandEvent event)
          Executes the event.
 Teleporter getDownTeleporter()
          Returns the down-teleporter instance, if any.
 Teleporter getUpTeleporter()
          Returns the up-teleporter instance, if any.
 boolean goDownstairs(Commandable agent)
          Sends the agent through the down-teleporter.
 boolean goUpstairs(Commandable agent)
          Sends the agent through the up-teleporter.
 void initialize()
          Initializes the object's default properties.
 boolean knowsCommand(java.lang.String command)
          Returns true if we want to handle the command.
protected  void setDestinationTeleporters()
          Creates "@up-loc" and "@down-loc" Teleporters for the "up" and/or "down" Location properties.
 void setDownTeleporter(Teleporter down)
          Sets the "down" destination for this staircase.
 void setUpTeleporter(Teleporter up)
          Sets the "up" destination for this staircase.
 
Methods inherited from class wyvern.lib.classes.Teleporter
checkBounds, checkPerPlayer, checkRelativePath, chooseRandomLocation, getDestination, getDestLoc, getDestMap, getWaitMessage, loadMap, parseDestination, passedClaim, pathOutIsBlocked, printLoadMessage, setDestination, setDestination, setMap, startTeleport, 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
 

Constructor Detail

SpiralStair

public SpiralStair()
Method Detail

initialize

public void initialize()
Description copied from interface: GameObject
Initializes the object's default properties. Any GameObject implementation that wishes to initialize itself should do so here, rather than in the constructor. This is because nearly all game objects inherit from an archetype, and the archetype parent pointer isn't set until the object's constructor finishes. This is a good place to add any class-default properties for an object - properties that the object gets regardless of which archetype it inherits from. WARNING: don't forget to call the superclass' initialize() method, or the object may not function properly. For instance, it won't become animated even if it specifies animation parameters in the archetype.

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

setDestinationTeleporters

protected void setDestinationTeleporters()
Creates "@up-loc" and "@down-loc" Teleporters for the "up" and/or "down" Location properties.


knowsCommand

public boolean knowsCommand(java.lang.String command)
Returns true if we want to handle the command.

Specified by:
knowsCommand in interface Command
Parameters:
command - the entire command string, including arguments
Returns:
true if we want to handle the command

createEvent

public CommandEvent createEvent(CommandEvent initial)
Creates an event to encapsulate the move.

Specified by:
createEvent in interface Command
Parameters:
initial - 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).
Returns:
a CommandEvent subclass encapsulating this command's execution parameters and state. It should copy in the fields from the passed-in event.

execute

public boolean execute(CommandEvent event)
Executes the event.

Specified by:
execute in interface Command
Parameters:
event - the "up" or "down" event
Returns:
true if the event completed successfully, else false.

goUpstairs

public boolean goUpstairs(Commandable agent)
Sends the agent through the up-teleporter.


goDownstairs

public boolean goDownstairs(Commandable agent)
Sends the agent through the down-teleporter.


apply

public void apply(Commandable agent)
User applied the staircase.

Specified by:
apply in interface Applyable
Overrides:
apply in class Teleporter
Parameters:
agent - to teleport

getUpTeleporter

public Teleporter getUpTeleporter()
Returns the up-teleporter instance, if any.


getDownTeleporter

public Teleporter getDownTeleporter()
Returns the down-teleporter instance, if any.


setUpTeleporter

public void setUpTeleporter(Teleporter up)
Sets the "up" destination for this staircase.


setDownTeleporter

public void setDownTeleporter(Teleporter down)
Sets the "down" destination for this staircase.