com.planet_ink.coffee_mud.Common
Class DefaultSocial

java.lang.Object
  extended by com.planet_ink.coffee_mud.Common.DefaultSocial
All Implemented Interfaces:
CMCommon, Social, Behavable, CMModifiable, CMObject, Environmental, MsgListener, StatsAffecting, Tickable, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class DefaultSocial
extends java.lang.Object
implements Social


Field Summary
protected  boolean amDestroyed
           
protected  int othersCode
           
protected  java.lang.String See_when_no_target
           
protected  java.lang.String Social_name
           
protected  int sourceCode
           
 EnvStats stats
           
protected  java.lang.String Target_sees
           
protected  int targetCode
           
protected  java.lang.String Third_party_sees
           
protected  java.lang.String You_see
           
 
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_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_EMAIL, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MOB, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SPELL_AFFECT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET, TICKMASK_SOLITARY, TICKS_PER_RLMIN, TIME_MILIS_PER_MUDHOUR, TIME_TICK, TIME_TICK_DOUBLE
 
Constructor Summary
DefaultSocial()
           
 
Method Summary
 void addBehavior(Behavior to)
          Add a new behavior to this object.
 void addEffect(Ability to)
          Add a new effect to this object, whether permanent or temporary.
 void addNonUninvokableEffect(Ability to)
          Same as addEffect(Ability), but will set the Ability object as never being able to be uninvoked.
 void addScript(ScriptingEngine S)
          Add a new runnable script to this object.
 void affectCharState(MOB affectedMob, CharState affectableMaxState)
          This method is called by the recoverCharState() method on other MOB objects.
 void affectCharStats(MOB affectedMob, CharStats affectableStats)
          This method is called by the recoverCharStats() method on other MOB objects.
 void affectEnvStats(Environmental affected, EnvStats affectableStats)
          This method is called by the recoverEnvStats() method on other Environmental objects.
 boolean amDestroyed()
          Whether the destroy() method has been previousy called on this object.
 EnvStats baseEnvStats()
          Object containing a set of base, unmodified, mostly numeric fields.
 java.lang.String baseName()
          Base name is the name of the social's command word.
