com.planet_ink.coffee_mud.Common
Class DefaultFaction.DefaultFactionData

java.lang.Object
  extended by com.planet_ink.coffee_mud.Common.DefaultFaction.DefaultFactionData
All Implemented Interfaces:
Faction.FactionData, MsgListener, StatsAffecting
Enclosing class:
DefaultFaction

public class DefaultFaction.DefaultFactionData
extends java.lang.Object
implements Faction.FactionData


Field Summary
 boolean isReset
           
 
Constructor Summary
DefaultFaction.DefaultFactionData(Faction F)
           
 
Method Summary
 void addHandlers(java.util.Vector<Ability> listeners, java.util.Vector<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.
 Faction getFaction()
          Return the parent faction for which this data stands.
 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 resetFactionData(Faction F)
          Cleans out the internal data structures of this faction to denote that a new context is entered.
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isReset

public boolean isReset
Constructor Detail

DefaultFaction.DefaultFactionData

public DefaultFaction.DefaultFactionData(Faction F)
Method Detail

resetFactionData

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

Specified by:
resetFactionData in interface Faction.FactionData
Parameters:
F - the faction to which this data belongs.

value

public int value()
Description copied from interface: Faction.FactionData
Returns the actual value that the holding object has in this faction.

Specified by:
value in interface Faction.FactionData
Returns:
the faction value

getFaction

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

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

setValue

public void setValue(int newValue)
Description copied from interface: Faction.FactionData
Sets the actual value that the holding object has in this faction.

Specified by:
setValue in interface Faction.FactionData
Parameters:
newValue - the faction value

affectPhyStats

public void affectPhyStats(Physical affected,
                           PhyStats affectableStats)
Description copied from interface: StatsAffecting
This method is called by the recoverPhyStats() method on other Environmental objects. It is used to transform the Environmental basePhyStats() object into a finished phyStats() object, both of which are objects implementing the PhyStats interface. See those methods for more information.

Specified by:
affectPhyStats in interface StatsAffecting
Parameters:
affected - the host of the PhyStats object being affected
affectableStats - the particular PhyStats object being affected
See Also:
PhyStats, Environmental, Affectable.basePhyStats(), Affectable.phyStats(), Affectable.recoverPhyStats()

affectCharStats

public void affectCharStats(MOB affectedMob,
                            CharStats affectableStats)
Description copied from interface: StatsAffecting
This method is called by the recoverCharStats() method on other MOB objects. It is used to transform the MOB baseCharStats() object into a finished charStats() object, both of which are objects implementing the CharStats interface. See those methods for more information.

Specified by:
affectCharStats in interface StatsAffecting
Parameters:
affectedMob - the host of the CharStats object being affected
affectableStats - the particular CharStats object being affected
See Also:
CharStats, MOB, MOB.baseCharStats(), MOB.charStats(), MOB.recoverCharStats()

affectCharState

public void affectCharState(MOB affectedMob,
                            CharState affectableMaxState)
Description copied from interface: StatsAffecting
This method is called by the recoverCharState() method on other MOB objects. It is used to transform the MOB baseCharState() object into a finished charState() object, both of which are objects implementing the CharState interface. See those methods for more information.

Specified by:
affectCharState in interface StatsAffecting
Parameters:
affectedMob - the host of the CharState object being affected
affectableMaxState - the particular CharState object being affected
See Also:
CharState, MOB, MOB.baseState(), MOB.curState(), MOB.recoverMaxState()

addHandlers

public void addHandlers(java.util.Vector<Ability> listeners,
                        java.util.Vector<Behavior> tickers)
Description copied from interface: Faction.FactionData
Clears and re-adds all the necessary message listeners and tickers and stat affecting objects for this faction data reference.

Specified by:
addHandlers in interface Faction.FactionData
Parameters:
listeners - a vector of abilities
tickers - a vector of behaviors

requiresUpdating

public boolean requiresUpdating()
Description copied from interface: Faction.FactionData
Returns true if this object requires updating by the parent faction for some reason.

Specified by:
requiresUpdating in interface Faction.FactionData
Returns:
true if an update is necessary, false otherwise.

executeMsg

public void executeMsg(Environmental myHost,
                       CMMsg msg)
Description copied from interface: MsgListener
The general message event handler for the object. Messages passed herein may not necessarily be FOR this object, or from it, but will almost always represent events happening in the same room. The messages have already been through an approval process, so this method is called only to affect the final execution of the meaning of the message. Every game event goes through these methods.

Specified by:
executeMsg in interface MsgListener
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that needs to be executed
See Also:
CMMsg

okMessage

public boolean okMessage(Environmental myHost,
                         CMMsg msg)
Description copied from interface: MsgListener
The general message event previewer for the object. Messages passed herein are in a pending state, and may be safely modified or rejected without fear that they might be in the middle of being executed. Messages passed herein may not necessarily be FOR or FROM this object, but will almost always represent events which want to happen in the same rom. This method should always always return true UNLESS this message needs to be canceled, in which case it is necessary to tell the mob initiating the event (CMMsg.source()) why it is being cancelled. Every game event goes through these methods.

Specified by:
okMessage in interface MsgListener
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that wants to be executed
Returns:
whether this message is allowed to execute
See Also:
CMMsg, CMMsg.source()

tick

public boolean tick(Tickable ticking,
                    int tickID)
Description copied from interface: Faction.FactionData
A mirror implementation of Tickable

Specified by:
tick in interface Faction.FactionData
Parameters:
ticking - the ticking object
tickID - the id code of the tick being done
See Also:
Tickable