com.planet_ink.coffee_mud.Common
Class DefaultFaction.DefaultFactionChangeEvent

java.lang.Object
  extended by com.planet_ink.coffee_mud.Common.DefaultFaction.DefaultFactionChangeEvent
All Implemented Interfaces:
Faction.FactionChangeEvent
Enclosing class:
DefaultFaction

public class DefaultFaction.DefaultFactionChangeEvent
extends java.lang.Object
implements Faction.FactionChangeEvent


Field Summary
 
Fields inherited from interface com.planet_ink.coffee_mud.Common.interfaces.Faction.FactionChangeEvent
CHANGE_DIRECTION_ADD, CHANGE_DIRECTION_AWAY, CHANGE_DIRECTION_DESCS, CHANGE_DIRECTION_DOWN, CHANGE_DIRECTION_MAXIMUM, CHANGE_DIRECTION_MINIMUM, CHANGE_DIRECTION_OPPOSITE, CHANGE_DIRECTION_REMOVE, CHANGE_DIRECTION_TOWARD, CHANGE_DIRECTION_UP, FLAG_DESCS, MISC_TRIGGERS
 
Constructor Summary
DefaultFaction.DefaultFactionChangeEvent(Faction F)
           
DefaultFaction.DefaultFactionChangeEvent(Faction F, java.lang.String key)
           
 
Method Summary
 boolean applies(MOB source, MOB target)
          Returns whether the given mob is a valid source and target of this event.
 MaskingLibrary.CompiledZapperMask compiledSourceZapper()
          Returns the zapper mask that is used to see if the source of the event qualifies in order to trigger a faction change by this defined event.
 MaskingLibrary.CompiledZapperMask compiledTargetZapper()
          Returns the zapper mask that is used to see if the target of the event qualifies in order to trigger a faction change by this defined event.
 int direction()
          Returns a code for a description of how an event, if applicable, will affect this factions value.
 java.lang.String eventID()
          Returns the event trigger id
 double factor()
          Returns the factor to multiply the base faction change amount (100) by, to determine the amount of this faction changed by this event, in accordance with the given direction.
 java.lang.String flagCache()
          Returns the list of flags that apply to this event.
 Faction getFaction()
          Return the parent faction for which this data stands.
 java.lang.String getTriggerParm(java.lang.String parmName)
          Returns the named trigger parameters defined
 int IDclassFilter()
          A derivative of the event id, this will return a value of 0 or above if the event id was of a particular Ability ACODE_.
 int IDdomainFilter()
          A derivative of the event id, this will return a value of 0 or above if the event id was of a particular Ability DOMAIN_.
 int IDflagFilter()
          A derivative of the event id, this will return a value of 0 or above if the event id was of a particular Ability FLAG_.
 boolean just100()
          A derivative of the flag cache, this method returns whether the flag was set that causes the determination of the amount of faction move to apply to NOT take the difference between the source and targets levels into account.
 boolean outsiderTargetOK()
          A derivative of the flag cache, this method returns whether the flag was set that allows this event to trigger when the target of the event does not have any value with this faction
 boolean selfTargetOK()
          A derivative of the flag cache, this method returns whether the flag was set that allows this event to trigger when the target and source of the event are the same.
 void setDirection(int newVal)
          Sets a code for a description of how an event, if applicable, will affect this factions value.
 boolean setDirection(java.lang.String d)
           
 boolean setEventID(java.lang.String newID)
          Sets the event trigger id
 void setFactor(double newVal)
          Sets the factor to multiply the base faction change amount (100) by, to determine the amount of this faction changed by this event, in accordance with the given direction.
 void setFlags(java.lang.String newFlagCache)
          Sets the list of flags that apply to this event.
 void setStateVariable(int x, java.lang.Object newVal)
          Sets an internal state variable stored for this change event.
 void setTargetZapper(java.lang.String newVal)
          Sets the zapper mask that is used to see if the target of the event qualifies in order to trigger a faction change by this defined event.
 void setTriggerParameters(java.lang.String newVal)
          Sets any trigger parameters defined that modify the way the trigger behaves.
 java.lang.Object stateVariable(int x)
          Returns the internal state variable stored for this change event.
 java.lang.String targetZapper()
          Returns the zapper mask that is used to see if the target of the event qualifies in order to trigger a faction change by this defined event.
 java.lang.String toString()
          Returns a semicolon delimited list of all the settings in this change event
 java.lang.String triggerParameters()
          Returns any trigger parameters defined that modify the way the trigger behaves.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultFaction.DefaultFactionChangeEvent