protected  void cloneFix(Social E)
           
 int compareTo(CMObject o)
           
 CMObject copyOf()
          Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.
 void delBehavior(Behavior to)
          Delete a behavior from this object.
 void delEffect(Ability to)
          Delete an effect from this object, whether permanent or temporary.
 void delScript(ScriptingEngine S)
          Remove a running script from this object.
 java.lang.String description()
          The basic description of this object, as shown when the item is directly LOOKed at.
 void destroy()
          Utterly and permanently destroy this object, not only removing it from the map, but causing this object to be collected as garbage by Java.
 java.lang.String displayText()
          Gets the raw string used to show what this object looks like in the room.
 EnvStats envStats()
          Object containing a set of current, modified, usable, mostly numeric fields.
 void executeMsg(Environmental myHost, CMMsg msg)
          The general message event handler for the object.
 long expirationDate()
          If this object expires, it should have a timestamp saying when it expires, in real time.
 Behavior fetchBehavior(int index)
          Returns a behavior object on this object.
 Behavior fetchBehavior(java.lang.String ID)
          Returns a behavior object listed on this object.
 Ability fetchEffect(int index)
          Returns an ability object listed as an effect on this object.
 Ability fetchEffect(java.lang.String ID)
          Returns an ability object listed as an effect on this object.
 ScriptingEngine fetchScript(int x)
          Retreive one of the enumerated scripts running on this object
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.
 long getTickStatus()
          A coded status for this object during the period where its tick method is being called.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 java.lang.String image()
          Returns the fully qualified and determined name of the image file displayed for this object when MXP is used.
 void initializeClass()
          Called ONCE after all objects are loaded, but before the map is read in during initialization.
 boolean invoke(MOB mob, java.util.Vector commands, Environmental target, boolean auto)
          Executes this social by the given mob, using the target provided, with help from the provided command line strings in a vector, and with override message code flag.
 boolean isGeneric()
          Whether the fields of this item are set in code, or set by builders.
 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.
 CMMsg makeChannelMsg(MOB mob, int channelInt, java.lang.String channelName, java.util.Vector commands, boolean makeTarget)
          Manufactures a proper channel message that represents executing this social over a public chat channel.
 CMMsg makeMessage(MOB mob, java.lang.String str, java.lang.String end, int srcMask, int fullCode, java.util.Vector commands, java.lang.String I3channelName, boolean makeTarget)
          Manufactures a proper message that represents executing this social as an action
 int maxRange()
          the maximum range of this object, if applicable.
 int minRange()
          the minimum range of this object, if applicable.
 java.lang.String miscTextFormat()
          Unimplemented as of yet, but will hold a string telling the system what the proper format of any miscText data.
 java.lang.String MSPfile()
          Returns the name of the MSP sound file associated with this social.
 java.lang.String name()
          The displayable name of this object.
 java.lang.String Name()
          The raw unmodified name of this object as stored in the database.
 CMObject newInstance()
          Returns a new instance of this class.
 int numBehaviors()
          The number of behaviors this object has.
 int numEffects()
          Returns the number of ability objects listed as effects on this object.
 int numScripts()
          Return the number of scripts running on this object
 boolean okMessage(Environmental myHost, CMMsg msg)
          The general message event previewer for the object.
 int othersCode()
          The official CoffeeMud message code used as the others code for this social, which reflects what the player appears to be doing.
 java.lang.String rawImage()
          Returns the raw name of the image file to display for this object when MXP is used.
 void recoverEnvStats()
          This method copies the baseEnvStats() object into the envStats() object, then makes repeated calls to all surrounding objects with affectEnvStats(Environmental,EnvStats) method.
 boolean sameAs(Environmental E)
          Whether this object instance is functionally identical to the object passed in.
 boolean savable()
          Whether, if this object is in a room, whether it is appropriate to save this object to the database as a permanent feature of its container.
 java.lang.String See_when_no_target()
          See_when_no_target: what the player sees when this social is used targeted, but the target is not available.
 void setBaseEnvStats(EnvStats newBaseEnvStats)
          Re-sets the object containing a set of base, unmodified, mostly numeric fields.
 void setDescription(java.lang.String str)
          Sets the basic description of this object, as shown when the item is directly LOOKed at.
 void setDisplayText(java.lang.String str)
          Sets the raw string used to show what this object looks like in the room.
 void setExpirationDate(long time)
          If this object expires, it should have a timestamp saying when it expires, in real time.
 void setImage(java.lang.String newImage)
          Sets the raw name of the image file to display for this object when MXP is used.
 void setMiscText(java.lang.String newMiscText)
          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 setMSPfile(java.lang.String newFile)
          Sets the name of the MSP sound file associated with this social.
 void setName(java.lang.String newName)
          Sets the raw unmodified name of this object as stored in the database.
 void setOthersCode(int code)
          Sets the official CoffeeMud message code used as the others code for this social, which reflects what the player appears to be doing.
 void setSee_when_no_target(java.lang.String str)
          See_when_no_target: what the player sees when this social is used targeted, but the target is not available.
 void setSourceCode(int code)
          Sets the official CoffeeMud message code used as the source code for this social, which reflects what the player is doing.
 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 setTarget_sees(java.lang.String str)
          Target_sees: what the target of this social sees when social is used on them.
 void setTargetCode(int code)
          Sets the official CoffeeMud message code used as the target code for this social, which reflects what is being done to the target.
 void setThird_party_sees(java.lang.String str)
          Third_party_sees: what everyone but the player and their target sees when a player uses this social.
 void setYou_see(java.lang.String str)
          You_see: what the player themself sees when they use this social.
 int sourceCode()
          The official CoffeeMud message code used as the source code for this social, which reflects what the player is doing.
 java.lang.String Target_sees()
          Target_sees: what the target of this social sees when social is used on them.
 boolean targetable()
          Whether this social variation can be targeted.
 int targetCode()
          The official CoffeeMud message code used as the target code for this social, which reflects what is being done to the target.
 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.
 java.lang.String Third_party_sees()
          Third_party_sees: what everyone but the player and their target sees when a player uses this social.
 boolean tick(Tickable ticking, int tickID)
          this is the method which is called periodically by the threading engine.
 java.lang.String You_see()
          You_see: what the player themself sees when they use this social.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Social_name

