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 static class DefaultFaction.DefaultFactionChangeEvent
extends java.lang.Object
implements Faction.FactionChangeEvent


Field Summary
 int direction
           
 double factor
           
 java.lang.String flagCache
           
 java.lang.String ID
           
 int IDclassFilter
           
 int IDdomainFilter
           
 int IDflagFilter
           
 boolean just100
           
 boolean outsiderTargetOK
           
 boolean selfTargetOK
           
 java.lang.String zapper
           
 
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()
           
DefaultFaction.DefaultFactionChangeEvent(java.lang.String key)
           
 
Method Summary
 boolean applies(MOB mob)
          Returns whether the given mob is a valid target of this 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.
 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 setZapper(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.
 java.lang.String toString()
          Returns a semicolon delimited list of all the settings in this change event
 java.lang.String zapper()
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public java.lang.String ID

flagCache

public java.lang.String flagCache

IDclassFilter

public int IDclassFilter

IDflagFilter

public int IDflagFilter

IDdomainFilter

public int IDdomainFilter

direction

public int direction

factor

public double factor

zapper

public java.lang.String zapper

outsiderTargetOK

public boolean outsiderTargetOK

selfTargetOK

public boolean selfTargetOK

just100

public boolean just100
Constructor Detail

DefaultFaction.DefaultFactionChangeEvent

public DefaultFaction.DefaultFactionChangeEvent()

DefaultFaction.DefaultFactionChangeEvent

public DefaultFaction.DefaultFactionChangeEvent(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)

zapper

public java.lang.String zapper()
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:
zapper in interface Faction.FactionChangeEvent
Returns:
the zapper mask string
See Also:
Faction.FactionChangeEvent.setZapper(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()

setZapper

public void setZapper(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:
setZapper in interface Faction.FactionChangeEvent
Parameters:
newVal - the new zapper mask string
See Also:
Faction.FactionChangeEvent.zapper(), MaskingLibrary

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.addChangeEvent(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 mob)
Description copied from interface: Faction.FactionChangeEvent
Returns whether the given mob is a valid target of this event.

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