AbilityComponent
, CMCommon
, CMObject
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class DefaultAbilityComponent extends java.lang.Object implements AbilityComponent
AbilityComponent.CompConnector, AbilityComponent.CompLocation, AbilityComponent.CompType
idConverter
Constructor | Description |
---|---|
DefaultAbilityComponent() |
Modifier and Type | Method | Description |
---|---|---|
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.
|
java.lang.String |
getAbilityID() |
Returns the ability ID that this component serves.
|
int |
getAmount() |
Returns the number of items matching this component which must be present.
|
MaskingLibrary.CompiledZMask |
getCompiledMask() |
Returns the compiled zapper mask to determine whether a given agent
qualifies this item as a component.
|
AbilityComponent.CompConnector |
getConnector() |
Returns an enum describing how this component "connects" with the
following component logically.
|
AbilityComponent.CompLocation |
getLocation() |
Returns an enum value describing where an item must be to
be considered a valid component.
|
long |
getLongType() |
For resource and material type item component filters, this will
return the type comparison object as a long value.
|
java.lang.String |
getMaskStr() |
Returns the raw zapper mask to determine whether a given agent
qualifies this item as a component.
|
java.lang.String |
getStringType() |
For resource and material type item component filters, this will
return the type comparison object as a String value.
|
java.lang.String |
getSubType() |
Returns the item filter type for determining whether an item is
a component.
|
java.lang.String |
getTriggererDef() |
Returns the raw triggering ritual definition string to execute
this ability for which this component exists.
|
AbilityComponent.CompType |
getType() |
Returns the item filter type for determining whether an item is
a component.
|
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 |
isConsumed() |
Gets whether or not this component is consumed upon use
|
java.lang.String |
name() |
The displayable name of this object.
|
CMObject |
newInstance() |
Returns a new instance of this class.
|
void |
setAbilityID(java.lang.String ID) |
Sets the ability ID that this component serves.
|
void |
setAmount(int amount) |
Sets the number of items matching this component which must be present.
|
void |
setConnector(AbilityComponent.CompConnector connector) |
Sets an enum describing how this component "connects" with the
following component logically.
|
void |
setConsumed(boolean isConsumed) |
Sets whether or not this component is consumed upon use
|
void |
setLocation(AbilityComponent.CompLocation location) |
Sets an enum value describing where an item must be to
be considered a valid component.
|
void |
setMask(java.lang.String maskStr) |
Sets the raw zapper mask to determine whether a given agent
qualifies this item as a component.
|
void |
setTriggererDef(java.lang.String def) |
Sets the raw triggering ritual definition string to execute
this ability for which this component exists.
|
void |
setType(AbilityComponent.CompType type,
java.lang.Object typeObj,
java.lang.String subType) |
Sets the item filter type for determining whether an item is
a component.
|
public java.lang.String ID()
CMObject
public java.lang.String name()
CMObject
name
in interface CMObject
Environmental.Name()
public int compareTo(CMObject o)
compareTo
in interface java.lang.Comparable<CMObject>
public CMObject newInstance()
CMObject
newInstance
in interface CMObject
public void initializeClass()
CMObject
initializeClass
in interface CMObject
public CMObject copyOf()
CMObject
public java.lang.String getAbilityID()
AbilityComponent
getAbilityID
in interface AbilityComponent
AbilityComponent.setAbilityID(String)
public void setAbilityID(java.lang.String ID)
AbilityComponent
setAbilityID
in interface AbilityComponent
ID
- the ability IDAbilityComponent.getAbilityID()
public AbilityComponent.CompConnector getConnector()
AbilityComponent
getConnector
in interface AbilityComponent
AbilityComponent.CompConnector
,
AbilityComponent.setConnector(CompConnector)
public void setConnector(AbilityComponent.CompConnector connector)
AbilityComponent
setConnector
in interface AbilityComponent
connector
- a connector enumAbilityComponent.CompConnector
,
AbilityComponent.getConnector()
public AbilityComponent.CompLocation getLocation()
AbilityComponent
getLocation
in interface AbilityComponent
AbilityComponent.CompLocation
,
AbilityComponent.setLocation(CompLocation)
public void setLocation(AbilityComponent.CompLocation location)
AbilityComponent
setLocation
in interface AbilityComponent
location
- where an item must be to be a componentAbilityComponent.CompLocation
,
AbilityComponent.getLocation()
public boolean isConsumed()
AbilityComponent
isConsumed
in interface AbilityComponent
AbilityComponent.setConsumed(boolean)
public void setConsumed(boolean isConsumed)
AbilityComponent
setConsumed
in interface AbilityComponent
isConsumed
- true if consumed, false otherwiseAbilityComponent.isConsumed()
public int getAmount()
AbilityComponent
getAmount
in interface AbilityComponent
AbilityComponent.setAmount(int)
public void setAmount(int amount)
AbilityComponent
setAmount
in interface AbilityComponent
amount
- the number of items matching this component which must be presentAbilityComponent.getAmount()
public MaskingLibrary.CompiledZMask getCompiledMask()
AbilityComponent
getCompiledMask
in interface AbilityComponent
AbilityComponent.getMaskStr()
,
AbilityComponent.setMask(String)
,
MaskingLibrary
public java.lang.String getMaskStr()
AbilityComponent
getMaskStr
in interface AbilityComponent
AbilityComponent.getCompiledMask()
,
AbilityComponent.setMask(String)
,
MaskingLibrary
public void setMask(java.lang.String maskStr)
AbilityComponent
setMask
in interface AbilityComponent
maskStr
- the raw zapper maskAbilityComponent.getCompiledMask()
,
AbilityComponent.getMaskStr()
,
MaskingLibrary
public AbilityComponent.CompType getType()
AbilityComponent
getType
in interface AbilityComponent
AbilityComponent.CompType
,
AbilityComponent.setType(CompType, Object, String)
public void setType(AbilityComponent.CompType type, java.lang.Object typeObj, java.lang.String subType)
AbilityComponent
setType
in interface AbilityComponent
type
- the CompType enumtypeObj
- either a Integer object or a StringsubType
- the typeObj subTypeAbilityComponent.CompType
,
AbilityComponent.getType()
,
AbilityComponent.getSubType()
,
AbilityComponent.getLongType()
,
AbilityComponent.getStringType()
public long getLongType()
AbilityComponent
getLongType
in interface AbilityComponent
AbilityComponent.setType(CompType, Object, String)
public java.lang.String getStringType()
AbilityComponent
getStringType
in interface AbilityComponent
AbilityComponent.setType(CompType, Object, String)
public java.lang.String getSubType()
AbilityComponent
getSubType
in interface AbilityComponent
AbilityComponent.CompType
,
AbilityComponent.setType(CompType, Object, String)
public java.lang.String getTriggererDef()
AbilityComponent
getTriggererDef
in interface AbilityComponent
AbilityComponent.setTriggererDef(String)
public void setTriggererDef(java.lang.String def)
AbilityComponent
setTriggererDef
in interface AbilityComponent
def
- the triggering ritual encoding definition string for this componentAbilityComponent.getTriggererDef()