com.planet_ink.coffee_mud.Exits
Class GenExit

java.lang.Object
  extended by com.planet_ink.coffee_mud.Exits.StdExit
      extended by com.planet_ink.coffee_mud.Exits.GenExit
All Implemented Interfaces:
Affectable, Behavable, CloseableLockable, CMObject, Contingent, Environmental, Modifiable, MsgListener, Physical, PhysicalAgent, Readable, StatsAffecting, Tickable, Exit, java.lang.Cloneable, java.lang.Comparable<CMObject>
Direct Known Subclasses:
GenAirLock, GenCurtain, GenDoor, Impassable

public class GenExit
extends StdExit
implements Modifiable


Field Summary
protected  java.lang.String closedText
           
protected  java.lang.String closeName
           
protected  java.lang.String description
           
protected  java.lang.String displayText
           
protected  boolean doorDefaultsClosed
           
protected  boolean doorDefaultsLocked
           
protected  java.lang.String doorName
           
protected  boolean hasADoor
           
protected  boolean hasALock
           
protected  boolean isReadable
           
protected  java.lang.String keyName
           
protected  java.lang.String name
           
protected  int openDelayTicks
           
protected  java.lang.String openName
           
 
Fields inherited from class com.planet_ink.coffee_mud.Exits.StdExit
affectPhyStats, affects, amDestroyed, basePhyStats, behaviors, cachedImageName, isLocked, isOpen, lastRoomID, me, miscText, phyStats, rawImageName, scripts, usage
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BEAMWEAPON, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
 
Constructor Summary
GenExit()
           
 
Method Summary
 java.lang.String closedText()
          Returns a text description of what this exit looks like when closed.
 java.lang.String closeWord()
          Returns the verb used for describing closing this exit, e.g.
 boolean defaultsClosed()
          For exits with a door, this returns whether this defaults in a closed state.
 boolean defaultsLocked()
          For exits with a door and lock, this returns whether this defaults in a closed and locked state.
 java.lang.String description()
          The basic description of this object, as shown when the item is directly LOOKed at.
 java.lang.String displayText()
          Gets the raw string used to show what this object looks like in the room.
 java.lang.String doorName()
          Returns the short name of this door, e.g.
protected  int getCodeNum(java.lang.String code)
           
 int getSaveStatIndex()
          Returns the index into the stat codes array where extra savable fields begins.
 java.lang.String getStat(java.lang.String code)
          An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders.
 java.lang.String[] getStatCodes()
          Returns an array of the string names of those fields which are modifiable on this object at run-time by builders.
 boolean hasADoor()
          Returns whether this has a door, and must be opened before being used.
 boolean hasALock()
          Returns whether this has a lock on it, and, if locked, must be unlocked before being used.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 boolean isGeneric()
          Whether the fields of this item are set in code, or set by builders.
 boolean isReadable()
          Returns whether this thing is readable when the player uses the READ command and targets it.
 boolean isStat(java.lang.String code)
          An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders.
 java.lang.String keyName()
          For things with doors and locks, this returns the unique string representing the key code required to unlock/lock it.
 java.lang.String Name()
          The raw unmodified name of this object as stored in the database.
 int openDelayTicks()
          Returns the number of ticks that this remains open when a mob or player changes it from a closed to an open state, and this thing defaults in a closed state.
 java.lang.String openWord()
          Returns the verb used for describing opening this exit, e.g.
 java.lang.String readableText()
          For things that are readable, this returns the readable string for this thing.
 boolean sameAs(Environmental E)
          Whether this object instance is functionally identical to the object passed in.
 void setDescription(java.lang.String newDescription)
          Sets the basic description of this object, as shown when the item is directly LOOKed at.
 void setDisplayText(java.lang.String newDisplayText)
          Sets the raw string used to show what this object looks like in the room.
 void setDoorsNLocks(boolean newHasADoor, boolean newIsOpen, boolean newDefaultsClosed, boolean newHasALock, boolean newIsLocked, boolean newDefaultsLocked)
          Modifies the various door/lock settings for this thing.
 void setExitParams(java.lang.String newDoorName, java.lang.String newCloseWord, java.lang.String newOpenWord, java.lang.String newClosedText)
          Sets various word descriptions used when doing some dynamic manipulations of this exit.
 void setKeyName(java.lang.String newKeyName)
          For things with doors and locks, this sets the unique string representing the key code required to unlock/lock it.
 void setMiscText(java.lang.String newText)
          For objects which have false for their isGeneric method, this is used to set any internally coded strings to change the nature or behavior of the object.
 void setName(java.lang.String newName)
          Sets the raw unmodified name of this object as stored in the database.
 void setOpenDelayTicks(int numTicks)
          Sets the number of ticks that this will remain open when a mob or player changes it from a closed to an open state, and this thing defaults in a closed state.
 void setReadable(boolean isTrue)
          Returns whether this thing is readable when the player uses the READ command and targets it.
 void setReadableText(java.lang.String text)
          For things that are readable, this set the readable string for this thing.
 void setStat(java.lang.String code, java.lang.String val)
          An alternative means of setting the values of those fields on this object which are modifiable at run-time by builders.
 void setTemporaryDoorLink(java.lang.String link)
          If this exit represents a route to a room not yet created, but whose room id is already known, this will set that designated room id.
 java.lang.String temporaryDoorLink()
          If this exit represents a route to a room not yet created, but whose room id is already known, this will return that designated room id.
 java.lang.String text()
          For objects which have false for their isGeneric method, this is used to set any internally coded strings to change the nature or behavior of the object.
 