protected java.lang.String Social_name

You_see

protected java.lang.String You_see

Third_party_sees

protected java.lang.String Third_party_sees

Target_sees

protected java.lang.String Target_sees

See_when_no_target

protected java.lang.String See_when_no_target

sourceCode

protected int sourceCode

othersCode

protected int othersCode

targetCode

protected int targetCode

stats

public EnvStats stats

amDestroyed

protected boolean amDestroyed
Constructor Detail

DefaultSocial

public DefaultSocial()
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, MiscTech. The name is typically identical to the class name.

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

name

public java.lang.String name()
Description copied from interface: Environmental
The displayable name of this object. May be modified by envStats() object. Is derived from the Name().

Specified by:
name in interface Environmental
Specified by:
name in interface Tickable
Returns:
the modified final name of this object on the map.
See Also:
Environmental.Name()

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
Returns:
the raw base name of this object on the map.
See Also:
Environmental.name()

baseName

public java.lang.String baseName()
Description copied from interface: Social
Base name is the name of the social's command word. It is NOT unique to a social object however, since a socials name usually includes its target extension.

Specified by:
baseName in interface Social
Returns:
the base 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
Parameters:
newName - the raw base name of this object on the map.
See Also:
Environmental.Name()

You_see

public java.lang.String You_see()
Description copied from interface: Social
You_see: what the player themself sees when they use this social.

Specified by:
You_see in interface Social
Returns:
what the player themself sees when they use this social.
See Also:
Social.setYou_see(String)

Third_party_sees

public java.lang.String Third_party_sees()
Description copied from interface: Social
Third_party_sees: what everyone but the player and their target sees when a player uses this social.

Specified by:
Third_party_sees in interface Social
Returns:
the string everyone else sees
See Also:
Social.setThird_party_sees(String)

Target_sees

public java.lang.String Target_sees()
Description copied from interface: Social
Target_sees: what the target of this social sees when social is used on them.

Specified by:
Target_sees in interface Social
Returns:
what the target of this social sees when social is used on them
See Also:
Social.setTarget_sees(String)

See_when_no_target

public java.lang.String See_when_no_target()
Description copied from interface: Social
See_when_no_target: what the player sees when this social is used targeted, but the target is not available.

Specified by:
See_when_no_target in interface Social
Returns:
the string seen by the player when the target has left
See Also:
Social.setSee_when_no_target(String)

sourceCode

public int sourceCode()
Description copied from interface: Social
The official CoffeeMud message code used as the source code for this social, which reflects what the player is doing. Only certain codes allowed.

Specified by:
sourceCode in interface Social
Returns:
the CMMsg social code, fully formed
See Also:
Social.setSourceCode(int), CMMsg.MSG_SPEAK, CMMsg.MSG_HANDS, CMMsg.MSG_NOISE, CMMsg.MSG_NOISYMOVEMENT

othersCode

public int othersCode()
Description copied from interface: Social
The official CoffeeMud message code used as the others code for this social, which reflects what the player appears to be doing. Only certain codes allowed.

Specified by:
othersCode in interface Social
Returns:
the CMMsg social code, fully formed
See Also:
Social.setOthersCode(int), CMMsg.MSG_SPEAK, CMMsg.MSG_HANDS, CMMsg.MSG_NOISE, CMMsg.MSG_NOISYMOVEMENT, CMMsg.MSG_OK_VISUAL

targetCode

public int targetCode()
Description copied from interface: Social
The official CoffeeMud message code used as the target code for this social, which reflects what is being done to the target. Only certain codes allowed.

Specified by:
targetCode in interface Social
Returns:
the CMMsg social code, fully formed
See Also:
Social.setTargetCode(int), CMMsg.MSG_SPEAK, CMMsg.MSG_HANDS, CMMsg.MSG_NOISE, CMMsg.MSG_NOISYMOVEMENT, CMMsg.MSG_OK_VISUAL

setYou_see

public void setYou_see(java.lang.String str)
Description copied from interface: Social
You_see: what the player themself sees when they use this social.

Specified by:
setYou_see in interface Social
Parameters:
str - what the player themself sees when they use this social.
See Also:
Social.You_see()

