com.planet_ink.coffee_mud.Areas
Class StdAutoGenInstance

java.lang.Object
  extended by com.planet_ink.coffee_mud.Areas.StdArea
      extended by com.planet_ink.coffee_mud.Areas.StdAutoGenInstance
All Implemented Interfaces:
Area, AutoGenArea, Affectable, Behavable, CMObject, Contingent, Economics, Environmental, Modifiable, MsgListener, Physical, PhysicalAgent, Places, StatsAffecting, Tickable, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class StdAutoGenInstance
extends StdArea
implements AutoGenArea


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Areas.interfaces.Area
Area.AreaInstanceChild, Area.CompleteRoomEnumerator, Area.RoomComparator, Area.RoomIDComparator, Area.RoomIDEnumerator, Area.State, Area.Stats
 
Field Summary
protected  long childCheckDown
           
protected  java.lang.String filePath
           
protected  CList<Area.AreaInstanceChild> instanceChildren
           
protected  int instanceCounter
           
protected  java.lang.ref.WeakReference<Area> parentArea
           
protected  java.util.Map<java.lang.String,java.lang.String> varMap
           
 
Fields inherited from class com.planet_ink.coffee_mud.Areas.StdArea
affects, amDestroyed, archPath, atmosphere, author, basePhyStats, behaviors, blurbFlags, budget, children, climask, climateObj, currency, derivedAtmo, derivedClimate, derivedTheme, description, devalueRate, empty, emptyStats, expirationDate, flag, ignoreMask, imageName, invResetRate, itemPricingAdjustments, lastPlayerTime, me, metroRoomIDSet, miscText, myClock, name, parents, phyStats, playerLevel, prejudiceFactors, properRoomIDSet, properRooms, scripts, STDAREACODES, subOps, theme, tickStatus, xtraValues
 
Fields inherited from interface com.planet_ink.coffee_mud.Areas.interfaces.Area
FLAG_INSTANCE_CHILD, FLAG_INSTANCE_PARENT, FLAG_THIN, THEME_ALLTHEMES, THEME_BIT_NAMES, THEME_FANTASY, THEME_HEROIC, THEME_INHERIT, THEME_NAMES, THEME_PHRASE, THEME_PHRASE_EXT, THEME_SKILLONLYMASK, THEME_TECHNOLOGY, TIME_PASSIVE_LAPSE
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.Places
ALL_CLIMATE_MASK, ATMOSPHERE_INHERIT, CLIMASK_COLD, CLIMASK_DRY, CLIMASK_HOT, CLIMASK_INHERIT, CLIMASK_NORMAL, CLIMASK_WET, CLIMASK_WINDY, CLIMATE_DESCS, NUM_CLIMATES
 
Fields inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BEAMWEAPON, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
 
Constructor Summary
StdAutoGenInstance()
           
 
Method Summary
protected  java.lang.String convertToMyArea(java.lang.String roomID)
           
 void executeMsg(Environmental myHost, CMMsg msg)
          The general message event handler for the object.
 long flags()
          Return basic attributed flag about the area.
 int[] getAreaIStats()
          Returns an integer array of statistics about this area based on a snapshot generated the first time it is called.
protected  java.util.List<MOB> getAreaPlayerMOBs(Area.AreaInstanceChild rec)
           
 java.util.Map<java.lang.String,java.lang.String> getAutoGenVariables()
          Get a miscellaneous, xml-specific set of other vars to set when generating a new area
protected  int getCodeNum(java.lang.String code)
           
 java.lang.String getGeneratorXmlPath()
          Get the path to the xml file to use to generate this areas rooms
protected  Area getParentArea()
           
 int getPercentRoomsCached()
           
 java.lang.String getStat(java.lang.String code)
          An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders.
 java.lang.String[] getStatCodes()
          Returns an array of the string names of those fields which are modifiable on this object at run-time by builders.
protected  java.lang.String getStrippedRoomID(java.lang.String roomID)
           
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 boolean okMessage(Environmental myHost, CMMsg msg)
          The general message event previewer for the object.