Methods inherited from class com.planet_ink.coffee_mud.Exits.StdExit
addBehavior, addEffect, addNonUninvokableEffect, addScript, affectCharState, affectCharStats, affectPhyStats, amDestroyed, basePhyStats, behaviors, cloneFix, closeWordPastTense, compareTo, copyOf, delAllBehaviors, delAllEffects, delAllScripts, delBehavior, delEffect, delScript, description, destroy, displayText, eachBehavior, eachEffect, eachScript, effects, executeMsg, exitUsage, expirationDate, fetchBehavior, fetchBehavior, fetchEffect, fetchEffect, fetchScript, getTickStatus, image, initializeClass, isLocked, isOpen, isSavable, L, lastRoomUsedFrom, maxRange, minRange, miscTextFormat, name, name, newInstance, numBehaviors, numEffects, numScripts, okMessage, openWordPastTense, phyStats, rawImage, recoverPhyStats, scripts, setBasePhyStats, setExpirationDate, setImage, setSavable, tick, viewableText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

description

protected java.lang.String description

displayText

protected java.lang.String displayText

closedText

protected java.lang.String closedText

doorName

protected java.lang.String doorName

closeName

protected java.lang.String closeName

openName

protected java.lang.String openName

hasADoor

protected boolean hasADoor

doorDefaultsClosed

protected boolean doorDefaultsClosed

hasALock

protected boolean hasALock

doorDefaultsLocked

protected boolean doorDefaultsLocked

isReadable

protected boolean isReadable

openDelayTicks

protected int openDelayTicks

keyName

protected java.lang.String keyName
Constructor Detail

GenExit

public GenExit()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, Tech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Overrides:
ID in class StdExit
Returns:
the name of this class

isGeneric

public boolean isGeneric()
Description copied from interface: Environmental
Whether the fields of this item are set in code, or set by builders. Generic means that they are set by builders, in which case XML is returned by the text() method containing all of the values for all the fields.

Specified by:
isGeneric in interface Environmental
Overrides:
isGeneric in class StdExit
Returns:
whether this item is modifiable by builders
See Also:
Environmental.text()

text

public java.lang.String text()
Description copied from interface: Environmental
For objects which have false for their isGeneric method, this is used to set any internally coded strings to change the nature or behavior of the object. For objects which have true for their isGeneric method, this is used to set and parse the XML which will be used to fill out the fields in this object. Since Ability objects are never Generic, this will always be where parameters are read from an Ability instance.

Specified by:
text in interface Environmental
Overrides:
text in class StdExit
Returns:
either an open internal text string, or XML

setMiscText

public void setMiscText(java.lang.String newText)
Description copied from interface: Environmental
For objects which have false for their isGeneric method, this is used to set any internally coded strings to change the nature or behavior of the object. For objects which have true for their isGeneric method, this is used to set and parse the XML which will be used to fill out the fields in this object. Since Ability objects are never Generic, this will always be where parameters are read from an Ability instance.

Specified by:
setMiscText in interface Environmental
Overrides:
setMiscText in class StdExit
Parameters:
newText - either an open internal text string, or XML

Name

public java.lang.String Name()
Description copied from interface: Environmental
The raw unmodified name of this object as stored in the database. This is the name set by builders and used as a basis for the name() method.

Specified by:
Name in interface Environmental
Overrides:
Name in class StdExit
Returns:
the raw base name of this object on the map.
See Also:
Tickable.name()

setName