public DefaultFaction.DefaultFactionChangeEvent(Faction F)

DefaultFaction.DefaultFactionChangeEvent

public DefaultFaction.DefaultFactionChangeEvent(Faction F,
                                                java.lang.String key)
Method Detail

eventID

public java.lang.String eventID()
Description copied from interface: Faction.FactionChangeEvent
Returns the event trigger id

Specified by:
eventID in interface Faction.FactionChangeEvent
Returns:
the event trigger id
See Also:
Faction.ALL_CHANGE_EVENT_TYPES(), Faction.FactionChangeEvent.setEventID(String), Faction.FactionChangeEvent.IDclassFilter(), Faction.FactionChangeEvent.IDdomainFilter(), Faction.FactionChangeEvent.IDflagFilter()

flagCache

public java.lang.String flagCache()
Description copied from interface: Faction.FactionChangeEvent
Returns the list of flags that apply to this event.

Specified by:
flagCache in interface Faction.FactionChangeEvent
Returns:
the list of applicable flags
See Also:
Faction.FactionChangeEvent.FLAG_DESCS, Faction.FactionChangeEvent.setFlags(String), Faction.FactionChangeEvent.outsiderTargetOK(), Faction.FactionChangeEvent.selfTargetOK(), Faction.FactionChangeEvent.just100()

IDclassFilter

public int IDclassFilter()
Description copied from interface: Faction.FactionChangeEvent
A derivative of the event id, this will return a value of 0 or above if the event id was of a particular Ability ACODE_. Returns -1 if this value does not apply, or an index into ACODE_DESCS.

Specified by:
IDclassFilter in interface Faction.FactionChangeEvent
Returns:
-1, or an index into an Ability ACODE
See Also:
Ability.ACODE_DESCS, Faction.FactionChangeEvent.eventID(), Faction.FactionChangeEvent.IDdomainFilter(), Faction.FactionChangeEvent.IDflagFilter()

IDflagFilter

public int IDflagFilter()
Description copied from interface: Faction.FactionChangeEvent
A derivative of the event id, this will return a value of 0 or above if the event id was of a particular Ability FLAG_. Returns -1 if this value does not apply, or an index into FLAG_DESCS.

Specified by:
IDflagFilter in interface Faction.FactionChangeEvent
Returns:
-1, or an index into an Ability FLAG
See Also:
Ability.FLAG_DESCS, Faction.FactionChangeEvent.eventID(), Faction.FactionChangeEvent.IDclassFilter(), Faction.FactionChangeEvent.IDdomainFilter()

IDdomainFilter

public int IDdomainFilter()
Description copied from interface: Faction.FactionChangeEvent
A derivative of the event id, this will return a value of 0 or above if the event id was of a particular Ability DOMAIN_. Returns -1 if this value does not apply, or an index into DOMAIN_DESCS.

Specified by:
IDdomainFilter in interface Faction.FactionChangeEvent
Returns:
-1, or an index into an Ability ACODE
See Also:
Ability.DOMAIN_DESCS, Faction.FactionChangeEvent.eventID(), Faction.FactionChangeEvent.IDclassFilter(), Faction.FactionChangeEvent.IDflagFilter()

direction

public int direction()
Description copied from interface: Faction.FactionChangeEvent
Returns a code for a description of how an event, if applicable, will affect this factions value. The direction is an index into CHANGE_DIRECTION_DESCS, or one of the CHANGE_DIRECTION_ constants.

Specified by:
direction in interface Faction.FactionChangeEvent
Returns:
a FactionChangeEvent#CHANGE_DIRECTION_ constant
See Also:
Faction.FactionChangeEvent.CHANGE_DIRECTION_DESCS, Faction.FactionChangeEvent.setDirection(int)

factor

public double factor()
Description copied from interface: Faction.FactionChangeEvent
Returns the factor to multiply the base faction change amount (100) by, to determine the amount of this faction changed by this event, in accordance with the given direction.

