com.planet_ink.coffee_mud.core.interfaces
Interface Affectable

All Known Subinterfaces:
GridLocale, Room
All Known Implementing Classes:
CaveMaze, CaveRoom, CaveSurface, CityStreet, ClimbableLedge, ClimbableSurface, Desert, DesertGrid, DesertMaze, DesertThinGrid, EndlessOcean, EndlessSky, EndlessThinOcean, EndlessThinSky, FrozenMountains, FrozenPlains, GreatLake, GreatThinLake, Hills, HillsGrid, HillsThinGrid, HotRoom, IceRoom, IndoorInTheAir, IndoorShallowWater, IndoorUnderWater, IndoorWaterSurface, InTheAir, Jungle, JungleGrid, JungleThinGrid, LargeCaveRoom, LargeStoneRoom, LargeWoodRoom, MagicFreeRoom, MagicShelter, MetalRoom, Mountains, MountainsGrid, MountainsMaze, MountainsThinGrid, MountainSurface, MountainSurfaceGrid, MountainSurfaceThinGrid, OverTheLedge, Plains, PlainsGrid, PlainsThinGrid, Road, RoadGrid, RoadThinGrid, SaltWaterSurface, SaltWaterThinSurface, SewerMaze, SewerRoom, ShallowWater, Shore, SpacePort, StdGrid, StdMaze, StdRoom, StdThinGrid, StoneGrid, StoneMaze, StoneRoom, StoneThinGrid, Swamp, SwampGrid, SwampThinGrid, ThinRoom, TreeSurface, UnderSaltWater, UnderSaltWaterGrid, UnderSaltWaterMaze, UnderSaltWaterThinGrid, UnderWater, UnderWaterGrid, UnderWaterMaze, UnderWaterThinGrid, WaterSurface, WaterThinSurface, WetCaveMaze, WetCaveRoom, WoodRoom, WoodRoomGrid, WoodRoomMaze, WoodRoomThinGrid, Woods, WoodsGrid, WoodsMaze, WoodsThinGrid

public interface Affectable

Something that can be affected, and has environmental stats that can be affected as well.


Method Summary
 void addEffect(Ability to)
          Add a new effect to this object, whether permanent or temporary.
 void addNonUninvokableEffect(Ability to)
          Same as addEffect(Ability), but will set the Ability object as never being able to be uninvoked.
 EnvStats baseEnvStats()
          Object containing a set of base, unmodified, mostly numeric fields.
 void delEffect(Ability to)
          Delete an effect from this object, whether permanent or temporary.
 EnvStats envStats()
          Object containing a set of current, modified, usable, mostly numeric fields.
 Ability fetchEffect(int index)
          Returns an ability object listed as an effect on this object.
 Ability fetchEffect(java.lang.String ID)
          Returns an ability object listed as an effect on this object.
 int numEffects()
          Returns the number of ability objects listed as effects on this object.
 void recoverEnvStats()
          This method copies the baseEnvStats() object into the envStats() object, then makes repeated calls to all surrounding objects with affectEnvStats(Environmental,EnvStats) method.
 void setBaseEnvStats(EnvStats newBaseEnvStats)
          Re-sets the object containing a set of base, unmodified, mostly numeric fields.
 

Method Detail

baseEnvStats

EnvStats baseEnvStats()
Object containing a set of base, unmodified, mostly numeric fields. The values on the fields in this object will be as they were set by the builder. This object is used as a basis for the recoverEnvStats() method. See the EnvStats interface for information on the fields herein.

Returns:
a set of state fields
See Also:
Environmental.envStats(), Environmental.recoverEnvStats(), EnvStats

setBaseEnvStats

void setBaseEnvStats(EnvStats newBaseEnvStats)
Re-sets the object containing a set of base, unmodified, mostly numeric fields. The values on the fields in this object will be as they were set by the builder. This object is used as a basis for the recoverEnvStats() method. See the EnvStats interface for information on the fields herein. This method is rarely called -- the fields therein are usually set using setter methods from the EnvStats interface on the object itself.

Parameters:
newBaseEnvStats - a set of state fields
See Also:
Environmental.envStats(), Environmental.recoverEnvStats(), EnvStats

envStats

EnvStats envStats()
Object containing a set of current, modified, usable, mostly numeric fields. This object is based on the object from baseEnvStats() and then updated and modified by the recoverEnvStats() method. See the EnvStats interface for information on the fields herein.

Returns:
the current set of state fields
See Also:
Environmental.baseEnvStats(), Environmental.recoverEnvStats(), EnvStats

recoverEnvStats

void recoverEnvStats()
This method copies the baseEnvStats() object into the envStats() object, then makes repeated calls to all surrounding objects with affectEnvStats(Environmental,EnvStats) method. Surrounding objects include the room where the object is located, the Ability objects in the Effects list, the Behaviors in the behaviors list, and race/charclass/area if applicable. Those methods will then make all necessary adjustments to the values in the new envStats() object. When it returns, envStats() will have a totally updated object. This method must be called in code whenever the object is placed on the map, or when anything changes in its environment, such as location, effects, or other states.

See Also:
Environmental.baseEnvStats(), Environmental.envStats(), Environmental.addEffect(Ability), Behavable.addBehavior(Behavior), EnvStats

addEffect

void addEffect(Ability to)
Add a new effect to this object, whether permanent or temporary. After calling this method, recoverEnvStats() should be called next in case this ability object modifies the stats. An Ability with a given ID() can only be added once per object.

Parameters:
to - The ability object to add as an effect.
See Also:
Ability, Environmental.recoverEnvStats()

addNonUninvokableEffect

void addNonUninvokableEffect(Ability to)
Same as addEffect(Ability), but will set the Ability object as never being able to be uninvoked. recoverEnvStats() method should be called next. An Ability with a given ID() can only be added once per object.

Parameters:
to - The ability object to add as an effect.
See Also:
Ability, Environmental.recoverEnvStats()

delEffect

void delEffect(Ability to)
Delete an effect from this object, whether permanent or temporary. After calling this method, recoverEnvStats() should be called next in case this ability object modified the stats.

Parameters:
to - The ability object to remove as an effect on this object
See Also:
Ability, Environmental.recoverEnvStats()

numEffects

int numEffects()
Returns the number of ability objects listed as effects on this object.

Returns:
the number of effects this object has
See Also:
Ability

fetchEffect

Ability fetchEffect(int index)
Returns an ability object listed as an effect on this object. May return null even if the index is correct to mark a race condition.

Parameters:
index - which object to return
Returns:
the ability object effecting this object
See Also:
Ability, Environmental.numEffects()

fetchEffect

Ability fetchEffect(java.lang.String ID)
Returns an ability object listed as an effect on this object. The object will be the one with the same ID() string as passed in.

Returns:
the ability object effecting this object
See Also:
Ability, CMObject.ID()