com.planet_ink.coffee_mud.Common.interfaces
Interface AbilityComponent

All Superinterfaces:
java.lang.Cloneable, CMCommon, CMObject, java.lang.Comparable<CMObject>
All Known Implementing Classes:
DefaultAbilityComponent

public interface AbilityComponent
extends CMCommon

Descriptor class for ability components. These are managed by by the Ability library.

See Also:
AbilityComponents.addAbilityComponent(String, java.util.Map), AbilityComponents.componentCheck(com.planet_ink.coffee_mud.MOBS.interfaces.MOB, List, boolean), AbilityComponents.getAbilityComponentMap()

Nested Class Summary
static class AbilityComponent.CompConnector
          Connector descriptors for connecting component descriptions together
static class AbilityComponent.CompLocation
          Where worn locations for determining where a component must be
static class AbilityComponent.CompType
          An component type item filter for determining how to interpret the kind of item to compare
 
Method Summary
 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.
 AbilityComponent.CompType getType()
          Returns the item filter type for determining whether an item is a component.
 boolean isConsumed()
          Gets whether or not this component is consumed upon use
 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 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.
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, ID, initializeClass, name, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getConnector

AbilityComponent.CompConnector getConnector()
Returns an enum describing how this component "connects" with the following component logically. As in, is it required WITH the following component, or instead of?

Returns:
a connector enum
See Also:
AbilityComponent.CompConnector, setConnector(CompConnector)

setConnector

void setConnector(AbilityComponent.CompConnector connector)
Sets an enum describing how this component "connects" with the following component logically. As in, is it required WITH the following component, or instead of?

Parameters:
connector - a connector enum
See Also:
AbilityComponent.CompConnector, getConnector()

getLocation

AbilityComponent.CompLocation getLocation()
Returns an enum value describing where an item must be to be considered a valid component.

Returns:
where an item must be to be a component
See Also:
AbilityComponent.CompLocation, setLocation(CompLocation)

setLocation

void setLocation(AbilityComponent.CompLocation location)
Sets an enum value describing where an item must be to be considered a valid component.

Parameters:
location - where an item must be to be a component
See Also:
AbilityComponent.CompLocation, getLocation()

isConsumed

boolean isConsumed()
Gets whether or not this component is consumed upon use

Returns:
true if consumed, false otherwise
See Also:
setConsumed(boolean)

setConsumed

void setConsumed(boolean isConsumed)
Sets whether or not this component is consumed upon use

Parameters:
isConsumed - true if consumed, false otherwise
See Also:
isConsumed()

getAmount

int getAmount()
Returns the number of items matching this component which must be present.

Returns:
the number of items matching this component which must be present.
See Also:
setAmount(int)

setAmount

void setAmount(int amount)
Sets the number of items matching this component which must be present.

Parameters:
amount - the number of items matching this component which must be present
See Also:
getAmount()

getType

AbilityComponent.CompType getType()
Returns the item filter type for determining whether an item is a component. This type can designate a resource, material, or an item name string.

Returns:
a CompType enum
See Also:
AbilityComponent.CompType, setType(CompType, Object, String)

setType

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. This type can designate a resource, material, or an item name string. Also sent is either the resource mask, material mask, a string for a name filter, or a string with a long number in it.

Parameters:
type - the CompType enum
typeObj - either a Integer object or a String
subType - the typeObj subType
See Also:
AbilityComponent.CompType, getType(), getSubType(), getLongType(), getStringType()

getSubType

java.lang.String getSubType()
Returns the item filter type for determining whether an item is a component. This type can designate a resource, material, or an item name string.

Returns:
a String type
See Also:
AbilityComponent.CompType, setType(CompType, Object, String)

getLongType

long getLongType()
For resource and material type item component filters, this will return the type comparison object as a long value. This is typically a resource or material mask value.

Returns:
a resource or material mask value
See Also:
setType(CompType, Object, String)

getStringType

java.lang.String getStringType()
For resource and material type item component filters, this will return the type comparison object as a String value. This is typically a item name filter.

Returns:
a item name filter
See Also:
setType(CompType, Object, String)

getCompiledMask

MaskingLibrary.CompiledZMask getCompiledMask()
Returns the compiled zapper mask to determine whether a given agent qualifies this item as a component.

Returns:
the compiled zapper mask
See Also:
getMaskStr(), setMask(String), MaskingLibrary

getMaskStr

java.lang.String getMaskStr()
Returns the raw zapper mask to determine whether a given agent qualifies this item as a component.

Returns:
the raw zapper mask
See Also:
getCompiledMask(), setMask(String), MaskingLibrary

setMask

void setMask(java.lang.String maskStr)
Sets the raw zapper mask to determine whether a given agent qualifies this item as a component.

Parameters:
maskStr - the raw zapper mask
See Also:
getCompiledMask(), getMaskStr(), MaskingLibrary