setThird_party_sees

public void setThird_party_sees(java.lang.String str)
Description copied from interface: Social
Third_party_sees: what everyone but the player and their target sees when a player uses this social.

Specified by:
setThird_party_sees in interface Social
Parameters:
str - the string everyone else sees
See Also:
Social.Third_party_sees()

setTarget_sees

public void setTarget_sees(java.lang.String str)
Description copied from interface: Social
Target_sees: what the target of this social sees when social is used on them.

Specified by:
setTarget_sees in interface Social
Parameters:
str - what the target of this social sees when social is used on them
See Also:
Social.Target_sees()

setSee_when_no_target

public void setSee_when_no_target(java.lang.String str)
Description copied from interface: Social
See_when_no_target: what the player sees when this social is used targeted, but the target is not available.

Specified by:
setSee_when_no_target in interface Social
Parameters:
str - the string seen by the player when the target has left
See Also:
Social.See_when_no_target()

setSourceCode

public void setSourceCode(int code)
Description copied from interface: Social
Sets the official CoffeeMud message code used as the source code for this social, which reflects what the player is doing. Only certain codes allowed.

Specified by:
setSourceCode in interface Social
Parameters:
code - the CMMsg social code, fully formed
See Also:
Social.sourceCode(), CMMsg.MSG_SPEAK, CMMsg.MSG_HANDS, CMMsg.MSG_NOISE, CMMsg.MSG_NOISYMOVEMENT

setOthersCode

public void setOthersCode(int code)
Description copied from interface: Social
Sets the official CoffeeMud message code used as the others code for this social, which reflects what the player appears to be doing. Only certain codes allowed.

Specified by:
setOthersCode in interface Social
Parameters:
code - the CMMsg social code, fully formed
See Also:
Social.othersCode(), CMMsg.MSG_SPEAK, CMMsg.MSG_HANDS, CMMsg.MSG_NOISE, CMMsg.MSG_NOISYMOVEMENT, CMMsg.MSG_OK_VISUAL

setTargetCode

public void setTargetCode(int code)
Description copied from interface: Social
Sets the official CoffeeMud message code used as the target code for this social, which reflects what is being done to the target. Only certain codes allowed.

Specified by:
setTargetCode in interface Social
Parameters:
code - the CMMsg social code, fully formed
See Also:
Social.targetCode(), CMMsg.MSG_SPEAK, CMMsg.MSG_HANDS, CMMsg.MSG_NOISE, CMMsg.MSG_NOISYMOVEMENT, CMMsg.MSG_OK_VISUAL

targetable

public boolean targetable()
Description copied from interface: Social
Whether this social variation can be targeted. Is determined by whether there is a target parameter in the name.

Specified by:
targetable in interface Social
Returns:
true, if it can be targeted
See Also:
Environmental.Name()

getTickStatus

public long getTickStatus()
Description copied from interface: Tickable
A coded status for this object during the period where its tick method is being called. The statis is defined, at least in part, by constants in this interface STATUS_*. STATUS_NOT should be returned when the objects tick method is not currently in execution. It should never return STATUS_NOT when the objects tick method is in execution.

Specified by:
getTickStatus in interface Tickable
Returns:
the numeric status of this object
See Also:
Tickable.tick(Tickable, int)

MSPfile

public java.lang.String MSPfile()
Description copied from interface: Social
Returns the name of the MSP sound file associated with this social.

Specified by:
MSPfile in interface Social
Returns:
the msp sound file name
See Also:
Social.setMSPfile(String)

setMSPfile

public void setMSPfile(java.lang.String newFile)
Description copied from interface: Social
Sets the name of the MSP sound file associated with this social.

Specified by:
setMSPfile in interface Social
Parameters:
newFile - the msp sound file name
See Also:
Social.MSPfile()

expirationDate

public long expirationDate()
Description copied from interface: Environmental
If this object expires, it should have a timestamp saying when it expires, in real time. When it expires, a MSG_EXPIRE message will be sent to it.

Specified by:
expirationDate in interface Environmental
Returns:
the time stamp when this thing expires
See Also:
Environmental.setExpirationDate(long)

setExpirationDate