public void setName(java.lang.String newName)
Description copied from interface: Environmental
Sets the raw unmodified name of this object as stored in the database. This is the name set by builders and used as a basis for the name() method.

Specified by:
setName in interface Environmental
Overrides:
setName in class StdExit
Parameters:
newName - the raw base name of this object on the map.
See Also:
Environmental.Name()

displayText

public java.lang.String displayText()
Description copied from interface: Environmental
Gets the raw string used to show what this object looks like in the room. May be used as a basis for other methods, such as the title of rooms, and what an exit looks like when open. The value for Items may be null if the item is not displayed when the room is seen.

Specified by:
displayText in interface Environmental
Overrides:
displayText in class StdExit
Returns:
the string describing how this object looks in the room

setDisplayText

public void setDisplayText(java.lang.String newDisplayText)
Description copied from interface: Environmental
Sets the raw string used to show what this object looks like in the room. May be used as a basis for other methods, such as the title of rooms, and what an exit looks like when open. The value for Items may be null if the item is not displayed when the room is seen.

Specified by:
setDisplayText in interface Environmental
Overrides:
setDisplayText in class StdExit
Parameters:
newDisplayText - the string describing how this object looks in the room

description

public java.lang.String description()
Description copied from interface: Environmental
The basic description of this object, as shown when the item is directly LOOKed at.

Specified by:
description in interface Environmental
Overrides:
description in class StdExit
Returns:
the basic detail description of this object

setDescription

public void setDescription(java.lang.String newDescription)
Description copied from interface: Environmental
Sets the basic description of this object, as shown when the item is directly LOOKed at.

Specified by:
setDescription in interface Environmental
Overrides:
setDescription in class StdExit
Parameters:
newDescription - the basic detail description of this object

hasADoor

public boolean hasADoor()
Description copied from interface: CloseableLockable
Returns whether this has a door, and must be opened before being used.

Specified by:
hasADoor in interface CloseableLockable
Overrides:
hasADoor in class StdExit
Returns:
true if a door is present, false otherwise.
See Also:
CloseableLockable.isOpen(), CloseableLockable.isLocked()

hasALock

public boolean hasALock()
Description copied from interface: CloseableLockable
Returns whether this has a lock on it, and, if locked, must be unlocked before being used.

Specified by:
hasALock in interface CloseableLockable
Overrides:
hasALock in class StdExit
Returns:
whether a lock is present
See Also:
CloseableLockable.isOpen(), CloseableLockable.isLocked(), CloseableLockable.hasADoor()

defaultsLocked

public boolean defaultsLocked()
Description copied from interface: CloseableLockable
For exits with a door and lock, this returns whether this defaults in a closed and locked state.

Specified by:
defaultsLocked in interface CloseableLockable
Overrides:
defaultsLocked in class StdExit
Returns:
true if defaults closed and locked, false otherwise
See Also:
CloseableLockable.hasADoor(), CloseableLockable.defaultsClosed()

defaultsClosed

public boolean defaultsClosed()
Description copied from interface: CloseableLockable
For exits with a door, this returns whether this defaults in a closed state.

Specified by:
defaultsClosed in interface CloseableLockable
Overrides:
defaultsClosed in class StdExit
Returns:
true if defaults closed, false otherwise
See Also:
CloseableLockable.hasADoor(), CloseableLockable.defaultsLocked()

setDoorsNLocks

public void setDoorsNLocks(boolean newHasADoor,
                           boolean newIsOpen,
                           boolean newDefaultsClosed,
                           boolean newHasALock,
                           boolean newIsLocked,
                           boolean newDefaultsLocked)
Description copied from interface: CloseableLockable
Modifies the various door/lock settings for this thing.

Specified by:
setDoorsNLocks in interface CloseableLockable
Overrides:
setDoorsNLocks in class StdExit
Parameters:
newHasADoor - whether this has a door
newIsOpen - whether this is open for use
newDefaultsClosed - whether this defaults closed
newHasALock - whether this has a lock
newIsLocked - whether this is presently locked
newDefaultsLocked - whether this defaults closed and locked.
See Also:
CloseableLockable.isOpen(), CloseableLockable.isLocked(), CloseableLockable.hasADoor(), CloseableLockable.hasALock(), CloseableLockable.defaultsClosed(), CloseableLockable.defaultsLocked()

isReadable

public boolean isReadable()
Description copied from interface: Readable
Returns whether this thing is readable when the player uses the READ command and targets it.

