|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.planet_ink.coffee_mud.Common.DefaultMessage
public class DefaultMessage
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Common.interfaces.CMMsg |
|---|
CMMsg.Desc |
| Field Summary | |
|---|---|
protected MOB |
myAgent
|
protected Environmental |
myTarget
|
protected Environmental |
myTool
|
protected int |
othersCode
|
protected java.lang.String |
othersMsg
|
protected int |
sourceCode
|
protected java.lang.String |
sourceMsg
|
protected int |
targetCode
|
protected java.lang.String |
targetMsg
|
protected SLinkedList<CMMsg> |
trailMsgs
|
protected int |
value
|
| Constructor Summary | |
|---|---|
DefaultMessage()
|
|
| Method Summary | |
|---|---|
void |
addTrailerMsg(CMMsg msg)
Appends to the Vector of other CMMsg events which are slated to be confirmed and executed AFTER this current message is handled. |
boolean |
amISource(MOB thisOne)
Returns whether the given Environmental object is, in fact, the source of this message. |
boolean |
amITarget(Environmental thisOne)
Returns whether the given Environmental object is, in fact, the target of this message. |
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. |
protected void |
finalize()
|
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 |
isOthers(Environmental E)
Returns whether the given Environmental object is neither the source nor the target of this message. |
boolean |
isOthers(int codeOrMask)
Returns whether the given code or mask is either the minor code or a part of the major code of the othersCode |
boolean |
isOthers(java.lang.String codeOrMaskDesc)
Returns whether the given code or mask string matches the minor code or a part of the major code of the othersCode. |
boolean |
isSource(Environmental E)
Returns whether the given Environmental object is, in fact, the source of this message. |
boolean |
isSource(int codeOrMask)
Returns whether the given code or mask is either the minor code or a part of the major code of the sourceCode |
boolean |
isSource(java.lang.String codeOrMaskDesc)
Returns whether the given code or mask string matches the minor code or a part of the major code of the sourceCode. |
boolean |
isTarget(Environmental E)
Returns whether the given Environmental object is, in fact, the target of this message. |
boolean |
isTarget(int codeOrMask)
Returns whether the given code or mask is either the minor code or a part of the major code of the targetCode |
boolean |
isTarget(java.lang.String codeOrMaskDesc)
Returns whether the given code or mask string matches the minor code or a part of the major code of the targetCode. |
protected static boolean |
matches(int code1,
int code2)
|
protected static boolean |
matches(int code1,
java.lang.String code2)
|
void |
modify(MOB source,
Environmental target,
Environmental tool,
int newSourceCode,
int newTargetCode,
int newOthersCode,
java.lang.String allMessage)
Modifies one of more fields in this event. |
void |
modify(MOB source,
Environmental target,
Environmental tool,
int newAllCode,
java.lang.String allMessage)
Modifies one of more fields in this event. |
void |
modify(MOB source,
Environmental target,
Environmental tool,
int newSourceCode,
java.lang.String sourceMessage,
int newTargetCode,
java.lang.String targetMessage,
int newOthersCode,
java.lang.String othersMessage)
Modifies one of more fields in this event. |
void |
modify(MOB source,
Environmental target,
Environmental tool,
int newAllCode,
java.lang.String sourceMessage,
java.lang.String targetMessage,
java.lang.String othersMessage)
Modifies one of more fields in this event. |
void |
modify(MOB source,
Environmental target,
int newAllCode,
java.lang.String allMessage)
Modifies one of more fields in this event. |
void |
modify(MOB source,
int newAllCode,
java.lang.String allMessage)
Modifies one of more fields in this event. |
void |
modify(MOB source,
int newAllCode,
java.lang.String allMessage,
int newValue)
Modifies one of more fields in this event. |
CMObject |
newInstance()
Returns a new instance of this class. |
int |
othersCode()
A combination bitmask, action type integer that describes information about how this event affects or is perceived by the others of the action. |
int |
othersMajor()
Returns high order bitmask for the others code (Others are everyone not source, not target) |
java.lang.String |
othersMessage()
Returns the string seen by the others of the event, and only by the others of the event. |
int |
othersMinor()
Returns low order action type integer for the others code (Others are everyone not source, not target) |
void |
setOthersCode(int code)
A combination bitmask, action type integer that describes information about how this event affects or is perceived by the others of the action. |
void |
setOthersMessage(java.lang.String str)
Sets the string seen by the others of the event, and only by the others of the event. |
void |
setSource(MOB mob)
Sets the source of this event, a MOB object |
void |
setSourceCode(int code)
A combination bitmask, action type integer that describes information about how this event affects or is perceived by the source of the action. |
void |
setSourceMessage(java.lang.String str)
Sets the string seen by the source of the event, and only by the source of the event. |
void |
setTarget(Environmental E)
Sets the target of this event, an Environmental object |
void |
setTargetCode(int code)
A combination bitmask, action type integer that describes information about how this event affects or is perceived by the target of the action. |
void |
setTargetMessage(java.lang.String str)
Sets the string seen by the target of the event, and only by the target of the event. |
void |
setTool(Environmental E)
Sets the means, item, portal, or otherwise tool that helps the source affect the event upon the target. |
void |
setValue(int amount)
Sets an arbitrary integer value associated with this event. |
MOB |
source()
Returns the source of this event, a MOB object |
int |
sourceCode()
A combination bitmask, action type integer that describes information about how this event affects or is perceived by the source of the action. |
int |
sourceMajor()
Returns high order bitmask for the source code |
java.lang.String |
sourceMessage()
Returns the string seen by the source of the event, and only by the source of the event. |
int |
sourceMinor()
Returns low order action type integer for the target code |
Environmental |
target()
Returns the target of this event, an Environmental object |
int |
targetCode()
A combination bitmask, action type integer that describes information about how this event affects or is perceived by the target of the action. |
int |
targetMajor()
Returns high order bitmask for the target code |
java.lang.String |
targetMessage()
Returns the string seen by the target of the event, and only by the target of the event. |
int |
targetMinor()
Returns low order action type integer for the target code |
Environmental |
tool()
Returns the means, item, portal, or otherwise tool that helps the source affect the event upon the target. |
java.util.List<CMMsg> |
trailerMsgs()
Returns a List of other CMMsg events which are slated to be confirmed and executed AFTER this current message is handled. |
int |
value()
Returns the arbitrary value integer associated with this event. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int targetCode
protected int sourceCode
protected int othersCode
protected java.lang.String targetMsg
protected java.lang.String othersMsg
protected java.lang.String sourceMsg
protected MOB myAgent
protected Environmental myTarget
protected Environmental myTool
protected int value
protected SLinkedList<CMMsg> trailMsgs
| Constructor Detail |
|---|
public DefaultMessage()
| Method Detail |
|---|
public java.lang.String ID()
CMObject
ID in interface CMObjectpublic CMObject newInstance()
CMObject
newInstance in interface CMObjectpublic void initializeClass()
CMObject
initializeClass in interface CMObjectpublic int compareTo(CMObject o)
compareTo in interface java.lang.Comparable<CMObject>public CMObject copyOf()
CMObject
copyOf in interface CMObject
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable
public void modify(MOB source,
Environmental target,
int newAllCode,
java.lang.String allMessage)
CMMsg
modify in interface CMMsgsource - the source of the eventtarget - the target of the eventnewAllCode - the source, target, and others codeallMessage - the source, target, and others messageCMMsg.source(),
CMMsg.target(),
CMMsg.sourceCode(),
CMMsg.targetCode(),
CMMsg.othersCode(),
CMMsg.sourceMessage(),
CMMsg.targetMessage(),
CMMsg.othersMessage()
public void modify(MOB source,
int newAllCode,
java.lang.String allMessage)
CMMsg
modify in interface CMMsgsource - the new source of this eventnewAllCode - the new source, target, and others code of this eventallMessage - the new source, target, and others message of this eventCMMsg.source(),
CMMsg.target(),
CMMsg.sourceCode(),
CMMsg.targetCode(),
CMMsg.othersCode(),
CMMsg.sourceMessage(),
CMMsg.targetMessage(),
CMMsg.othersMessage()
public void modify(MOB source,
int newAllCode,
java.lang.String allMessage,
int newValue)
CMMsg
modify in interface CMMsgsource - the new source of this eventnewAllCode - the new source, target, and others code of this eventallMessage - the new source, target, and others message of this eventnewValue - the new value for this eventCMMsg.source(),
CMMsg.target(),
CMMsg.sourceCode(),
CMMsg.targetCode(),
CMMsg.othersCode(),
CMMsg.sourceMessage(),
CMMsg.targetMessage(),
CMMsg.othersMessage(),
CMMsg.value()
public void modify(MOB source,
Environmental target,
Environmental tool,
int newAllCode,
java.lang.String allMessage)
CMMsg
modify in interface CMMsgsource - the new source of this eventtarget - the new target of this eventtool - the new tool for this eventnewAllCode - the new source, target, and others code of this eventallMessage - the new source, target, and others message of this eventCMMsg.source(),
CMMsg.target(),
CMMsg.sourceCode(),
CMMsg.targetCode(),
CMMsg.othersCode(),
CMMsg.sourceMessage(),
CMMsg.targetMessage(),
CMMsg.othersMessage()
public void modify(MOB source,
Environmental target,
Environmental tool,
int newAllCode,
java.lang.String sourceMessage,
java.lang.String targetMessage,
java.lang.String othersMessage)
CMMsg
modify in interface CMMsgsource - the new source of this eventtarget - the new target of this eventtool - the new tool for this eventnewAllCode - the new source, target, and others code of this eventsourceMessage - the new source message for this eventtargetMessage - the new target message for this eventothersMessage - the new others message for this eventCMMsg.source(),
CMMsg.target(),
CMMsg.sourceCode(),
CMMsg.targetCode(),
CMMsg.othersCode(),
CMMsg.sourceMessage(),
CMMsg.targetMessage(),
CMMsg.othersMessage()public void setSourceCode(int code)
CMMsg
setSourceCode in interface CMMsgcode - the new full bitmask/action type source event codeCMMsg.source(),
CMMsg.sourceMessage(),
CMMsg.sourceCode(),
CMMsg.sourceMajor(),
CMMsg.sourceMinor(),
CMMsg.MASK_MAGIC,
CMMsg.TYP_CAST_SPELLpublic void setTargetCode(int code)
CMMsg
setTargetCode in interface CMMsgcode - the new full bitmask/action type target event codeCMMsg.target(),
CMMsg.targetMessage(),
CMMsg.targetCode(),
CMMsg.targetMajor(),
CMMsg.targetMinor(),
CMMsg.MASK_MAGIC,
CMMsg.TYP_CAST_SPELLpublic void setOthersCode(int code)
CMMsg
setOthersCode in interface CMMsgcode - the new full bitmask/action type others event codeCMMsg.othersMessage(),
CMMsg.othersCode(),
CMMsg.othersMajor(),
CMMsg.othersMinor(),
CMMsg.MASK_MAGIC,
CMMsg.TYP_CAST_SPELLpublic void setSourceMessage(java.lang.String str)
CMMsg
setSourceMessage in interface CMMsgstr - the string to show to the source, or NULLCMMsg.source(),
CMMsg.sourceMessage(),
CMMsg.sourceCode()public void setTargetMessage(java.lang.String str)
CMMsg
setTargetMessage in interface CMMsgstr - the string to show to the target, or NULLCMMsg.target(),
CMMsg.targetMessage(),
CMMsg.targetCode()public void setOthersMessage(java.lang.String str)
CMMsg
setOthersMessage in interface CMMsgstr - the string to show to the others, or NULLCMMsg.othersMessage(),
CMMsg.othersCode()public int value()
CMMsg
value in interface CMMsgpublic void setValue(int amount)
CMMsg
setValue in interface CMMsgamount - the integer value of this eventpublic java.util.List<CMMsg> trailerMsgs()
CMMsg
trailerMsgs in interface CMMsgRoom.send(MOB, CMMsg)public void addTrailerMsg(CMMsg msg)
CMMsg
addTrailerMsg in interface CMMsgmsg - the CMMsg to append to this message.Room.send(MOB, CMMsg)
public void modify(MOB source,
Environmental target,
Environmental tool,
int newSourceCode,
java.lang.String sourceMessage,
int newTargetCode,
java.lang.String targetMessage,
int newOthersCode,
java.lang.String othersMessage)
CMMsg
modify in interface CMMsgsource - the new source of this eventtarget - the new target of this eventtool - the new tool for this eventnewSourceCode - the new source code for this eventsourceMessage - the new source message for this eventnewTargetCode - the new target code for this eventtargetMessage - the new target message for this eventnewOthersCode - the new others code for this eventothersMessage - the new others message for this eventCMMsg.source(),
CMMsg.target(),
CMMsg.sourceCode(),
CMMsg.targetCode(),
CMMsg.othersCode(),
CMMsg.sourceMessage(),
CMMsg.targetMessage(),
CMMsg.othersMessage()
public void modify(MOB source,
Environmental target,
Environmental tool,
int newSourceCode,
int newTargetCode,
int newOthersCode,
java.lang.String allMessage)
CMMsg
modify in interface CMMsgsource - the new source of this eventtarget - the new target of this eventtool - the new tool for this eventnewSourceCode - the new source code for this eventnewTargetCode - the new target code for this eventnewOthersCode - the new others code for this eventallMessage - the new source, target, and others message of this eventCMMsg.source(),
CMMsg.target(),
CMMsg.sourceCode(),
CMMsg.targetCode(),
CMMsg.othersCode(),
CMMsg.sourceMessage(),
CMMsg.targetMessage(),
CMMsg.othersMessage()public MOB source()
CMMsg
source in interface CMMsgCMMsg.setSource(MOB),
MOBpublic void setSource(MOB mob)
CMMsg
setSource in interface CMMsgmob - the new source of this eventCMMsg.source(),
MOBpublic Environmental target()
CMMsg
target in interface CMMsgCMMsg.setTarget(Environmental),
Environmentalpublic void setTarget(Environmental E)
CMMsg
setTarget in interface CMMsgE - the new target of this eventCMMsg.target(),
Environmentalpublic Environmental tool()
CMMsg
tool in interface CMMsgEnvironmental,
CMMsg.setTool(Environmental)public void setTool(Environmental E)
CMMsg
setTool in interface CMMsgE - the new tool of this eventEnvironmental,
CMMsg.tool()public int targetMajor()
CMMsg
targetMajor in interface CMMsgCMMsg.targetCode(),
CMMsg.targetMinor(),
CMMsg.MASK_MAGICpublic int targetMinor()
CMMsg
targetMinor in interface CMMsgCMMsg.targetCode(),
CMMsg.targetMajor(),
CMMsg.TYP_CAST_SPELLpublic int targetCode()
CMMsg
targetCode in interface CMMsgCMMsg.target(),
CMMsg.targetMessage(),
CMMsg.targetMajor(),
CMMsg.targetMinor(),
CMMsg.MASK_MAGIC,
CMMsg.TYP_CAST_SPELL,
CMMsg.setTargetCode(int)public java.lang.String targetMessage()
CMMsg
targetMessage in interface CMMsgCMMsg.target(),
CMMsg.setTargetMessage(String),
CMMsg.targetCode()public int sourceCode()
CMMsg
sourceCode in interface CMMsgCMMsg.source(),
CMMsg.sourceMessage(),
CMMsg.sourceMajor(),
CMMsg.sourceMinor(),
CMMsg.MASK_MAGIC,
CMMsg.TYP_CAST_SPELL,
CMMsg.setSourceCode(int)public int sourceMajor()
CMMsg
sourceMajor in interface CMMsgCMMsg.sourceCode(),
CMMsg.sourceMinor(),
CMMsg.MASK_MAGICpublic int sourceMinor()
CMMsg
sourceMinor in interface CMMsgCMMsg.targetCode(),
CMMsg.targetMajor(),
CMMsg.TYP_CAST_SPELLpublic java.lang.String sourceMessage()
CMMsg
sourceMessage in interface CMMsgCMMsg.source(),
CMMsg.setSourceMessage(String),
CMMsg.sourceCode()public int othersMajor()
CMMsg
othersMajor in interface CMMsgCMMsg.othersCode(),
CMMsg.othersMinor(),
CMMsg.MASK_MAGICpublic int othersMinor()
CMMsg
othersMinor in interface CMMsgCMMsg.othersCode(),
CMMsg.othersMajor(),
CMMsg.TYP_CAST_SPELLpublic int othersCode()
CMMsg
othersCode in interface CMMsgCMMsg.othersMessage(),
CMMsg.othersMajor(),
CMMsg.othersMinor(),
CMMsg.MASK_MAGIC,
CMMsg.TYP_CAST_SPELL,
CMMsg.setOthersCode(int)public java.lang.String othersMessage()
CMMsg
othersMessage in interface CMMsgCMMsg.setOthersMessage(String),
CMMsg.othersCode()public boolean amITarget(Environmental thisOne)
CMMsg
amITarget in interface CMMsgthisOne - the Environmental to inspect, may not be null
CMMsg.target(),
Environmentalpublic boolean amISource(MOB thisOne)
CMMsg
amISource in interface CMMsgthisOne - the Environmental to inspect, may not be null
CMMsg.source(),
Environmentalpublic boolean isTarget(Environmental E)
CMMsg
isTarget in interface CMMsgE - the Environmental to inspect, may not be null
CMMsg.target(),
Environmentalpublic boolean isTarget(int codeOrMask)
CMMsg
isTarget in interface CMMsgcodeOrMask - the target action code or target major mask to check
CMMsg.targetCode()public boolean isTarget(java.lang.String codeOrMaskDesc)
CMMsg
isTarget in interface CMMsgcodeOrMaskDesc - the target action code string, or mask string
CMMsg.TYPE_DESCS,
CMMsg.MASK_DESCS,
CMMsg.targetCode()public boolean isSource(Environmental E)
CMMsg
isSource in interface CMMsgE - the Environmental to inspect, may not be null
CMMsg.source(),
Environmentalpublic boolean isSource(int codeOrMask)
CMMsg
isSource in interface CMMsgcodeOrMask - the source action code or source major mask to check
CMMsg.sourceCode()public boolean isSource(java.lang.String codeOrMaskDesc)
CMMsg
isSource in interface CMMsgcodeOrMaskDesc - the source action code string, or mask string
CMMsg.TYPE_DESCS,
CMMsg.MASK_DESCS,
CMMsg.sourceCode()public boolean isOthers(Environmental E)
CMMsg
isOthers in interface CMMsgE - the Environmental to inspect, may not be null
Environmental,
CMMsg.source(),
CMMsg.target()public boolean isOthers(int codeOrMask)
CMMsg
isOthers in interface CMMsgcodeOrMask - the others action code or others major mask to check
CMMsg.othersCode()public boolean isOthers(java.lang.String codeOrMaskDesc)
CMMsg
isOthers in interface CMMsgcodeOrMaskDesc - the others action code string, or mask string
CMMsg.TYPE_DESCS,
CMMsg.MASK_DESCS,
CMMsg.othersCode()
protected static boolean matches(int code1,
int code2)
protected static boolean matches(int code1,
java.lang.String code2)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||