Specified by:
factor in interface Faction.FactionChangeEvent
Returns:
the factor to multiply the base amount of the faction by
See Also:
Faction.FactionChangeEvent.direction(), Faction.FactionChangeEvent.setFactor(double)

targetZapper

public java.lang.String targetZapper()
Description copied from interface: Faction.FactionChangeEvent
Returns the zapper mask that is used to see if the target of the event qualifies in order to trigger a faction change by this defined event.

Specified by:
targetZapper in interface Faction.FactionChangeEvent
Returns:
the zapper mask string
See Also:
Faction.FactionChangeEvent.setTargetZapper(String), MaskingLibrary

outsiderTargetOK

public boolean outsiderTargetOK()
Description copied from interface: Faction.FactionChangeEvent
A derivative of the flag cache, this method returns whether the flag was set that allows this event to trigger when the target of the event does not have any value with this faction

Specified by:
outsiderTargetOK in interface Faction.FactionChangeEvent
Returns:
true if the target does not have to have this faction, false otherwise
See Also:
Faction.FactionChangeEvent.flagCache(), Faction.FactionChangeEvent.selfTargetOK(), Faction.FactionChangeEvent.just100()

selfTargetOK

public boolean selfTargetOK()
Description copied from interface: Faction.FactionChangeEvent
A derivative of the flag cache, this method returns whether the flag was set that allows this event to trigger when the target and source of the event are the same.

Specified by:
selfTargetOK in interface Faction.FactionChangeEvent
Returns:
true if src and target are the same, false otherwise
See Also:
Faction.FactionChangeEvent.flagCache(), Faction.FactionChangeEvent.outsiderTargetOK(), Faction.FactionChangeEvent.just100()

just100

public boolean just100()
Description copied from interface: Faction.FactionChangeEvent
A derivative of the flag cache, this method returns whether the flag was set that causes the determination of the amount of faction move to apply to NOT take the difference between the source and targets levels into account.

Specified by:
just100 in interface Faction.FactionChangeEvent
Returns:
true to NOT take level into account when determining amount of faction change
See Also:
Faction.FactionChangeEvent.flagCache(), Faction.FactionChangeEvent.outsiderTargetOK(), Faction.FactionChangeEvent.selfTargetOK()

setDirection

public void setDirection(int newVal)
Description copied from interface: Faction.FactionChangeEvent
Sets a code for a description of how an event, if applicable, will affect this factions value. The direction is an index into CHANGE_DIRECTION_DESCS, or one of the CHANGE_DIRECTION_ constants.

Specified by:
setDirection in interface Faction.FactionChangeEvent
Parameters:
newVal - a new FactionChangeEvent#CHANGE_DIRECTION_ constant
See Also:
Faction.FactionChangeEvent.CHANGE_DIRECTION_DESCS, Faction.FactionChangeEvent.direction()

setFactor

public void setFactor(double newVal)
Description copied from interface: Faction.FactionChangeEvent
Sets the factor to multiply the base faction change amount (100) by, to determine the amount of this faction changed by this event, in accordance with the given direction.

Specified by:
setFactor in interface Faction.FactionChangeEvent
See Also:
Faction.FactionChangeEvent.direction(), Faction.FactionChangeEvent.factor()

setTargetZapper

public void setTargetZapper(java.lang.String newVal)
Description copied from interface: Faction.FactionChangeEvent
Sets the zapper mask that is used to see if the target of the event qualifies in order to trigger a faction change by this defined event.

Specified by:
setTargetZapper in interface Faction.FactionChangeEvent
Parameters:
newVal - the new zapper mask string
See Also:
Faction.FactionChangeEvent.targetZapper(), MaskingLibrary

compiledTargetZapper

public MaskingLibrary.CompiledZapperMask compiledTargetZapper()
Description copied from interface: Faction.FactionChangeEvent
Returns the zapper mask that is used to see if the target of the event qualifies in order to trigger a faction change by this defined event.

Specified by:
compiledTargetZapper in interface Faction.FactionChangeEvent
Returns:
the zapper mask compiled
See Also:
Faction.FactionChangeEvent.setTargetZapper(String), MaskingLibrary

compiledSourceZapper

public MaskingLibrary.CompiledZapperMask compiledSourceZapper()
Description copied from interface: Faction.FactionChangeEvent
Returns the zapper mask that is used to see if the source of the event qualifies in order to trigger a faction change by this defined event.

