Faction.FData, MsgListener, StatsAffectingpublic class DefaultFaction.DefaultFactionData extends java.lang.Object implements Faction.FData
| Modifier and Type | Field | Description |
|---|---|---|
boolean |
isReset |
| Constructor | Description |
|---|---|
DefaultFactionData(Faction F) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addHandlers(java.util.List<Ability> listeners,
java.util.List<Behavior> tickers) |
Clears and re-adds all the necessary message listeners and tickers
and stat affecting objects for this faction data reference.
|
void |
affectCharState(MOB affectedMob,
CharState affectableMaxState) |
This method is called by the recoverCharState() method on other MOB objects.
|
void |
affectCharStats(MOB affectedMob,
CharStats affectableStats) |
This method is called by the recoverCharStats() method on other MOB objects.
|
void |
affectPhyStats(Physical affected,
PhyStats affectableStats) |
This method is called by the recoverPhyStats() method on other Environmental objects.
|
void |
executeMsg(Environmental myHost,
CMMsg msg) |
The general message event handler for the object.
|
int |
getCounter(java.lang.String key) |
Returns the counter value for the given key/event id
|
long |
getEventTime(java.lang.String eventID) |
Returns the creation time of this data object, or the
last time the event with the given id was reset,
whichever is later.
|
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.
|
Faction.FRange |
getRange() |
Returns the current faction range for the current value.
|
boolean |
okMessage(Environmental myHost,
CMMsg msg) |
The general message event previewer for the object.
|
boolean |
requiresUpdating() |
Returns true if this object requires updating by the parent
faction for some reason.
|
void |
resetEventTimers(java.lang.String eventID) |
Resets the event timer with the given event id to
the current time.
|
void |
resetFactionData(Faction F) |
Cleans out the internal data structures of this faction
to denote that a new context is entered.
|
void |
setCounter(java.lang.String key,
int newValue) |
Sets the counter value for the given key/event id
|
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.
|
public DefaultFactionData(Faction F)
public void resetFactionData(Faction F)
Faction.FDataresetFactionData in interface Faction.FDataF - the faction to which this data belongs.public long getEventTime(java.lang.String eventID)
Faction.FDatagetEventTime in interface Faction.FDataeventID - the event id to look forpublic void resetEventTimers(java.lang.String eventID)
Faction.FDataresetEventTimers in interface Faction.FDataeventID - the event id to reset the timer forpublic int value()
Faction.FDatavalue in interface Faction.FDatapublic Faction getFaction()
Faction.FDatagetFaction in interface Faction.FDatapublic Faction.FRange getRange()
Faction.FDatagetRange in interface Faction.FDatapublic long getNextChangeTimers(Faction.FactionChangeEvent event)
Faction.FDatagetNextChangeTimers in interface Faction.FDataevent - the change event to get a time for.public void setNextChangeTimers(Faction.FactionChangeEvent event, long time)
Faction.FDatasetNextChangeTimers in interface Faction.FDataevent - the change event to get a time for.time - the timestamp ro the next event, or 0public void setValue(int newValue)
Faction.FDatasetValue in interface Faction.FDatanewValue - the faction valuepublic void affectPhyStats(Physical affected, PhyStats affectableStats)
StatsAffectingaffectPhyStats in interface StatsAffectingaffected - the host of the PhyStats object being affectedaffectableStats - the particular PhyStats object being affectedPhyStats,
Environmental,
Affectable.basePhyStats(),
Affectable.phyStats(),
Affectable.recoverPhyStats()public void affectCharStats(MOB affectedMob, CharStats affectableStats)
StatsAffectingaffectCharStats in interface StatsAffectingaffectedMob - the host of the CharStats object being affectedaffectableStats - the particular CharStats object being affectedCharStats,
MOB,
MOB.baseCharStats(),
MOB.charStats(),
MOB.recoverCharStats()public void affectCharState(MOB affectedMob, CharState affectableMaxState)
StatsAffectingaffectCharState in interface StatsAffectingaffectedMob - the host of the CharState object being affectedaffectableMaxState - the particular CharState object being affectedCharState,
MOB,
MOB.baseState(),
MOB.curState(),
MOB.recoverMaxState()public void addHandlers(java.util.List<Ability> listeners, java.util.List<Behavior> tickers)
Faction.FDataaddHandlers in interface Faction.FDatalisteners - a vector of abilitiestickers - a vector of behaviorspublic boolean requiresUpdating()
Faction.FDatarequiresUpdating in interface Faction.FDatapublic void executeMsg(Environmental myHost, CMMsg msg)
MsgListenerexecuteMsg in interface MsgListenermyHost - either the initiator of the event, or the host of this objectmsg - the CMMsg that needs to be executedCMMsgpublic boolean okMessage(Environmental myHost, CMMsg msg)
MsgListenerokMessage in interface MsgListenermyHost - either the initiator of the event, or the host of this objectmsg - the CMMsg that wants to be executedCMMsg,
CMMsg.source()public boolean tick(Tickable ticking, int tickID)
Faction.FDatatick in interface Faction.FDataticking - the ticking objecttickID - the id code of the tick being doneTickablepublic int getCounter(java.lang.String key)
Faction.FDatagetCounter in interface Faction.FDatakey - the event idpublic void setCounter(java.lang.String key,
int newValue)
Faction.FDatasetCounter in interface Faction.FDatakey - the counter key/event idnewValue - the counter value