|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.planet_ink.coffee_mud.Behaviors.StdBehavior
public class StdBehavior
| Field Summary | |
|---|---|
protected static java.lang.String[] |
CODES
|
protected boolean |
isSavableBehavior
|
protected java.lang.String |
parms
|
| Fields inherited from interface com.planet_ink.coffee_mud.Behaviors.interfaces.Behavior |
|---|
CAN_AREAS, CAN_EXITS, CAN_ITEMS, CAN_MOBS, CAN_ROOMS, FLAG_LEGALBEHAVIOR, FLAG_MOBILITY, FLAG_POTENTIALLYAGGRESSIVE, FLAG_POTENTIALLYAUTODEATHING, FLAG_TROUBLEMAKING |
| Constructor Summary | |
|---|---|
StdBehavior()
|
|
| Method Summary | |
|---|---|
java.lang.String |
accountForYourself()
Returns a string describing what this behavior does. |
boolean |
amDestroyed()
Whether the destroy() method has been previousy called on this object. |
static boolean |
canActAtAll(Tickable affecting)
|
static boolean |
canFreelyBehaveNormal(Tickable affecting)
|
boolean |
canImprove(int can_code)
Returns whether this behavior is capable of enhancing the given type of object designated by the can_code. |
boolean |
canImprove(PhysicalAgent E)
Returns whether this behavior is capable of enhancing the given type of object designated by E. |
protected int |
canImproveCode()
|
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 |
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. |
void |
executeMsg(Environmental host,
CMMsg msg)
The general message event handler for the object. |
java.util.List<java.lang.String> |
externalFiles()
Returns a string list of any external files which may be required to make this ability work. |
long |
flags()
Returns a bitmap made of up Behavior.FLAG_* constant masks which designates certain aspects about this behavior the rest of the system may need to know. |
protected MOB |
getBehaversMOB(Tickable ticking)
|
protected Room |
getBehaversRoom(Tickable ticking)
|
protected int |
getCodeNum(java.lang.String code)
|
java.lang.String |
getParms()
Returns the raw parameter string for this behavior. |
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. |
int |
getTickStatus()
A coded status for this object during the period where its tick method is being called. |
boolean |
grantsAggressivenessTo(MOB M)
Returns the result of a very specific test, namely whether this behavior would be the direct cause of a malicious act against the given MOB object. |
java.lang.String |
ID()
The CoffeeMud Java Class ID shared by all instances of this object. |
void |
initializeClass()
Called ONCE after all objects are loaded, but before the map is read in during initialization. |
boolean |
isSavable()
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. |
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 |
L(java.lang.String str,
java.lang.String... xs)
Localize an internal string -- shortcut. |
java.lang.String |
name()
The nice displayable name of this instance of this object |
CMObject |
newInstance()
return a new instance of the object |
boolean |
okMessage(Environmental host,
CMMsg msg)
The general message event previewer for the object. |
java.lang.String |
parmsFormat()
Unimplemented as of yet, but will hold a string telling the system what the proper format of any parms data. |
void |
registerDefaultQuest(java.lang.String questName)
Called after a behavior is added to an Environmental object. |
boolean |
sameAs(Behavior E)
|
void |
setParms(java.lang.String parameters)
Sets the raw parameter string for this behavior. |
void |
setSavable(boolean truefalse)
Sets whether this behavior can be saved as a permanent aspect of its host. |
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 |
startBehavior(PhysicalAgent forMe)
Called after a behavior is added to a Behavable object. |
boolean |
tick(Tickable ticking,
int tickID)
this is the method which is called periodically by the threading engine. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String parms
protected boolean isSavableBehavior
protected static final java.lang.String[] CODES
| Constructor Detail |
|---|
public StdBehavior()
| Method Detail |
|---|
public java.lang.String ID()
CMObject
ID in interface CMObjectpublic java.lang.String name()
Tickable
name in interface CMObjectname in interface TickableEnvironmental.Name()protected int canImproveCode()
public long flags()
Behavior
flags in interface Behaviorpublic boolean grantsAggressivenessTo(MOB M)
Behavior
grantsAggressivenessTo in interface BehaviorM - the target to test for maliciousness to
public int getTickStatus()
Tickable
getTickStatus in interface TickableTickable.tick(Tickable, int)public void initializeClass()
CMObject
initializeClass in interface CMObjectpublic java.lang.String accountForYourself()
Behavior
accountForYourself in interface Behaviorpublic CMObject newInstance()
newInstance in interface CMObjectpublic CMObject copyOf()
CMObject
copyOf in interface CMObjectpublic void registerDefaultQuest(java.lang.String questName)
Behavior
registerDefaultQuest in interface BehaviorquestName - the Quest nameQuestpublic void startBehavior(PhysicalAgent forMe)
Behavior
startBehavior in interface BehaviorforMe - the object to which this behavior has been addedBehavable.addBehavior(Behavior),
Behavior.setParms(String)public void setSavable(boolean truefalse)
Behavior
setSavable in interface BehaviorsetSavable in interface Contingenttruefalse - whether this behavior can be saved as part of its host.Contingent.isSavable()public boolean isSavable()
Contingent
isSavable in interface Contingentpublic boolean amDestroyed()
Contingent
amDestroyed in interface Contingentpublic void destroy()
Contingent
destroy in interface Contingentprotected MOB getBehaversMOB(Tickable ticking)
protected Room getBehaversRoom(Tickable ticking)
public java.lang.String getParms()
Behavior
getParms in interface BehaviorBehavior.setParms(String)public void setParms(java.lang.String parameters)
Behavior
setParms in interface Behaviorparameters - the parameter string for this behaviorBehavior.getParms()public java.lang.String parmsFormat()
Behavior
parmsFormat in interface BehaviorCMParms,
Behavior.getParms(),
Behavior.setParms(String)public int compareTo(CMObject o)
compareTo in interface java.lang.Comparable<CMObject>public java.util.List<java.lang.String> externalFiles()
Behavior
externalFiles in interface BehaviorBehavior.setParms(String)
public void executeMsg(Environmental host,
CMMsg msg)
MsgListener
executeMsg in interface MsgListenerhost - either the initiator of the event, or the host of this objectmsg - the CMMsg that needs to be executedCMMsg
public boolean okMessage(Environmental host,
CMMsg msg)
MsgListener
okMessage in interface MsgListenerhost - either the initiator of the event, or the host of this objectmsg - the CMMsg that wants to be executed
CMMsg,
CMMsg.source()public boolean canImprove(int can_code)
Behavior
canImprove in interface Behaviorcan_code - the Behavior.CAN_* mask to evaluate for this behavior
canImproveCode(),
Behaviorpublic boolean canImprove(PhysicalAgent E)
Behavior
canImprove in interface BehaviorE - the object to evaluate for this behavior
canImproveCode()public static boolean canActAtAll(Tickable affecting)
public static boolean canFreelyBehaveNormal(Tickable affecting)
public boolean tick(Tickable ticking,
int tickID)
Tickable
tick in interface Tickableticking - a reference to this Tickable objecttickID - the TICKID_ constant describing this periodic call, as defined in Tickable
Tickable,
ServiceEngine,
TickableGroup
public java.lang.String L(java.lang.String str,
java.lang.String... xs)
str - the string to translatexs - the array of variables to replace
Call with the string to translate, which may contain variables of the form @x1, @x2, etc. The array in xs
is then used to replace the variables AFTER the string is translated.public java.lang.String[] getStatCodes()
Modifiable
getStatCodes in interface ModifiableModifiable.getStat(String),
Modifiable.setStat(String, String)protected int getCodeNum(java.lang.String code)
public java.lang.String getStat(java.lang.String code)
Modifiable
getStat in interface Modifiablecode - the name of the field to read.
Modifiable.getStatCodes()
public void setStat(java.lang.String code,
java.lang.String val)
Modifiable
setStat in interface Modifiablecode - the name of the field to setval - the value to set the field toModifiable.getStatCodes()public int getSaveStatIndex()
Modifiable
getSaveStatIndex in interface ModifiableModifiable.getStatCodes(),
Modifiable.getStat(String),
Modifiable.setStat(String, String)public boolean isStat(java.lang.String code)
Modifiable
isStat in interface Modifiablecode - the name of the field to read.
Modifiable.getStatCodes()public boolean sameAs(Behavior E)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||