Specified by:
compiledSourceZapper in interface Faction.FactionChangeEvent
Returns:
the zapper mask compiled
See Also:
Faction.FactionChangeEvent.setTriggerParameters(String), MaskingLibrary

getTriggerParm

public java.lang.String getTriggerParm(java.lang.String parmName)
Description copied from interface: Faction.FactionChangeEvent
Returns the named trigger parameters defined

Specified by:
getTriggerParm in interface Faction.FactionChangeEvent
Returns:
the specific named trigger parameter
See Also:
Faction.FactionChangeEvent.setTriggerParameters(String)

toString

public java.lang.String toString()
Description copied from interface: Faction.FactionChangeEvent
Returns a semicolon delimited list of all the settings in this change event

Specified by:
toString in interface Faction.FactionChangeEvent
Overrides:
toString in class java.lang.Object
Returns:
a semicolon delimited list of all the settings in this change event
See Also:
Faction.createChangeEvent(String)

setEventID

public boolean setEventID(java.lang.String newID)
Description copied from interface: Faction.FactionChangeEvent
Sets the event trigger id

Specified by:
setEventID in interface Faction.FactionChangeEvent
Parameters:
newID - the new event trigger id
Returns:
true if the event id is valid
See Also:
Faction.ALL_CHANGE_EVENT_TYPES(), Faction.FactionChangeEvent.eventID(), Faction.FactionChangeEvent.IDclassFilter(), Faction.FactionChangeEvent.IDdomainFilter(), Faction.FactionChangeEvent.IDflagFilter()

setDirection

public boolean setDirection(java.lang.String d)

setFlags

public void setFlags(java.lang.String newFlagCache)
Description copied from interface: Faction.FactionChangeEvent
Sets the list of flags that apply to this event.

Specified by:
setFlags in interface Faction.FactionChangeEvent
Parameters:
newFlagCache - the new list of applicable flags
See Also:
Faction.FactionChangeEvent.FLAG_DESCS, Faction.FactionChangeEvent.flagCache(), Faction.FactionChangeEvent.outsiderTargetOK(), Faction.FactionChangeEvent.selfTargetOK(), Faction.FactionChangeEvent.just100()

applies

public boolean applies(MOB source,
                       MOB target)
Description copied from interface: Faction.FactionChangeEvent
Returns whether the given mob is a valid source and target of this event.

Specified by:
applies in interface Faction.FactionChangeEvent
Parameters:
source - the source to evaluate
target - the target to evaluate
Returns:
true if this event applies to the mobs, false otherwise

triggerParameters

public java.lang.String triggerParameters()
Description copied from interface: Faction.FactionChangeEvent
Returns any trigger parameters defined that modify the way the trigger behaves.

Specified by:
triggerParameters in interface Faction.FactionChangeEvent
Returns:
the trigger parameters
See Also:
Faction.FactionChangeEvent.setTriggerParameters(String)

setTriggerParameters

public void setTriggerParameters(java.lang.String newVal)
Description copied from interface: Faction.FactionChangeEvent
Sets any trigger parameters defined that modify the way the trigger behaves.

Specified by:
setTriggerParameters in interface Faction.FactionChangeEvent
Parameters:
newVal - the trigger parameters
See Also:
Faction.FactionChangeEvent.triggerParameters()

stateVariable

public java.lang.Object stateVariable(int x)
Description copied from interface: Faction.FactionChangeEvent
Returns the internal state variable stored for this change event.

Specified by:
stateVariable in interface Faction.FactionChangeEvent
Parameters:
x - which internal state variable to get
Returns:
the state variable
See Also:
Faction.FactionChangeEvent.setStateVariable(int,Object)

setStateVariable

public void setStateVariable(int x,
                             java.lang.Object newVal)
Description copied from interface: Faction.FactionChangeEvent
Sets an internal state variable stored for this change event.

Specified by:
setStateVariable in interface Faction.FactionChangeEvent
Parameters:
x - which internal state variable to set
newVal - the state variable
See Also:
Faction.FactionChangeEvent.stateVariable(int)

getFaction

public Faction getFaction()
Description copied from interface: Faction.FactionChangeEvent
Return the parent faction for which this data stands.

Specified by:
getFaction in interface Faction.FactionChangeEvent
Returns:
this data objects parent faction.