Specified by:
isReadable in interface Readable
Overrides:
isReadable in class StdExit
Returns:
true if the thing is readable.
See Also:
Readable.readableText(), Readable.setReadable(boolean), Readable.setReadableText(String)

doorName

public java.lang.String doorName()
Description copied from interface: Exit
Returns the short name of this door, e.g. gate, door, portal, etc..

Specified by:
doorName in interface Exit
Overrides:
doorName in class StdExit
Returns:
the short name of this door.
See Also:
Exit.setExitParams(String, String, String, String)

closeWord

public java.lang.String closeWord()
Description copied from interface: Exit
Returns the verb used for describing closing this exit, e.g. close, lower, drop, etc..

Specified by:
closeWord in interface Exit
Overrides:
closeWord in class StdExit
Returns:
the short name of a verb used when closing this door.
See Also:
Exit.openWord(), CloseableLockable.hasADoor(), CloseableLockable.defaultsClosed(), Exit.setExitParams(String, String, String, String)

openWord

public java.lang.String openWord()
Description copied from interface: Exit
Returns the verb used for describing opening this exit, e.g. open, raise, lift, etc..

Specified by:
openWord in interface Exit
Overrides:
openWord in class StdExit
Returns:
the short name of a verb used when opening this door.
See Also:
Exit.closeWord(), CloseableLockable.hasADoor(), CloseableLockable.defaultsClosed(), Exit.setExitParams(String, String, String, String)

closedText

public java.lang.String closedText()
Description copied from interface: Exit
Returns a text description of what this exit looks like when closed.

Specified by:
closedText in interface Exit
Overrides:
closedText in class StdExit
Returns:
A description of this exit when closed.
See Also:
CloseableLockable.hasADoor(), CloseableLockable.defaultsClosed()

setExitParams

public void setExitParams(java.lang.String newDoorName,
                          java.lang.String newCloseWord,
                          java.lang.String newOpenWord,
                          java.lang.String newClosedText)
Description copied from interface: Exit
Sets various word descriptions used when doing some dynamic manipulations of this exit.

Specified by:
setExitParams in interface Exit
Overrides:
setExitParams in class StdExit
Parameters:
newDoorName - short name of this door, e.g. door, gate
newCloseWord - verb used to close this door, e.g. close, lower
newOpenWord - verb used to open this door, e.g. open, raise
newClosedText - description of this exit when in a closed state
See Also:
Exit.closeWord(), Exit.openWord(), Exit.doorName(), Exit.closedText()

readableText

public java.lang.String readableText()
Description copied from interface: Readable
For things that are readable, this returns the readable string for this thing. That is to say, what the player sees when they read the door.

Specified by:
readableText in interface Readable
Overrides:
readableText in class StdExit
Returns:
the readable string
See Also:
Readable.isReadable(), Readable.setReadable(boolean), Readable.setReadableText(String)

setReadable

public void setReadable(boolean isTrue)
Description copied from interface: Readable
Returns whether this thing is readable when the player uses the READ command and targets it. Readable text should also be set or unset.

Specified by:
setReadable in interface Readable
Overrides:
setReadable in class StdExit
Parameters:
isTrue - true if the thing is readable, and false otherwise
See Also:
Readable.readableText(), Readable.isReadable(), Readable.setReadableText(String)

setReadableText

public void setReadableText(java.lang.String text)
Description copied from interface: Readable
For things that are readable, this set the readable string for this thing. That is to say, what the player sees when they read the door.

Specified by:
setReadableText in interface Readable
Overrides:
setReadableText in class StdExit
Parameters:
text - the readable text
See Also:
Readable.isReadable(), Readable.setReadable(boolean), Readable.readableText()

keyName

public java.lang.String keyName()
Description copied from interface: CloseableLockable
For things with doors and locks, this returns the unique string representing the key code required to unlock/lock it.

Specified by:
keyName in interface CloseableLockable
Overrides:
keyName in class StdExit
Returns:
the key code
See Also:
CloseableLockable.setKeyName(String)

setKeyName

public void setKeyName(java.lang.String newKeyName)
Description copied from interface: CloseableLockable
For things with doors and locks, this sets the unique string representing the key code required to unlock/lock it.

Specified by:
setKeyName in interface CloseableLockable
Overrides:
setKeyName in class StdExit
Parameters:
newKeyName - the new key code
See Also:
CloseableLockable.keyName()

openDelayTicks

public int openDelayTicks()
Description copied from interface: CloseableLockable
Returns the number of ticks that this remains open when a mob or player changes it from a closed to an open state, and this thing defaults in a closed state.