protected  void safePlayerMOBMove(MOB M, Area A, Room returnToRoom)
           
 boolean sameAs(Environmental E)
          Whether this object instance is functionally identical to the object passed in.
 void setAutoGenVariables(java.util.Map<java.lang.String,java.lang.String> vars)
          Set a miscellaneous, xml-specific set of other vars to set when generating a new area
 void setAutoGenVariables(java.lang.String vars)
          Set a miscellaneous, xml-specific set of other vars to set when generating a new area.
 void setGeneratorXmlPath(java.lang.String path)
          Set the path to the xml file to use to generate this areas rooms
 void setStat(java.lang.String code, java.lang.String val)
          An alternative means of setting the values of those fields on this object which are modifiable at run-time by builders.
 boolean tick(Tickable ticking, int tickID)
          this is the method which is called periodically by the threading engine.
 
Methods inherited from class com.planet_ink.coffee_mud.Areas.StdArea
addBehavior, addBlurbFlag, addChild, addEffect, addMetroRoom, addMetroRoomnumber, addNonUninvokableEffect, addParent, addProperRoom, addProperRoomnumber, addScript, addSubOp, affectCharState, affectCharStats, affectPhyStats, amDestroyed, amISubOp, areaBlurbFlags, basePhyStats, behaviors, budget, buildAreaIMobStats, buildAreaIStats, buildAreaStats, canChild, canParent, cloneFix, compareTo, copyOf, delAllBehaviors, delAllEffects, delAllScripts, delBehavior, delBlurbFlag, delEffect, delMetroRoom, delMetroRoomnumber, delProperRoom, delProperRoomnumber, delScript, delSubOp, description, description, destroy, devalueRate, displayText, displayText, eachBehavior, eachEffect, eachScript, effects, expirationDate, fetchBehavior, fetchBehavior, fetchEffect, fetchEffect, fetchScript, fillInAreaRoom, fillInAreaRooms, finalAreaBudget, finalAreaDevalueRate, finalBudget, finalDevalueRate, finalIgnoreMask, finalIgnoreMask, finalInvResetRate, finalInvResetRate, finalItemPricingAdjustments, finalItemPricingAdjustments, finalPrejudiceFactors, finalPrejudiceFactors, getArchivePath, getAreaState, getAreaStats, getAtmosphere, getAtmosphereCode, getAuthorID, getBlurbFlag, getCachedRoomnumbers, getChild, getChildren, getChildrenIterator, getChildrenReverseIterator, getClimateObj, getClimateType, getClimateTypeCode, getCompleteMap, getCurrency, getFilledCompleteMap, getFilledProperMap, getMetroMap, getNewRoomID, getParent, getParents, getParentsIterator, getParentsRecurse, getParentsReverseIterator, getPlayerLevel, getProperMap, getProperRoomnumbers, getRandomMetroRoom, getRandomProperRoom, getRoom, getSaveStatIndex, getSubOpList, getTheme, getThemeCode, getTickStatus, getTimeObj, ignoreMask, image, initializeClass, inMyMetroArea, invResetRate, isChild, isChild, isGeneric, isParent, isParent, isProperlyEmpty, isRoom, isSavable, isStat, itemPricingAdjustments, L, loadAreas, maxRange, metroSize, minRange, miscTextFormat, name, Name, name, newInstance, numAllBlurbFlags, numBehaviors, numberOfProperIDedRooms, numBlurbFlags, numEffects, numScripts, phyStats, prejudiceFactors, properSize, rawImage, recoverPhyStats, removeChild, removeParent, scripts, setArchivePath, setAreaState, setAtmosphere, setAuthorID, setBasePhyStats, setBudget, setClimateObj, setClimateType, setCurrency, setDescription, setDevalueRate, setDisplayText, setExpirationDate, setIgnoreMask, setImage, setInvResetRate, setItemPricingAdjustments, setMiscText, setName, setPlayerLevel, setPrejudiceFactors, setProperRoomnumbers, setSavable, setSubOpList, setTheme, setTimeObj, subOps, text
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.planet_ink.coffee_mud.Areas.interfaces.Area
addBlurbFlag, addChild, addMetroRoom, addMetroRoomnumber, addParent, addProperRoom, addProperRoomnumber, addSubOp, amISubOp, areaBlurbFlags, canChild, canParent, delBlurbFlag, delMetroRoom, delMetroRoomnumber, delProperRoom, delProperRoomnumber, delSubOp, fillInAreaRoom, fillInAreaRooms, getArchivePath, getAreaState, getAreaStats, getAuthorID, getBlurbFlag, getCachedRoomnumbers, getChild, getChildren, getClimateObj, getCompleteMap, getCurrency, getFilledCompleteMap, getFilledProperMap, getMetroMap, getNewRoomID, getParent, getParents, getParentsRecurse, getPlayerLevel, getProperMap, getProperRoomnumbers, getRandomMetroRoom, getRandomProperRoom, getRoom, getSubOpList, getTheme, getThemeCode, getTimeObj, inMyMetroArea, isChild, isChild, isParent, isParent, isProperlyEmpty, isRoom, metroSize, numAllBlurbFlags, numberOfProperIDedRooms, numBlurbFlags, properSize, removeChild, removeParent, setArchivePath, setAreaState, setAuthorID, setClimateObj, setCurrency, setPlayerLevel, setProperRoomnumbers, setSubOpList, setTheme, setTimeObj, subOps
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Economics
budget, devalueRate, finalBudget, finalDevalueRate, finalIgnoreMask, finalInvResetRate, finalItemPricingAdjustments, finalPrejudiceFactors, ignoreMask, invResetRate, itemPricingAdjustments, prejudiceFactors, setBudget, setDevalueRate, setIgnoreMask, setInvResetRate, setItemPricingAdjustments, setPrejudiceFactors
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Places
getAtmosphere, getAtmosphereCode, getClimateType, getClimateTypeCode, setAtmosphere, setClimateType
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Physical
description, displayText, name
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Environmental
description, displayText, expirationDate, image, isGeneric, L, maxRange, minRange, miscTextFormat, Name, rawImage, setDescription, setDisplayText, setExpirationDate, setImage, setMiscText, setName, text
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
getTickStatus, name
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.StatsAffecting
affectCharState, affectCharStats, affectPhyStats
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Contingent
amDestroyed, destroy, isSavable, setSavable
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Modifiable
getSaveStatIndex, isStat
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Affectable
addEffect, addNonUninvokableEffect, basePhyStats, delAllEffects, delEffect, eachEffect, effects, fetchEffect, fetchEffect, numEffects, phyStats, recoverPhyStats, setBasePhyStats
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Behavable
addBehavior, addScript, behaviors, delAllBehaviors, delAllScripts, delBehavior, delScript, eachBehavior, eachScript, fetchBehavior, fetchBehavior, fetchScript, numBehaviors, numScripts, scripts
 