public void setExpirationDate(long time)
Description copied from interface: Environmental
If this object expires, it should have a timestamp saying when it expires, in real time. When it expires, a MSG_EXPIRE message will be sent to it.

Specified by:
setExpirationDate in interface Environmental
Parameters:
time - the time stamp when this thing expires
See Also:
Environmental.expirationDate()

invoke

public boolean invoke(MOB mob,
                      java.util.Vector commands,
                      Environmental target,
                      boolean auto)
Description copied from interface: Social
Executes this social by the given mob, using the target provided, with help from the provided command line strings in a vector, and with override message code flag. It will generate a proper message and send it to the same room as the mob.

Specified by:
invoke in interface Social
Parameters:
mob - the source of the social action
commands - the vector of strings
target - the target of the social
auto - true to override physical constraints of the source or target
Returns:
true, if successful

makeChannelMsg

public CMMsg makeChannelMsg(MOB mob,
                            int channelInt,
                            java.lang.String channelName,
                            java.util.Vector commands,
                            boolean makeTarget)
Description copied from interface: Social
Manufactures a proper channel message that represents executing this social over a public chat channel.

Specified by:
makeChannelMsg in interface Social
Parameters:
mob - the mob doing the social
channelInt - the channel int representing which chat channel
channelName - the channel name of the chat channel
commands - the commands as a string vector entered by the user
makeTarget - true to create a fake target, or false to find a real one.
Returns:
the CMMsg that can now be sent to the world as a chat channel message
See Also:
CMMsg, Social.makeMessage(MOB, String, String, int, int, Vector, String, boolean)

makeMessage

public CMMsg makeMessage(MOB mob,
                         java.lang.String str,
                         java.lang.String end,
                         int srcMask,
                         int fullCode,
                         java.util.Vector commands,
                         java.lang.String I3channelName,
                         boolean makeTarget)
Description copied from interface: Social
Manufactures a proper message that represents executing this social as an action

Specified by:
makeMessage in interface Social
Parameters:
mob - the mob doing the social
str - the str an optional "header" string for the msg, usually mxp related
end - the end an optional "trailer" string for the msg, usually mxp related
srcMask - the src mask to logically OR with the generated message source code
fullCode - the override target and others code from the one in this social
commands - the commands as a string vector entered by the user
I3channelName - the i3channel name or null if n/a
makeTarget - true to manufacture a target, or false to use a real one
Returns:
the CMMsg that can now be sent to the world as a chat channel message
See Also:
CMMsg, Social.makeChannelMsg(MOB, int, String, Vector, boolean)

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
Returns:
the basic detail description of this object

setDescription

public void setDescription(java.lang.String str)
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
Parameters:
str - the basic detail description of this object

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
Returns:
the string describing how this object looks in the room

setDisplayText

public void setDisplayText(java.lang.String str)
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
Parameters:
str - the string describing how this object looks in the room

envStats

public EnvStats envStats()
Description copied from interface: Environmental
Object containing a set of current, modified, usable, mostly numeric fields. This object is based on the object from baseEnvStats() and then updated and modified by the recoverEnvStats() method. See the EnvStats interface for information on the fields herein.

Specified by:
envStats in interface Environmental
Returns:
the current set of state fields
See Also:
Environmental.baseEnvStats(), Environmental.recoverEnvStats(), EnvStats

baseEnvStats

public EnvStats baseEnvStats()
Description copied from interface: Environmental
Object containing a set of base, unmodified, mostly numeric fields. The values on the fields in this object will be as they were set by the builder. This object is used as a basis for the recoverEnvStats() method. See the EnvStats interface for information on the fields herein.

Specified by:
baseEnvStats in interface Environmental
Returns:
a set of state fields
See Also:
Environmental.envStats(), Environmental.recoverEnvStats(), EnvStats

recoverEnvStats

public void recoverEnvStats()
Description copied from interface: Environmental
This method copies the baseEnvStats() object into the envStats() object, then makes repeated calls to all surrounding objects with affectEnvStats(Environmental,EnvStats) method. Surrounding objects include the room where the object is located, the Ability objects in the Effects list, the Behaviors in the behaviors list, and race/charclass/area if applicable. Those methods will then make all necessary adjustments to the values in the new envStats() object. When it returns, envStats() will have a totally updated object. This method must be called in code whenever the object is placed on the map, or when anything changes in its environment, such as location, effects, or other states.

