Faction.FData
, MsgListener
, StatsAffecting
public 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.FData
resetFactionData
in interface Faction.FData
F
- the faction to which this data belongs.public long getEventTime(java.lang.String eventID)
Faction.FData
getEventTime
in interface Faction.FData
eventID
- the event id to look forpublic void resetEventTimers(java.lang.String eventID)
Faction.FData
resetEventTimers
in interface Faction.FData
eventID
- the event id to reset the timer forpublic int value()
Faction.FData
value
in interface Faction.FData
public Faction getFaction()
Faction.FData
getFaction
in interface Faction.FData
public Faction.FRange getRange()
Faction.FData
getRange
in interface Faction.FData
public long getNextChangeTimers(Faction.FactionChangeEvent event)
Faction.FData
getNextChangeTimers
in interface Faction.FData
event
- the change event to get a time for.public void setNextChangeTimers(Faction.FactionChangeEvent event, long time)
Faction.FData
setNextChangeTimers
in interface Faction.FData
event
- the change event to get a time for.time
- the timestamp ro the next event, or 0public void setValue(int newValue)
Faction.FData
setValue
in interface Faction.FData
newValue
- the faction valuepublic void affectPhyStats(Physical affected, PhyStats affectableStats)
StatsAffecting
affectPhyStats
in interface StatsAffecting
affected
- 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)
StatsAffecting
affectCharStats
in interface StatsAffecting
affectedMob
- 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)
StatsAffecting
affectCharState
in interface StatsAffecting
affectedMob
- 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.FData
addHandlers
in interface Faction.FData
listeners
- a vector of abilitiestickers
- a vector of behaviorspublic boolean requiresUpdating()
Faction.FData
requiresUpdating
in interface Faction.FData
public void executeMsg(Environmental myHost, CMMsg msg)
MsgListener
executeMsg
in interface MsgListener
myHost
- either the initiator of the event, or the host of this objectmsg
- the CMMsg that needs to be executedCMMsg
public boolean okMessage(Environmental myHost, CMMsg msg)
MsgListener
okMessage
in interface MsgListener
myHost
- 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.FData
tick
in interface Faction.FData
ticking
- the ticking objecttickID
- the id code of the tick being doneTickable
public int getCounter(java.lang.String key)
Faction.FData
getCounter
in interface Faction.FData
key
- the event idpublic void setCounter(java.lang.String key, int newValue)
Faction.FData
setCounter
in interface Faction.FData
key
- the counter key/event idnewValue
- the counter value