Field Detail

instanceChildren

protected CList<Area.AreaInstanceChild> instanceChildren

instanceCounter

protected volatile int instanceCounter

childCheckDown

protected long childCheckDown

parentArea

protected java.lang.ref.WeakReference<Area> parentArea

filePath

protected java.lang.String filePath

varMap

protected java.util.Map<java.lang.String,java.lang.String> varMap
Constructor Detail

StdAutoGenInstance

public StdAutoGenInstance()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, Tech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Overrides:
ID in class StdArea
Returns:
the name of this class

flags

public long flags()
Description copied from interface: Area
Return basic attributed flag about the area.

Specified by:
flags in interface Area
Overrides:
flags in class StdArea
Returns:
either 0, or a bitmap of FLAG_ constants
See Also:
Area.FLAG_THIN

getStrippedRoomID

protected java.lang.String getStrippedRoomID(java.lang.String roomID)

convertToMyArea

protected java.lang.String convertToMyArea(java.lang.String roomID)

getParentArea

protected Area getParentArea()

getPercentRoomsCached

public int getPercentRoomsCached()
Overrides:
getPercentRoomsCached in class StdArea

getAreaIStats

public int[] getAreaIStats()
Description copied from interface: Area
Returns an integer array of statistics about this area based on a snapshot generated the first time it is called. This array is the cached for future calls, but can be unloaded from resources using the UNLOAD command, to force a re-generation. The array is dereferenced using AREASTAT_ constants.

Specified by:
getAreaIStats in interface Area
Overrides:
getAreaIStats in class StdArea
Returns:
an array of integer statistics
See Also:
Area.Stats

tick

public boolean tick(Tickable ticking,
                    int tickID)
Description copied from interface: Tickable
this is the method which is called periodically by the threading engine. How often it is called depends on the parameters passed to the threadding engine when it is submitted for thread access. Typically the period is once per TIME_TICK period, but that is determined when the object is submitted to the thread engine.