Specified by:
recoverEnvStats in interface Environmental
See Also:
Environmental.baseEnvStats(), Environmental.envStats(), Environmental.addEffect(Ability), Behavable.addBehavior(Behavior), EnvStats

setBaseEnvStats

public void setBaseEnvStats(EnvStats newBaseEnvStats)
Description copied from interface: Environmental
Re-sets the object containing a set of base, unmodified, mostly numeric fields. The values on the fields in this object will be as they were set by the builder. This object is used as a basis for the recoverEnvStats() method. See the EnvStats interface for information on the fields herein. This method is rarely called -- the fields therein are usually set using setter methods from the EnvStats interface on the object itself.

Specified by:
setBaseEnvStats in interface Environmental
Parameters:
newBaseEnvStats - a set of state fields
See Also:
Environmental.envStats(), Environmental.recoverEnvStats(), EnvStats

newInstance

public CMObject newInstance()
Description copied from interface: CMObject
Returns a new instance of this class.

Specified by:
newInstance in interface CMObject
Returns:
a new instance of this class

initializeClass

public void initializeClass()
Description copied from interface: CMObject
Called ONCE after all objects are loaded, but before the map is read in during initialization.

Specified by:
initializeClass in interface CMObject

compareTo

public int compareTo(CMObject o)
Specified by:
compareTo in interface java.lang.Comparable<CMObject>

destroy

public void destroy()
Description copied from interface: Environmental
Utterly and permanently destroy this object, not only removing it from the map, but causing this object to be collected as garbage by Java. Containers, rooms. and mobs who have their destroy() method called will also call the destroy() methods on all items and other objects listed as content, recursively.

Specified by:
destroy in interface Environmental

amDestroyed

public boolean amDestroyed()
Description copied from interface: Environmental
Whether the destroy() method has been previousy called on this object.

Specified by:
amDestroyed in interface Environmental
Returns:
whether the object is destroy()ed.

savable

public boolean savable()
Description copied from interface: Environmental
Whether, if this object is in a room, whether it is appropriate to save this object to the database as a permanent feature of its container. It always returns true except under unique circumstances.

Specified by:
savable in interface Environmental
Returns:
true, usually.

getSaveStatIndex

public int getSaveStatIndex()
Description copied from interface: CMModifiable
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 CMModifiable
Returns:
the index into getStatCodes()
See Also:
CMModifiable.getStatCodes(), CMModifiable.getStat(String), CMModifiable.setStat(String, String)

getStatCodes

public java.lang.String[] getStatCodes()
Description copied from interface: CMModifiable
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 CMModifiable
Returns:
list of the fields which may be set.
See Also:
CMModifiable.getStat(String), CMModifiable.setStat(String, String)

isStat

public boolean isStat(java.lang.String code)
Description copied from interface: CMModifiable
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 CMModifiable
Parameters:
code - the name of the field to read.
Returns:
true if the code is a real value, false otherwise
See Also:
CMModifiable.getStatCodes()

getCodeNum

protected int getCodeNum(java.lang.String code)

getStat

public java.lang.String getStat(java.lang.String code)
Description copied from interface: CMModifiable
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 CMModifiable
Parameters:
code - the name of the field to read.
Returns:
the value of the field read
See Also:
CMModifiable.getStatCodes()

setStat

public void setStat(java.lang.String code,
                    java.lang.String val)
Description copied from interface: CMModifiable
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 CMModifiable
Parameters:
code - the name of the field to set
val - the value to set the field to
See Also:
CMModifiable.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
Parameters:
E - the object to compare this one to
Returns:
whether this object is the same as the one passed in
See Also:
CMModifiable.getStatCodes(), CMModifiable.getStat(String)

cloneFix

protected void cloneFix(Social E)

copyOf

public CMObject copyOf()
Description copied from interface: CMObject
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.

Specified by:
copyOf in interface CMObject
Returns:
a clone of this object

setMiscText

public void setMiscText(java.lang.String newMiscText)
Description copied from interface: