com.planet_ink.coffee_mud.Common.interfaces
Interface Faction.FData

All Superinterfaces:
MsgListener, StatsAffecting
All Known Implementing Classes:
DefaultFaction.DefaultFactionData
Enclosing interface:
Faction

public static interface Faction.FData
extends MsgListener, StatsAffecting

A FactionData object is stored inside other objects that keep track of their own faction. The object stores the faction value, any event listeners or tickers, and a method to determine when it is time to refresh the object.

See Also:
Faction.makeFactionData(MOB)

Method Summary
 void addHandlers(java.util.List<Ability> abilities, java.util.List<Behavior> behaviors)
          Clears and re-adds all the necessary message listeners and tickers and stat affecting objects for this faction data reference.
 Faction getFaction()
          Return the parent faction for which this data stands.
 long getNextChangeTimers(Faction.FactionChangeEvent event)
          Returns a timestamp for the given event denoting when that event can next take place.
 boolean requiresUpdating()
          Returns true if this object requires updating by the parent faction for some reason.
 void resetFactionData(Faction F)
          Cleans out the internal data structures of this faction to denote that a new context is entered.
 void setNextChangeTimers(Faction.FactionChangeEvent event, long time)
          Sets a timestamp for the given event denoting when that event can next take place.
 void setValue(int newValue)
          Sets the actual value that the holding object has in this faction.
 boolean tick(Tickable ticking, int tickID)
          A mirror implementation of Tickable
 int value()
          Returns the actual value that the holding object has in this faction.
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.MsgListener
executeMsg, okMessage
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.StatsAffecting
affectCharState, affectCharStats, affectPhyStats
 

Method Detail

resetFactionData

void resetFactionData(Faction F)
Cleans out the internal data structures of this faction to denote that a new context is entered. Is called by the constructor.

Parameters:
F - the faction to which this data belongs.

requiresUpdating

boolean requiresUpdating()
Returns true if this object requires updating by the parent faction for some reason.

Returns:
true if an update is necessary, false otherwise.

tick

boolean tick(Tickable ticking,
             int tickID)
A mirror implementation of Tickable

Parameters:
ticking - the ticking object
tickID - the id code of the tick being done
Returns:
true to keep ticking, false to stop ticking
See Also:
Tickable

getFaction

Faction getFaction()
Return the parent faction for which this data stands.

Returns:
this data objects parent faction.

value

int value()
Returns the actual value that the holding object has in this faction.

Returns:
the faction value

setValue

void setValue(int newValue)
Sets the actual value that the holding object has in this faction.

Parameters:
newValue - the faction value

addHandlers

void addHandlers(java.util.List<Ability> abilities,
                 java.util.List<Behavior> behaviors)
Clears and re-adds all the necessary message listeners and tickers and stat affecting objects for this faction data reference.

Parameters:
abilities - a vector of abilities
behaviors - a vector of behaviors

getNextChangeTimers

long getNextChangeTimers(Faction.FactionChangeEvent event)
Returns a timestamp for the given event denoting when that event can next take place.

Parameters:
event - the change event to get a time for.
Returns:
the timestamp ro the next event, or 0

setNextChangeTimers

void setNextChangeTimers(Faction.FactionChangeEvent event,
                         long time)
Sets a timestamp for the given event denoting when that event can next take place.

Parameters:
event - the change event to get a time for.
time - the timestamp ro the next event, or 0