Specified by:
tick in interface Tickable
Overrides:
tick in class StdArea
Parameters:
ticking - a reference to this Tickable object
tickID - the TICKID_ constant describing this periodic call, as defined in Tickable
Returns:
true always, unless this object no longer wishes to ever tick again, in which case false
See Also:
Tickable, ServiceEngine, TickableGroup

getAreaPlayerMOBs

protected java.util.List<MOB> getAreaPlayerMOBs(Area.AreaInstanceChild rec)

safePlayerMOBMove

protected void safePlayerMOBMove(MOB M,
                                 Area A,
                                 Room returnToRoom)

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
Overrides:
executeMsg in class StdArea
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
Overrides:
okMessage in class StdArea
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()

getStat

public java.lang.String getStat(java.lang.String code)
Description copied from interface: Modifiable
An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders. See getStatCodes() for possible values for the code passed to this method. Values returned are always strings, even if the field itself is numeric or a list.

Specified by:
getStat in interface Modifiable
Overrides:
getStat in class StdArea
Parameters:
code - the name of the field to read.
Returns:
the value of the field read
See Also:
Modifiable.getStatCodes()

setStat

public void setStat(java.lang.String code,
                    java.lang.String val)
Description copied from interface: Modifiable
An alternative means of setting the values of those fields on this object which are modifiable at run-time by builders. See getStatCodes() for possible values for the code passed to this method. The value passed in is always a string, even if the field itself is numeric or a list.

Specified by:
setStat in interface Modifiable
Overrides:
setStat in class StdArea
Parameters:
code - the name of the field to set
val - the value to set the field to
See Also:
Modifiable.getStatCodes()

getCodeNum

protected int getCodeNum(java.lang.String code)
Overrides:
getCodeNum in class StdArea

getStatCodes

public java.lang.String[] getStatCodes()
Description copied from interface: Modifiable
Returns an array of the string names of those fields which are modifiable on this object at run-time by builders.

Specified by:
getStatCodes in interface Modifiable
Overrides:
getStatCodes in class StdArea
Returns:
list of the fields which may be set.
See Also:
Modifiable.getStat(String), Modifiable.setStat(String, String)

sameAs

public boolean sameAs(Environmental E)
Description copied from interface: Environmental
Whether this object instance is functionally identical to the object passed in. Works by repeatedly calling getStat on both objects and comparing the values.

Specified by:
sameAs in interface Environmental
Overrides:
sameAs in class StdArea
Parameters:
E - the object to compare this one to
Returns:
whether this object is the same as the one passed in
See Also:
Modifiable.getStatCodes(), Modifiable.getStat(String)

getGeneratorXmlPath

public java.lang.String getGeneratorXmlPath()
Description copied from interface: AutoGenArea
Get the path to the xml file to use to generate this areas rooms

Specified by:
getGeneratorXmlPath in interface AutoGenArea
Returns:
the path

getAutoGenVariables

public java.util.Map<java.lang.String,java.lang.String> getAutoGenVariables()
Description copied from interface: AutoGenArea
Get a miscellaneous, xml-specific set of other vars to set when generating a new area

Specified by:
getAutoGenVariables in interface AutoGenArea
Returns:
the variable mappings

setGeneratorXmlPath

public void setGeneratorXmlPath(java.lang.String path)
Description copied from interface: AutoGenArea
Set the path to the xml file to use to generate this areas rooms

Specified by:
setGeneratorXmlPath in interface AutoGenArea
Parameters:
path - the resource path

setAutoGenVariables

public void setAutoGenVariables(java.util.Map<java.lang.String,java.lang.String> vars)
Description copied from interface: AutoGenArea
Set a miscellaneous, xml-specific set of other vars to set when generating a new area

Specified by:
setAutoGenVariables in interface AutoGenArea
Parameters:
vars - the variable mappings

setAutoGenVariables

public void setAutoGenVariables(java.lang.String vars)
Description copied from interface: AutoGenArea
Set a miscellaneous, xml-specific set of other vars to set when generating a new area. Format is VAR=VALUE VAR2="VALUE"

Specified by:
setAutoGenVariables in interface AutoGenArea
Parameters:
vars - the variable mappings