Specified by:
openDelayTicks in interface CloseableLockable
Overrides:
openDelayTicks in class StdExit
Returns:
the number of ticks this remains open
See Also:
CloseableLockable.setOpenDelayTicks(int), Tickable.TICKID_EXIT_REOPEN

setOpenDelayTicks

public void setOpenDelayTicks(int numTicks)
Description copied from interface: CloseableLockable
Sets the number of ticks that this will remain open when a mob or player changes it from a closed to an open state, and this thing defaults in a closed state.

Specified by:
setOpenDelayTicks in interface CloseableLockable
Overrides:
setOpenDelayTicks in class StdExit
Parameters:
numTicks - the number of ticks this will remain open
See Also:
CloseableLockable.openDelayTicks(), Tickable.TICKID_EXIT_REOPEN

temporaryDoorLink

public java.lang.String temporaryDoorLink()
Description copied from interface: Exit
If this exit represents a route to a room not yet created, but whose room id is already known, this will return that designated room id.

Specified by:
temporaryDoorLink in interface Exit
Overrides:
temporaryDoorLink in class StdExit
Returns:
the room id of the room that will be linked in later
See Also:
Exit.setTemporaryDoorLink(String)

setTemporaryDoorLink

public void setTemporaryDoorLink(java.lang.String link)
Description copied from interface: Exit
If this exit represents a route to a room not yet created, but whose room id is already known, this will set that designated room id.

Specified by:
setTemporaryDoorLink in interface Exit
Overrides:
setTemporaryDoorLink in class StdExit
Parameters:
link - the room id of the room that will be linked in later
See Also:
Exit.temporaryDoorLink()

getSaveStatIndex

public int getSaveStatIndex()
Description copied from interface: Modifiable
Returns the index into the stat codes array where extra savable fields begins. This number is always the same as getStatCodes().length unless there are extra fields which need to be saved in xml for generic objects. This method is used by editors for post-build user-defined fields.

Specified by:
getSaveStatIndex in interface Modifiable
Overrides:
getSaveStatIndex in class StdExit
Returns:
the index into getStatCodes()
See Also:
Modifiable.getStatCodes(), Modifiable.getStat(String), Modifiable.setStat(String, String)

getStatCodes

public java.lang.String[] getStatCodes()
Description copied from interface: Modifiable
Returns an array of the string names of those fields which are modifiable on this object at run-time by builders.

Specified by:
getStatCodes in interface Modifiable
Overrides:
getStatCodes in class StdExit
Returns:
list of the fields which may be set.
See Also:
Modifiable.getStat(String), Modifiable.setStat(String, String)

isStat

public boolean isStat(java.lang.String code)
Description copied from interface: Modifiable
An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders. See getStatCodes() for possible values for the code passed to this method. Values returned are always strings, even if the field itself is numeric or a list.

Specified by:
isStat in interface Modifiable
Overrides:
isStat in class StdExit
Parameters:
code - the name of the field to read.
Returns:
true if the code is a real value, false otherwise
See Also:
Modifiable.getStatCodes()

getCodeNum

protected int getCodeNum(java.lang.String code)
Overrides:
getCodeNum in class StdExit

getStat

public java.lang.String getStat(java.lang.String code)
Description copied from interface: Modifiable
An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders. See getStatCodes() for possible values for the code passed to this method. Values returned are always strings, even if the field itself is numeric or a list.

Specified by:
getStat in interface Modifiable
Overrides:
getStat in class StdExit
Parameters:
code - the name of the field to read.
Returns:
the value of the field read
See Also:
Modifiable.getStatCodes()

setStat

public void setStat(java.lang.String code,
                    java.lang.String val)
Description copied from interface: Modifiable
An alternative means of setting the values of those fields on this object which are modifiable at run-time by builders. See getStatCodes() for possible values for the code passed to this method. The value passed in is always a string, even if the field itself is numeric or a list.

Specified by:
setStat in interface Modifiable
Overrides:
setStat in class StdExit
Parameters:
code - the name of the field to set
val - the value to set the field to
See Also:
Modifiable.getStatCodes()

sameAs

public boolean sameAs(Environmental E)
Description copied from interface: Environmental
Whether this object instance is functionally identical to the object passed in. Works by repeatedly calling getStat on both objects and comparing the values.

Specified by:
sameAs in interface Environmental
Overrides:
sameAs in class StdExit
Parameters:
E - the object to compare this one to
Returns:
whether this object is the same as the one passed in
See Also:
Modifiable.getStatCodes(), Modifiable.getStat(String)