com.planet_ink.coffee_mud.Locales
Class StdRoom

java.lang.Object
  extended by com.planet_ink.coffee_mud.Locales.StdRoom
All Implemented Interfaces:
Affectable, Behavable, CMObject, Contingent, Environmental, ItemCollection, ItemPossessor, Modifiable, MsgListener, Physical, PhysicalAgent, Places, StatsAffecting, Tickable, Room, java.lang.Cloneable, java.lang.Comparable<CMObject>
Direct Known Subclasses:
CaveRoom, CityStreet, ClimbableSurface, Desert, Hills, HotRoom, IcePlains, IceRoom, IndoorInTheAir, IndoorUnderWater, InTheAir, Jungle, MagicFreeRoom, MagicShelter, MetalRoom, Mountains, Plains, Road, SewerRoom, ShallowWater, Shore, SpacePort, StdGrid, StdThinGrid, StoneRoom, Swamp, UnderWater, WaterSurface, WoodenDeck, WoodRoom, Woods

public class StdRoom
extends java.lang.Object
implements Room


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Locales.interfaces.Room
Room.VariationCode
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.core.interfaces.ItemPossessor
ItemPossessor.Expire, ItemPossessor.Find, ItemPossessor.Move
 
Field Summary
protected  EachApplicable.ApplyAffectPhyStats affectPhyStats
           
protected  SVector<Ability> affects
           
protected  boolean amDestroyed
           
protected  int atmosphere
           
protected  PhyStats basePhyStats
           
protected  SVector<Behavior> behaviors
           
protected  java.lang.String cachedImageName
           
protected  int climask
           
protected  short combatTurnMobIndex
           
protected  SVector<Item> contents
           
protected  java.lang.Object description
           
protected  java.lang.String displayText
           
protected  Room[] doors
           
protected  Exit[] exits
           
protected  long expirationDate
           
protected  GridLocale gridParent
           
protected  SVector<MOB> inhabitants
           
protected  long lastResourceTime
           
protected  Room me
           
protected  boolean mobility
           
protected  Area myArea
           
protected  java.lang.String myID
           
protected  int myResource
           
protected  java.lang.String name
           
protected  PhyStats phyStats
           
protected  java.lang.String rawImageName
           
protected  short[] roomRecoverMarker
           
protected  SVector<ScriptingEngine> scripts
           
protected  boolean skyedYet
           
protected static java.lang.String[] STDCODES
           
protected  int tickStatus
           
protected  java.lang.String[] xtraValues
           
 
Fields inherited from interface com.planet_ink.coffee_mud.Locales.interfaces.Room
DOMAIN_INDOOR_MAP, DOMAIN_INDOORS_AIR, DOMAIN_INDOORS_CAVE, DOMAIN_INDOORS_DESCS, DOMAIN_INDOORS_MAGIC, DOMAIN_INDOORS_METAL, DOMAIN_INDOORS_STONE, DOMAIN_INDOORS_UNDERWATER, DOMAIN_INDOORS_WATERSURFACE, DOMAIN_INDOORS_WOOD, DOMAIN_OUTDOOR_DESCS, DOMAIN_OUTDOOR_MAP, DOMAIN_OUTDOORS_AIR, DOMAIN_OUTDOORS_CITY, DOMAIN_OUTDOORS_DESERT, DOMAIN_OUTDOORS_HILLS, DOMAIN_OUTDOORS_JUNGLE, DOMAIN_OUTDOORS_MOUNTAINS, DOMAIN_OUTDOORS_PLAINS, DOMAIN_OUTDOORS_ROCKS, DOMAIN_OUTDOORS_SEAPORT, DOMAIN_OUTDOORS_SPACEPORT, DOMAIN_OUTDOORS_SWAMP, DOMAIN_OUTDOORS_UNDERWATER, DOMAIN_OUTDOORS_WATERSURFACE, DOMAIN_OUTDOORS_WOODS, FILTER_ROOMONLY, INDOORS
 
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
StdRoom()
           
 
Method Summary
 void addBehavior(Behavior to)
          Manipulation of Behavior objects, which includes movement, speech, spellcasting, etc, etc.
 void addEffect(Ability to)
          Add a new effect to this object, whether permanent or temporary.
 void addInhabitant(MOB mob)
          Adds the given mob to this room as an inhabitant.
 void addItem(Item item)
          Adds a new item to its possessor.
 void addItem(Item item, ItemPossessor.Expire expire)
          Adds a new item to its possessor, with an expiration code.
 void addNonUninvokableEffect(Ability to)
          Same as addEffect(Ability), but will set the Ability object as never being able to be uninvoked.
 void addScript(ScriptingEngine S)
          Manipulation of the scripts list
 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.
 boolean amDestroyed()
          Whether the destroy() method has been previousy called on this object.
 PhyStats basePhyStats()
          Object containing a set of base, unmodified, mostly numeric fields.
protected  int baseThirst()
           
 java.util.Enumeration<Behavior> behaviors()
          Returns an enumerator of all the behaviors on this object.
 void bringMobHere(MOB mob, boolean andFollowers)
          A workhorse method that removes the given mob (and anything they are riding or being ridden by, recursively, and optionally any followers, and their riders, recursively) and places them all in this room.
 void clearSky()
          If this room has attached temporary rooms, such as a sky in an outdoor room, or underwater rooms in the ocean, this method will empty all of those rooms of their content, and then destroy those rooms.
protected  void cloneFix(Room R)
           
 int compareTo(CMObject o)
           
 CMObject copyOf()
          Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.
 void delAllBehaviors()
          Removes all behaviors from this object.
 void delAllEffects(boolean unInvoke)
          Optionally uninvokes and then certainly removes all effects from this object.
 void delAllInhabitants(boolean destroy)
          Removes all the mobs from this room as inhabitants and optionally destroys the mob objects as well.
 void delAllItems(boolean destroy)
          Removes all items from this collection
 void delAllScripts()
          Removes all executing scripts from this object.
 void delBehavior(Behavior to)
          Delete a behavior from this object.
 void delEffect(Ability to)
          Delete an effect from this object, whether permanent or temporary.
 void delInhabitant(MOB mob)
          Removes the given mob from this room as an inhabitant.
 void delItem(Item item)
          Removes the item from this possessor.
 void delScript(ScriptingEngine S)
          Remove a running script from this object.
 java.lang.String description()
          The basic description of this object, as shown when the item is directly LOOKed at.
 java.lang.String description(MOB mob)
          Returns the description, but as seen by the given viewer.
 void destroy()
          Utterly and permanently destroy this object, not only removing it from the map, but causing this object to be collected as garbage by Java.
 java.lang.String displayText()
          Gets the raw string used to show what this object looks like in the room.
 java.lang.String displayText(MOB mob)
          Returns the displayText, but as seen by the given viewer.
 int domainType()
          Returns the domain-code for this room, which tells you something about its physical makeup, such as whether it is outdoor, if it's in the woods or surrounded by stone, that sort of thing.
 void eachBehavior(EachApplicable<Behavior> applier)
          Applies the given code to each behavior on this object
 void eachEffect(EachApplicable<Ability> applier)
          Applies the given code to each effect on this object
 void eachInhabitant(EachApplicable<MOB> applier)
          Applies the given applier Java code to each mob in this room
 void eachItem(EachApplicable<Item> applier)
          Applies the given code to each item in this collection
 void eachScript(EachApplicable<ScriptingEngine> applier)
          Applies the given code to each scripting engine on this object
 java.util.Enumeration<Ability> effects()
          Returns an enumerator of abilities listed as effects on this object.
 void executeMsg(Environmental myHost, CMMsg msg)
          The general message event handler for the object.
 long expirationDate()
          If this object expires, it should have a timestamp saying when it expires, in real time.
 Behavior fetchBehavior(int index)
          Returns a behavior object on this object.
 Behavior fetchBehavior(java.lang.String ID)
          Returns a behavior object listed on this object.
 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.
 Exit fetchExit(java.lang.String itemID)
          Returns the exit in this room with the given name or display text or in the given direction.
 PhysicalAgent fetchFromMOBRoomFavorsItems(MOB mob, Item goodLocation, java.lang.String thingName, Filterer<Environmental> filter)
          Searches the given mob and this room for a mob, item, or exit that matches the given search string, favoring the mobs inventory over other types of objects and items generally.
 PhysicalAgent fetchFromMOBRoomFavorsMOBs(MOB mob, Item goodLocation, java.lang.String thingName, Filterer<Environmental> filter)
          Searches the given mob and this room for a mob, item, or exit that matches the given search string, favoring the room mobs over other types of objects.
 PhysicalAgent fetchFromMOBRoomItemExit(MOB mob, Item goodLocation, java.lang.String thingName, Filterer<Environmental> filter)
          Searches the given mob and this room for a mob, item, or exit that matches the given search string, favoring the mobs inventory over other types of objects.
 PhysicalAgent fetchFromRoomFavorExits(java.lang.String thingName)
          Searches the room for a mob, item, or exit that matches the given search string, favoring Exits over other types of objects.
 PhysicalAgent fetchFromRoomFavorItems(Item goodLocation, java.lang.String thingName)
          Searches the room for a mob, item, or exit that matches the given search string, favoring Items over other types of objects.
 PhysicalAgent fetchFromRoomFavorMOBs(Item goodLocation, java.lang.String thingName)
          Searches the room for a mob, item, or exit that matches the given search string, favoring Mobs over other types of objects.
 MOB fetchInhabitant(int i)
          Returns the inhabitant mob in this room at the given index, or null if there are none at that index.
 MOB fetchInhabitant(java.lang.String inhabitantID)
          Searches the inhabitants of this room for a mob with the given ID(), name, or display name.
 MOB fetchInhabitantExact(java.lang.String inhabitantID)
          Searches the inhabitants of this room for a mob with the given ID(), name, or display name.
 java.util.List<MOB> fetchInhabitants(java.lang.String inhabitantID)
          Searches the inhabitants of this room for mobs with the given ID(), name, or display name.
 MOB fetchRandomInhabitant()
          Returns a random inhabitant mob in this room, or null if there are none.
 ScriptingEngine fetchScript(int x)
          Retrieve one of the enumerated scripts running on this object
 Item findItem(Item goodLocation, java.lang.String itemID)
          Returns the item in the given container that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller name is found).
 Item findItem(java.lang.String itemID)
          Returns the item in this possessor that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller name is found).
 java.util.List<Item> findItems(Item goodLocation, java.lang.String itemID)
          Returns all items in the given container that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller names are found).
 java.util.List<Item> findItems(java.lang.String itemID)
          Returns all items in this possessor that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller names are found).
 Area getArea()
          Returns the Area to which this room belongs.
 int getAtmosphere()
          Returns the resource that represents the atmosphere of this area.
 int getAtmosphereCode()
          Returns the resource (or -1) that represents the atmosphere of this area.
 int getClimateType()
          Returns a bitmap of the climate for this place.
 int getClimateTypeCode()
          Returns a bitmap of climate flags for this area which will be used to influence the weather for the area in addition to season and other factors.
protected  int getCodeNum(java.lang.String code)
           
 int getCombatTurnMobIndex()
          Returns the index number which represents which mob's "turn" it is in combat.
 java.lang.String getContextName(Environmental E)
          Generates a specific search-string name for the given object in this room.
 Exit getExitInDir(int direction)
          Returns the Exit in this room, in the given direction.
 GridLocale getGridParent()
          If this room is a grid-child room, this method is called to return the identity of its parent gridlocale room.
 Item getItem(int i)
          Returns the item at the given index, regardless of container status, visibility, or other modifiers.
 boolean getMobility()
          Gets whether any mobs in this room may, in fact, leave it.
 Exit getPairedExit(int direction)
          Returns the Exit opposite this one, in the Room in the given direction, but only if the two exits exist, and have the same Door status.
 Item getRandomItem()
          Returns a random item in this collection, or null
 Exit getRawExit(int dir)
          Returns the raw unresolved exit found in this room in the given direction.
 Exit getReverseExit(int direction)
          Returns the Exit opposite this one, in the Room in the given direction.
 Room getRoomInDir(int direction)
          Returns the room in the given direction from this room which, depending on the exit, may be traveled to.
 int getSaveStatIndex()
          Returns the index into the stat codes array where extra savable fields begins.
 java.util.List<Room> getSky()
          If this room requires attached temporary rooms, such as a sky in an outdoor room, or underwater rooms in the ocean, this method will return any existing one, or an empty list if none exist yet.
 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.
 int getTickStatus()
          A coded status for this object during the period where its tick method is being called.
 void giveASky(int depth)
          If this room requires attached temporary rooms, such as a sky in an outdoor room, or underwater rooms in the ocean, this method will create those rooms at the given left of depth.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 java.lang.String image()
          Returns the fully qualified and determined name of the image file displayed for this object when MXP is used.
 java.util.Enumeration<MOB> inhabitants()
          Returns an enumeration of all the inhabitants of this room.
 void initializeClass()
          Called ONCE after all objects are loaded, but before the map is read in during initialization.
protected  void insertItemUpTop(Item item)
           
 boolean isContent(Item item)
          Returns whether the given item is in this possessors list.
 boolean isGeneric()
          Whether the fields of this item are set in code, or set by builders.
 boolean isHere(Environmental E)
          Returns whether the given object either IS this room, or is IN this room.
 boolean isInhabitant(MOB mob)
          Returns whether the given mob is an inhabitant of this room.
 boolean isSavable()
          Whether, if this object is in a room, whether it is appropriate to save this object to the database as a permanent feature of its container.
 boolean isStat(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.util.Enumeration<Item> items()
          An enumeration of all the items at this possessor.
 java.lang.String L(java.lang.String str, java.lang.String... xs)
          Localize an internal string -- shortcut.
 int maxRange()
          Returns the maximum range for ranged weapons in this room.
 int minRange()
          the minimum range of this object, if applicable.
 java.lang.String miscTextFormat()
          Unimplemented as of yet, but will hold a string telling the system what the proper format of any miscText data.
 void moveItemTo(Item container)
          Intelligently removes an item from its current location and moves it to this possessor, managing any container contents.
 void moveItemTo(Item item, ItemPossessor.Expire expire, ItemPossessor.Move... moveFlags)
          Intelligently removes an item from its current location and moves it to this possessor, managing any container contents, and possibly followers/riders if the item is a cart.
 int myResource()
          Returns the full resource code for the current gatherable resource in this room.
 java.lang.String name()
          The nice displayable name of this instance of this object
 java.lang.String Name()
          The raw unmodified name of this object as stored in the database.
 java.lang.String name(MOB viewerMob)
          Returns the name, but as seen by the given viewer.
 CMObject newInstance()
          Returns a new instance of this class.
 int numBehaviors()
          The number of behaviors this object has.
 int numEffects()
          Returns the number of ability objects listed as effects on this object.
 int numInhabitants()
          Returns the number of all the inhabitants of this room.
 int numItems()
          Returns the total number of items at this possessor, regardless of container status.
 int numPCInhabitants()
          Returns the number of player/PC inhabitants of this room.
 int numScripts()
          Return the number of scripts running on this object
 boolean okMessage(Environmental myHost, CMMsg msg)
          The general message event previewer for the object.
protected  java.lang.String parseVaries(MOB mob, java.lang.String text)
           
protected  java.lang.String parseVariesCodes(MOB mob, Area A, java.lang.String text)
           
 PhyStats phyStats()
          Object containing a set of current, modified, usable, mostly numeric fields.
 int pointsPerMove()
          Returns the number of movement points to move through this room.
 Room prepareRoomInDir(Room R, int direction)
          This method is called by an adjoining room to resolve this room to its final object.
 Room[] rawDoors()
          Returns array of the Raw room objects that this room connects to via exits.
 java.lang.String rawImage()
          Returns the raw name of the image file to display for this object when MXP is used.
 void recoverPhyStats()
          This method copies the basePhyStats() object into the phyStats() object, then makes repeated calls to all surrounding objects with affectPhyStats(Environmental,PhyStats) method.
 void recoverRoomStats()
          Causes the room stat affects to be reevaluated, as well as the stat affects of every inhabitant, exit, and item in the room.
 java.util.List<java.lang.Integer> resourceChoices()
          Returns a list of all resource codes for potentially gatherable resources in this room.
 java.lang.String roomID()
          The room ID is the "address" of the room on the world map.
 boolean sameAs(Environmental E)
          Whether this object instance is functionally identical to the object passed in.
 java.util.Enumeration<ScriptingEngine> scripts()
          Returns an enumerator of all the scripts on this object.
 void send(MOB source, CMMsg msg)
          Sends the message to the given source, then to the room, and then handles any trailing messages.
protected  void sendAndExec(MOB source, CMMsg msg)
           
 void sendOthers(MOB source, CMMsg msg)
          Sends the message to the room, skipping the given source, and then handles any trailing messages.
protected  void sendTrailermsgs(MOB source, CMMsg msg, int depth, boolean includeSource)
           
 void setArea(Area newArea)
          Sets the Area to which this room should belong, which also notifies the Area object that this room is a new member, and removing itself from any previous Area it belonged to in the past.
 void setAtmosphere(int resourceCode)
          Sets the resource (or -1) that represents the atmosphere of this area.
 void setBasePhyStats(PhyStats newStats)
          Re-sets the object containing a set of base, unmodified, mostly numeric fields.
 void setClimateType(int climask)
          Returns a bitmap of climate flags for this area which will be used to influence the weather for the area in addition to season and other factors.
 void setCombatTurnMobIndex(int index)
          Sets the index number which represents which mob's "turn" it is in combat.
 void setDescription(java.lang.String newDescription)
          Sets the basic description of this object, as shown when the item is directly LOOKed at.
 void setDisplayText(java.lang.String newDisplayText)
          Sets the raw string used to show what this object looks like in the room.
 void setExpirationDate(long time)
          If this object expires, it should have a timestamp saying when it expires, in real time.
 void setGridParent(GridLocale room)
          If this room is a grid-child room, this method is called to notify this child as to the identity of its parent gridlocale room.
 void setImage(java.lang.String newImage)
          Sets the raw name of the image file to display for this object when MXP is used.
 void setMiscText(java.lang.String newMiscText)
          For objects which have false for their isGeneric method, this is used to set any internally coded strings to change the nature or behavior of the object.
 void setName(java.lang.String newName)
          Sets the raw unmodified name of this object as stored in the database.
 void setRawExit(int direction, Exit to)
          Sets the Exit object found in this room in the given direction.
 void setResource(int resourceCode)
          Sets the full resource code for the current gatherable resource in this room.
 void setRoomID(java.lang.String newID)
          Changes the room ID of this room.
 void setSavable(boolean truefalse)
          Sets whether this object can be saved as a permanent aspect of its host.
 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 show(MOB source, Environmental target, Environmental tool, int srcCode, int tarCode, int othCode, java.lang.String allMessage)
          Creates and configures a CMMsg object for use in the room, then, if the message is not flagged for ALWAYS approval, this method submits it for approval by calling okMessage on the room, and if it is approved, calls send to send the message.
 boolean show(MOB source, Environmental target, Environmental tool, int allCode, java.lang.String allMessage)
          Creates and configures a CMMsg object for use in the room, then, if the message is not flagged for ALWAYS approval, this method submits it for approval by calling okMessage on the room, and if it is approved, calls send to send the message.
 boolean show(MOB source, Environmental target, Environmental tool, int srcCode, java.lang.String srcMessage, int tarCode, java.lang.String tarMessage, int othCode, java.lang.String othMessage)
          Creates and configures a CMMsg object for use in the room, then, if the message is not flagged for ALWAYS approval, this method submits it for approval by calling okMessage on the room, and if it is approved, calls send to send the message.
 boolean show(MOB source, Environmental target, Environmental tool, int allCode, java.lang.String srcMessage, java.lang.String tarMessage, java.lang.String othMessage)
          Creates and configures a CMMsg object for use in the room, then, if the message is not flagged for ALWAYS approval, this method submits it for approval by calling okMessage on the room, and if it is approved, calls send to send the message.
 boolean show(MOB source, Environmental target, int allCode, java.lang.String allMessage)
          Creates and configures a CMMsg object for use in the room, then, if the message is not flagged for ALWAYS approval, this method submits it for approval by calling okMessage on the room, and if it is approved, calls send to send the message.
 void showHappens(int allCode, Environmental like, java.lang.String allMessage)
          Constructs a message with the given allCode as the source, target, and others message code, and the given allMessage as the source, target, and others message, and using a temporary fake agent/source for the message whose name is the same as the given "like" Environmental, immediately sends the message without previewing it.
 void showHappens(int allCode, java.lang.String allMessage)
          Constructs a message with the given allCode as the source, target, and others message code, and the given allMessage as the source, target, and others message, and using a temporary fake agent/source for the message, immediately sends the message without previewing it.
 boolean showOthers(MOB source, Environmental target, Environmental tool, int allCode, java.lang.String allMessage)
          Creates and configures a CMMsg object for use in the room, then, if the message is not flagged for ALWAYS approval, this method submits it for approval by calling okMessage on the room, and if it is approved, calls sendOthers to send the message.
 boolean showOthers(MOB source, Environmental target, int allCode, java.lang.String allMessage)
          Creates and configures a CMMsg object for use in the room, then, if the message is not flagged for ALWAYS approval, this method submits it for approval by calling okMessage on the room, and if it is approved, calls sendOthers to send the message.
 boolean showSource(MOB source, Environmental target, Environmental tool, int allCode, java.lang.String allMessage)
          Creates and configures a CMMsg object for use in the room, then, if the message is not flagged for ALWAYS approval, this method submits it for approval by calling okMessage on the room, and if it is approved, calls executeMsg on the given source mob.
 boolean showSource(MOB source, Environmental target, int allCode, java.lang.String allMessage)
          Creates and configures a CMMsg object for use in the room, then, if the message is not flagged for ALWAYS approval, this method submits it for approval by calling okMessage on the room, and if it is approved, calls executeMsg on the given source mob.
 void startItemRejuv()
          When a room is created, this method is called to inspect the item contents for any rejuvinating items and, if found, causes them to start being tracked.
 java.lang.String text()
          For objects which have false for their isGeneric method, this is used to set any internally coded strings to change the nature or behavior of the object.
 int thirstPerRound()
          Returns the amount of thirst generated by moving through this room.
 boolean tick(Tickable ticking, int tickID)
          this is the method which is called periodically by the threading engine.
 void toggleMobility(boolean onoff)
          Sets or clears whether any mobs in this room may, in fact, leave it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myID

protected java.lang.String myID

name

protected java.lang.String name

displayText

protected java.lang.String displayText

rawImageName

protected java.lang.String rawImageName

cachedImageName

protected java.lang.String cachedImageName

description

protected java.lang.Object description

myArea

protected Area myArea

phyStats

protected PhyStats phyStats

basePhyStats

protected PhyStats basePhyStats

exits

protected Exit[] exits

doors

protected Room[] doors

xtraValues

protected java.lang.String[] xtraValues

mobility

protected boolean mobility

gridParent

protected GridLocale gridParent

tickStatus

protected int tickStatus

expirationDate

protected long expirationDate

atmosphere

protected int atmosphere

climask

protected int climask

myResource

protected int myResource

lastResourceTime

protected long lastResourceTime

amDestroyed

protected boolean amDestroyed

skyedYet

protected boolean skyedYet

combatTurnMobIndex

protected volatile short combatTurnMobIndex

roomRecoverMarker

protected final short[] roomRecoverMarker

affects

protected SVector<Ability> affects

behaviors

protected SVector<Behavior> behaviors

scripts

protected SVector<ScriptingEngine> scripts

inhabitants

protected SVector<MOB> inhabitants

contents

protected SVector<Item> contents

me

protected Room me

affectPhyStats

protected EachApplicable.ApplyAffectPhyStats affectPhyStats

STDCODES

protected static final java.lang.String[] STDCODES
Constructor Detail

StdRoom

public StdRoom()
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
Returns:
the name of this class

initializeClass

public void initializeClass()
Description copied from interface: CMObject
Called ONCE after all objects are loaded, but before the map is read in during initialization.

Specified by:
initializeClass in interface CMObject

newInstance

public CMObject newInstance()
Description copied from interface: CMObject
Returns a new instance of this class.

Specified by:
newInstance in interface CMObject
Returns:
a new instance of this class

roomID

public java.lang.String roomID()
Description copied from interface: Room
The room ID is the "address" of the room on the world map. It is generally of the format [AREA NAME]#[ID NUMBER] for primary rooms. All other rooms, such as GridLocale children, or temporary or contingent rooms, have an empty string "" room ID. GridLocale children (@see GridLocale) in particular may have an address, if the GridLocale is, itself, a primary room, but still have an empty roomID. This is not related to the ID() method.

Specified by:
roomID in interface Room
Returns:
room ID is the "address" of the primary room on the world map
See Also:
Room.setRoomID(String)

Name

public java.lang.String Name()
Description copied from interface: Environmental
The raw unmodified name of this object as stored in the database. This is the name set by builders and used as a basis for the name() method.

Specified by:
Name in interface Environmental
Returns:
the raw base name of this object on the map.
See Also:
Tickable.name()

setName

public void setName(java.lang.String newName)
Description copied from interface: Environmental
Sets the raw unmodified name of this object as stored in the database. This is the name set by builders and used as a basis for the name() method.

Specified by:
setName in interface Environmental
Parameters:
newName - the raw base name of this object on the map.
See Also:
Environmental.Name()

name

public java.lang.String name()
Description copied from interface: Tickable
The nice displayable name of this instance of this object

Specified by:
name in interface CMObject
Specified by:
name in interface Tickable
Returns:
the displayable name of this object instance
See Also:
Environmental.Name()

name

public java.lang.String name(MOB viewerMob)
Description copied from interface: Physical
Returns the name, but as seen by the given viewer. Can differ from name() without being saved to the DB.

Specified by:
name in interface Physical
Parameters:
viewerMob - the mob viewing the physical thing
Returns:
the name as seen by the viewer
See Also:
Tickable.name()

getAtmosphereCode

public int getAtmosphereCode()
Description copied from interface: Places
Returns the resource (or -1) that represents the atmosphere of this area. Since most rooms inherit their atmosphere from the area, this is important. Return -1 to have this area inherit its atmosphere from parents (which would ultimately go back to RESOURCE_AIR)

Specified by:
getAtmosphereCode in interface Places
Returns:
the RawMaterial resource, or -1
See Also:
RawMaterial.MATERIAL_GAS

setAtmosphere

public void setAtmosphere(int resourceCode)
Description copied from interface: Places
Sets the resource (or -1) that represents the atmosphere of this area. Since most rooms inherit their atmosphere from the area, this is important. Return -1 to have this area inherit its atmosphere from parents (which would ultimately go back to RESOURCE_AIR)

Specified by:
setAtmosphere in interface Places
Parameters:
resourceCode - the RawMaterial resource to use
See Also:
RawMaterial.MATERIAL_GAS

getAtmosphere

public int getAtmosphere()
Description copied from interface: Places
Returns the resource that represents the atmosphere of this area. Since most rooms inherit their atmosphere from the area, this is important. Could have this area inherit its atmosphere from parents (which would ultimately go back to RESOURCE_AIR)

Specified by:
getAtmosphere in interface Places
Returns:
the RawMaterial resource
See Also:
RawMaterial.MATERIAL_GAS

image

public java.lang.String image()
Description copied from interface: Environmental
Returns the fully qualified and determined name of the image file displayed for this object when MXP is used. If rawImage() is non-empty, it will return rawImage, and otherwise use the mxp default data file.

Specified by:
image in interface Environmental
Returns:
the name of the mxp image to display for this object.

rawImage

public java.lang.String rawImage()
Description copied from interface: Environmental
Returns the raw name of the image file to display for this object when MXP is used. This is the value set by the builder, and may be returned by image() if it is non-empty.

Specified by:
rawImage in interface Environmental
Returns:
the raw name of the mxp image file

setImage

public void setImage(java.lang.String newImage)
Description copied from interface: Environmental
Sets the raw name of the image file to display for this object when MXP is used. This is the value set by the builder, and may be returned by image() if it is non-empty.

Specified by:
setImage in interface Environmental
Parameters:
newImage - the raw name of the mxp image file

isGeneric

public boolean isGeneric()
Description copied from interface: Environmental
Whether the fields of this item are set in code, or set by builders. Generic means that they are set by builders, in which case XML is returned by the text() method containing all of the values for all the fields.

Specified by:
isGeneric in interface Environmental
Returns:
whether this item is modifiable by builders
See Also:
Environmental.text()

cloneFix

protected void cloneFix(Room R)

copyOf

public CMObject copyOf()
Description copied from interface: CMObject
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.

Specified by:
copyOf in interface CMObject
Returns:
a clone of this object

domainType

public int domainType()
Description copied from interface: Room
Returns the domain-code for this room, which tells you something about its physical makeup, such as whether it is outdoor, if it's in the woods or surrounded by stone, that sort of thing.

Specified by:
domainType in interface Room
Returns:
the domain-code for this room
See Also:
Room.INDOORS, Room.DOMAIN_INDOORS_CAVE, Room.DOMAIN_INDOORS_DESCS, Room.DOMAIN_OUTDOORS_CITY, Room.DOMAIN_OUTDOOR_DESCS

getClimateTypeCode

public int getClimateTypeCode()
Description copied from interface: Places
Returns a bitmap of climate flags for this area which will be used to influence the weather for the area in addition to season and other factors.

Specified by:
getClimateTypeCode in interface Places
Returns:
a CLIMASK bitmap
See Also:
Places.CLIMASK_COLD

setClimateType

public void setClimateType(int climask)
Description copied from interface: Places
Returns a bitmap of climate flags for this area which will be used to influence the weather for the area in addition to season and other factors.

Specified by:
setClimateType in interface Places
Parameters:
climask - a CLIMASK bitmap
See Also:
Places.CLIMASK_COLD

getClimateType

public int getClimateType()
Description copied from interface: Places
Returns a bitmap of the climate for this place. If the climate is CLIMASK_INHERIT, then it will look to parent objects, such as areas, and parent areas, until it eventually finds a non-inherit, or returns CLIMASK_NORMAL;

Specified by:
getClimateType in interface Places
Returns:
a derived climate
See Also:
Places.CLIMASK_COLD

expirationDate

public long expirationDate()
Description copied from interface: Environmental
If this object expires, it should have a timestamp saying when it expires, in real time. When it expires, a MSG_EXPIRE message will be sent to it.

Specified by:
expirationDate in interface Environmental
Returns:
the time stamp when this thing expires
See Also:
Environmental.setExpirationDate(long)

setExpirationDate

public void setExpirationDate(long time)
Description copied from interface: Environmental
If this object expires, it should have a timestamp saying when it expires, in real time. When it expires, a MSG_EXPIRE message will be sent to it.

Specified by:
setExpirationDate in interface Environmental
Parameters:
time - the time stamp when this thing expires
See Also:
Environmental.expirationDate()

setRawExit

public void setRawExit(int direction,
                       Exit to)
Description copied from interface: Room
Sets the Exit object found in this room in the given direction.

Specified by:
setRawExit in interface Room
Parameters:
direction - the direction in this room to look for an exit in
to - the raw Exit object in that direction, or null
See Also:
Room.getRawExit(int), Room.getExitInDir(int), Room.getReverseExit(int), Room.getPairedExit(int), Room.fetchExit(String), Directions, Exit

displayText

public java.lang.String displayText()
Description copied from interface: Environmental
Gets the raw string used to show what this object looks like in the room. May be used as a basis for other methods, such as the title of rooms, and what an exit looks like when open. The value for Items may be null if the item is not displayed when the room is seen.

Specified by:
displayText in interface Environmental
Returns:
the string describing how this object looks in the room

setDisplayText

public void setDisplayText(java.lang.String newDisplayText)
Description copied from interface: Environmental
Sets the raw string used to show what this object looks like in the room. May be used as a basis for other methods, such as the title of rooms, and what an exit looks like when open. The value for Items may be null if the item is not displayed when the room is seen.

Specified by:
setDisplayText in interface Environmental
Parameters:
newDisplayText - the string describing how this object looks in the room

description

public java.lang.String description()
Description copied from interface: Environmental
The basic description of this object, as shown when the item is directly LOOKed at.

Specified by:
description in interface Environmental
Returns:
the basic detail description of this object

setDescription

public void setDescription(java.lang.String newDescription)
Description copied from interface: Environmental
Sets the basic description of this object, as shown when the item is directly LOOKed at.

Specified by:
setDescription in interface Environmental
Parameters:
newDescription - the basic detail description of this object

text

public java.lang.String text()
Description copied from interface: Environmental
For objects which have false for their isGeneric method, this is used to set any internally coded strings to change the nature or behavior of the object. For objects which have true for their isGeneric method, this is used to set and parse the XML which will be used to fill out the fields in this object. Since Ability objects are never Generic, this will always be where parameters are read from an Ability instance.

Specified by:
text in interface Environmental
Returns:
either an open internal text string, or XML

miscTextFormat

public java.lang.String miscTextFormat()
Description copied from interface: Environmental
Unimplemented as of yet, but will hold a string telling the system what the proper format of any miscText data. Will use the CMParms.MTFORMAT_* constants for definition.

Specified by:
miscTextFormat in interface Environmental
Returns:
the format expected for the miscText field
See Also:
CMParms, Environmental.text(), Environmental.setMiscText(String)

setMiscText

public void setMiscText(java.lang.String newMiscText)
Description copied from interface: Environmental
For objects which have false for their isGeneric method, this is used to set any internally coded strings to change the nature or behavior of the object. For objects which have true for their isGeneric method, this is used to set and parse the XML which will be used to fill out the fields in this object. Since Ability objects are never Generic, this will always be where parameters are read from an Ability instance.

Specified by:
setMiscText in interface Environmental
Parameters:
newMiscText - either an open internal text string, or XML

setRoomID

public void setRoomID(java.lang.String newID)
Description copied from interface: Room
Changes the room ID of this room. This is not related to the ID() method. The room ID is the "address" of the room on the world map. It is generally of the format [AREA NAME]#[ID NUMBER] for primary rooms. All other rooms, such as GridLocale children, or temporary or contingent rooms, have an empty string "" room ID. GridLocale children (@see GridLocale) in particular may have an address, if the GridLocale is, itself, a primary room, but still have an empty roomID.

Specified by:
setRoomID in interface Room
Parameters:
newID - the new room ID of this room
See Also:
Room.roomID()

getArea

public Area getArea()
Description copied from interface: Room
Returns the Area to which this room belongs. Guaranteed to be non-null.

Specified by:
getArea in interface Room
Returns:
the Area to which this room belongs
See Also:
Room.setArea(Area), Area

setArea

public void setArea(Area newArea)
Description copied from interface: Room
Sets the Area to which this room should belong, which also notifies the Area object that this room is a new member, and removing itself from any previous Area it belonged to in the past.

Specified by:
setArea in interface Room
Parameters:
newArea - the new area that this room belongs ro
See Also:
Area, Room.getArea()

setGridParent

public void setGridParent(GridLocale room)
Description copied from interface: Room
If this room is a grid-child room, this method is called to notify this child as to the identity of its parent gridlocale room.

Specified by:
setGridParent in interface Room
Parameters:
room - the GridLocale parent room to this room
See Also:
Room.getGridParent(), GridLocale

getGridParent

public GridLocale getGridParent()
Description copied from interface: Room
If this room is a grid-child room, this method is called to return the identity of its parent gridlocale room.

Specified by:
getGridParent in interface Room
Returns:
the GridLocale parent room to this room
See Also:
Room.setGridParent(GridLocale), GridLocale

giveASky

public void giveASky(int depth)
Description copied from interface: Room
If this room requires attached temporary rooms, such as a sky in an outdoor room, or underwater rooms in the ocean, this method will create those rooms at the given left of depth.

Specified by:
giveASky in interface Room
Parameters:
depth - the diameter of the sky or underwater to create
See Also:
Room.clearSky(), Room.getSky()

getSky

public java.util.List<Room> getSky()
Description copied from interface: Room
If this room requires attached temporary rooms, such as a sky in an outdoor room, or underwater rooms in the ocean, this method will return any existing one, or an empty list if none exist yet.

Specified by:
getSky in interface Room
See Also:
Room.clearSky(), Room.getSky()

clearSky

public void clearSky()
Description copied from interface: Room
If this room has attached temporary rooms, such as a sky in an outdoor room, or underwater rooms in the ocean, this method will empty all of those rooms of their content, and then destroy those rooms.

Specified by:
clearSky in interface Room
See Also:
Room.giveASky(int), Room.getSky()

resourceChoices

public java.util.List<java.lang.Integer> resourceChoices()
Description copied from interface: Room
Returns a list of all resource codes for potentially gatherable resources in this room. This list is alterable for a given Room/Locale java class. Changes to any instance will affect the entire class.

Specified by:
resourceChoices in interface Room
Returns:
the list of all possible resource codes for the current gatherable resources in this room
See Also:
RawMaterial, RawMaterial.CODES, Room.myResource(), Room.setResource(int)

setResource

public void setResource(int resourceCode)
Description copied from interface: Room
Sets the full resource code for the current gatherable resource in this room. The value set by this method may be changed automatically later on.

Specified by:
setResource in interface Room
Parameters:
resourceCode - the full resource code for the current gatherable resource in this room
See Also:
RawMaterial, RawMaterial.CODES, Room.myResource(), Room.resourceChoices()

myResource

public int myResource()
Description copied from interface: Room
Returns the full resource code for the current gatherable resource in this room. The value of this method may change from time to time.

Specified by:
myResource in interface Room
Returns:
the full resource code for the current gatherable resource in this room
See Also:
RawMaterial, RawMaterial.CODES, Room.setResource(int), Room.resourceChoices()

toggleMobility

public void toggleMobility(boolean onoff)
Description copied from interface: Room
Sets or clears whether any mobs in this room may, in fact, leave it. This applies to player and npc mobs equally.

Specified by:
toggleMobility in interface Room
Parameters:
onoff - true to allow mobility, false to disallow mobility

getMobility

public boolean getMobility()
Description copied from interface: Room
Gets whether any mobs in this room may, in fact, leave it. This applies to player and npc mobs equally.

Specified by:
getMobility in interface Room
Returns:
true if anyone can leave this room, false otherwise

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()

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

startItemRejuv

public void startItemRejuv()
Description copied from interface: Room
When a room is created, this method is called to inspect the item contents for any rejuvinating items and, if found, causes them to start being tracked. Rejuvinating items are items that once, removed from a room, restore themselves after the rejuv-time clears.

Specified by:
startItemRejuv in interface Room

getTickStatus

public int getTickStatus()
Description copied from interface: Tickable
A coded status for this object during the period where its tick method is being called. The statis is defined, at least in part, by constants in this interface STATUS_*. STATUS_NOT should be returned when the objects tick method is not currently in execution. It should never return STATUS_NOT when the objects tick method is in execution.

Specified by:
getTickStatus in interface Tickable
Returns:
the numeric status of this object
See Also:
Tickable.tick(Tickable, int)

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
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

phyStats

public PhyStats phyStats()
Description copied from interface: Affectable
Object containing a set of current, modified, usable, mostly numeric fields. This object is based on the object from basePhyStats() and then updated and modified by the recoverPhyStats() method. See the PhyStats interface for information on the fields herein.

Specified by:
phyStats in interface Affectable
Returns:
the current set of state fields
See Also:
Affectable.basePhyStats(), Affectable.recoverPhyStats(), PhyStats

basePhyStats

public PhyStats basePhyStats()
Description copied from interface: Affectable
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 recoverPhyStats() method. See the PhyStats interface for information on the fields herein.

Specified by:
basePhyStats in interface Affectable
Returns:
a set of state fields
See Also:
Affectable.phyStats(), Affectable.recoverPhyStats(), PhyStats

recoverPhyStats

public void recoverPhyStats()
Description copied from interface: Affectable
This method copies the basePhyStats() object into the phyStats() object, then makes repeated calls to all surrounding objects with affectPhyStats(Environmental,PhyStats) 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 phyStats() object. When it returns, phyStats() 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.

Specified by:
recoverPhyStats in interface Affectable
See Also:
Affectable.basePhyStats(), Affectable.phyStats(), Affectable.addEffect(Ability), Behavable.addBehavior(Behavior), PhyStats

recoverRoomStats

public void recoverRoomStats()
Description copied from interface: Room
Causes the room stat affects to be reevaluated, as well as the stat affects of every inhabitant, exit, and item in the room.

Specified by:
recoverRoomStats in interface Room
See Also:
Affectable.recoverPhyStats(), MOB.recoverCharStats()

setBasePhyStats

public void setBasePhyStats(PhyStats newStats)
Description copied from interface: Affectable
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 recoverPhyStats() method. See the PhyStats interface for information on the fields herein. This method is rarely called -- the fields therein are usually set using setter methods from the PhyStats interface on the object itself.

Specified by:
setBasePhyStats in interface Affectable
Parameters:
newStats - a set of state fields
See Also:
Affectable.phyStats(), Affectable.recoverPhyStats(), PhyStats

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()

compareTo

public int compareTo(CMObject o)
Specified by:
compareTo in interface java.lang.Comparable<CMObject>

parseVariesCodes

protected java.lang.String parseVariesCodes(MOB mob,
                                            Area A,
                                            java.lang.String text)

parseVaries

protected java.lang.String parseVaries(MOB mob,
                                       java.lang.String text)

displayText

public java.lang.String displayText(MOB mob)
Description copied from interface: Physical
Returns the displayText, but as seen by the given viewer. Can differ from displayText() without being saved to the DB. Display Texts are normally the way something appears in a room, or is the roomTitle of rooms.

Specified by:
displayText in interface Physical
Parameters:
mob - the mob viewing the physical thing
Returns:
the displayText as seen by the viewer
See Also:
Environmental.displayText()

description

public java.lang.String description(MOB mob)
Description copied from interface: Physical
Returns the description, but as seen by the given viewer. Can differ from description() without being saved to the DB. Descriptions are normally the way something appears when looked at, or is the long description of rooms.

Specified by:
description in interface Physical
Parameters:
mob - the mob viewing the physical thing
Returns:
the description as seen by the viewer
See Also:
Environmental.description()

bringMobHere

public void bringMobHere(MOB mob,
                         boolean andFollowers)
Description copied from interface: Room
A workhorse method that removes the given mob (and anything they are riding or being ridden by, recursively, and optionally any followers, and their riders, recursively) and places them all in this room. It does not affect those that the given mob are themselves following, however.

Specified by:
bringMobHere in interface Room
Parameters:
mob - the mob to move from where he is, to here
andFollowers - true to include followers, false otherwise
See Also:
Room.fetchInhabitant(String), Room.fetchInhabitant(int), Room.fetchInhabitants(String), Room.fetchRandomInhabitant(), Room.delAllInhabitants(boolean), Room.addInhabitant(MOB), Room.delInhabitant(MOB), Room.isInhabitant(MOB), Room.inhabitants(), Room.numPCInhabitants(), Room.numInhabitants(), Room.eachInhabitant(EachApplicable)

moveItemTo

public void moveItemTo(Item container)
Description copied from interface: ItemPossessor
Intelligently removes an item from its current location and moves it to this possessor, managing any container contents. Is the same as calling the longer moveItemTo with a Never expiration, and NO movement flags. Duplicates will not be permitted.

Specified by:
moveItemTo in interface ItemPossessor
Parameters:
container - the item to add
See Also:
ItemPossessor.Expire

moveItemTo

public void moveItemTo(Item item,
                       ItemPossessor.Expire expire,
                       ItemPossessor.Move... moveFlags)
Description copied from interface: ItemPossessor
Intelligently removes an item from its current location and moves it to this possessor, managing any container contents, and possibly followers/riders if the item is a cart. An expiration can be set on the move to have the items expire. Duplicates will not be permitted.

Specified by:
moveItemTo in interface ItemPossessor
Parameters:
item - the item to add
expire - the expiration code
moveFlags - any flags related to the move
See Also:
ItemPossessor.Expire

getReverseExit

public Exit getReverseExit(int direction)
Description copied from interface: Room
Returns the Exit opposite this one, in the Room in the given direction. For example, if the direction is east, this will return the west door in the room to the east.

Specified by:
getReverseExit in interface Room
Parameters:
direction - the direction from this room to get the reverse exit for
Returns:
the reverse exit, or null if there is no room (or no reverse exit)
See Also:
Room.getRawExit(int), Room.getExitInDir(int), Room.setRawExit(int, Exit), Room.getPairedExit(int), Room.fetchExit(String), Directions, Exit

getPairedExit

public Exit getPairedExit(int direction)
Description copied from interface: Room
Returns the Exit opposite this one, in the Room in the given direction, but only if the two exits exist, and have the same Door status. For example, if the direction is east, this will return the west door in the room to the east, but only if this east exit also has a door.

Specified by:
getPairedExit in interface Room
Parameters:
direction - the direction from this room to get the reverse exit for
Returns:
the reverse exit, or null if there is no room (or no reverse exit)
See Also:
Room.getRawExit(int), Room.getExitInDir(int), Room.setRawExit(int, Exit), Room.getReverseExit(int), Room.fetchExit(String), Directions, Exit

prepareRoomInDir

public Room prepareRoomInDir(Room R,
                             int direction)
Description copied from interface: Room
This method is called by an adjoining room to resolve this room to its final object. There's no reason to call it from the "outside".

Specified by:
prepareRoomInDir in interface Room
Parameters:
R - the room being traveled from
direction - the direction from the fromRoom being travelled in
Returns:
will either return this, or a resolved Rom object.

getRoomInDir

public Room getRoomInDir(int direction)
Description copied from interface: Room
Returns the room in the given direction from this room which, depending on the exit, may be traveled to. Returns null if there is no such room.

Specified by:
getRoomInDir in interface Room
Parameters:
direction - the Direction from this room to the next
Returns:
the room in the given direction, or null
See Also:
Directions, Room.prepareRoomInDir(Room, int), Room.getRawExit(int)

getExitInDir

public Exit getExitInDir(int direction)
Description copied from interface: Room
Returns the Exit in this room, in the given direction.

Specified by:
getExitInDir in interface Room
Parameters:
direction - the direction from this room to get the exit for
Returns:
the Exit in this room, in the given direction
See Also:
Room.getRawExit(int), Room.getPairedExit(int), Room.setRawExit(int, Exit), Room.getReverseExit(int), Room.fetchExit(String), Exit

sendAndExec

protected void sendAndExec(MOB source,
                           CMMsg msg)

sendTrailermsgs

protected void sendTrailermsgs(MOB source,
                               CMMsg msg,
                               int depth,
                               boolean includeSource)

send

public void send(MOB source,
                 CMMsg msg)
Description copied from interface: Room
Sends the message to the given source, then to the room, and then handles any trailing messages. Technically this should always be called instead of calling executeMsg on the room, since it does the extra work for you.

Specified by:
send in interface Room
Parameters:
source - the first receiver of the message, typically the agent/source.
msg - the message to send
See Also:
Room.sendOthers(MOB, CMMsg), Room.show(MOB, Environmental, Environmental, int, String, int, String, int, String), CMMsg

sendOthers

public void sendOthers(MOB source,
                       CMMsg msg)
Description copied from interface: Room
Sends the message to the room, skipping the given source, and then handles any trailing messages. This is called in rare cases when the source message is substantially different, or handled outside this method.

Specified by:
sendOthers in interface Room
Parameters:
source - the NON-receiver of the message, typically the agent/source.
msg - the message to send
See Also:
Room.send(MOB, CMMsg), Room.show(MOB, Environmental, Environmental, int, String, int, String, int, String), CMMsg

showHappens

public void showHappens(int allCode,
                        java.lang.String allMessage)
Description copied from interface: Room
Constructs a message with the given allCode as the source, target, and others message code, and the given allMessage as the source, target, and others message, and using a temporary fake agent/source for the message, immediately sends the message without previewing it. This should be used very sparingly for acts-of-God.

Specified by:
showHappens in interface Room
Parameters:
allCode - the source/target/others message code
allMessage - source/target/others message description
See Also:
CMMsg, Room.show(MOB, Environmental, Environmental, int, String), Room.showHappens(int, Environmental, String), Room.send(MOB, CMMsg), Room.show(MOB, Environmental, Environmental, int, String, int, String, int, String)

showHappens

public void showHappens(int allCode,
                        Environmental like,
                        java.lang.String allMessage)
Description copied from interface: Room
Constructs a message with the given allCode as the source, target, and others message code, and the given allMessage as the source, target, and others message, and using a temporary fake agent/source for the message whose name is the same as the given "like" Environmental, immediately sends the message without previewing it. This should be used very sparingly for acts-of-objects.

Specified by:
showHappens in interface Room
Parameters:
allCode - the source/target/others message code
like - the Environmental object to make the source/agent "look" like.
allMessage - source/target/others message description
See Also:
CMMsg, Room.show(MOB, Environmental, Environmental, int, String), Room.showHappens(int, Environmental, String), Room.send(MOB, CMMsg), Room.show(MOB, Environmental, Environmental, int, String, int, String, int, String)

show

public boolean show(MOB source,
                    Environmental target,
                    int allCode,
                    java.lang.String allMessage)
Description copied from interface: Room
Creates and configures a CMMsg object for use in the room, then, if the message is not flagged for ALWAYS approval, this method submits it for approval by calling okMessage on the room, and if it is approved, calls send to send the message.

Specified by:
show in interface Room
Parameters:
source - the agent source of the action
target - the target of the action
allCode - the source, target, and others code to use
allMessage - the source, target, and others string msg to send
Returns:
true if the message was approved and sent, false otherwise
See Also:
Room.send(MOB, CMMsg), MsgListener.okMessage(Environmental, CMMsg), CMMsg.source(), CMMsg.target(), CMMsg.sourceCode(), CMMsg.sourceMessage()

show

public boolean show(MOB source,
                    Environmental target,
                    Environmental tool,
                    int allCode,
                    java.lang.String allMessage)
Description copied from interface: Room
Creates and configures a CMMsg object for use in the room, then, if the message is not flagged for ALWAYS approval, this method submits it for approval by calling okMessage on the room, and if it is approved, calls send to send the message.

Specified by:
show in interface Room
Parameters:
source - the agent source of the action
target - the target of the action
tool - the tool used by the source to do the action
allCode - the source, target, and others code to use
allMessage - the source, target, and others string msg to send
Returns:
true if the message was approved and sent, false otherwise
See Also:
Room.send(MOB, CMMsg), MsgListener.okMessage(Environmental, CMMsg), CMMsg.source(), CMMsg.target(), CMMsg.tool(), CMMsg.sourceCode(), CMMsg.sourceMessage()

show

public boolean show(MOB source,
                    Environmental target,
                    Environmental tool,
                    int srcCode,
                    int tarCode,
                    int othCode,
                    java.lang.String allMessage)
Description copied from interface: Room
Creates and configures a CMMsg object for use in the room, then, if the message is not flagged for ALWAYS approval, this method submits it for approval by calling okMessage on the room, and if it is approved, calls send to send the message.

Specified by:
show in interface Room
Parameters:
source - the agent source of the action
target - the target of the action
tool - the tool used by the source to do the action
srcCode - the source code for this action
tarCode - the target code for this action
othCode - the others/observed code for this action
allMessage - the source, target, and others string msg to send
Returns:
true if the message was approved and sent, false otherwise
See Also:
Room.send(MOB, CMMsg), MsgListener.okMessage(Environmental, CMMsg), CMMsg.source(), CMMsg.target(), CMMsg.tool(), CMMsg.sourceCode(), CMMsg.targetCode(), CMMsg.othersCode(), CMMsg.sourceMessage()

show

public boolean show(MOB source,
                    Environmental target,
                    Environmental tool,
                    int allCode,
                    java.lang.String srcMessage,
                    java.lang.String tarMessage,
                    java.lang.String othMessage)
Description copied from interface: Room
Creates and configures a CMMsg object for use in the room, then, if the message is not flagged for ALWAYS approval, this method submits it for approval by calling okMessage on the room, and if it is approved, calls send to send the message.

Specified by:
show in interface Room
Parameters:
source - the agent source of the action
target - the target of the action
tool - the tool used by the source to do the action
allCode - the source, target, and others code to use
srcMessage - the action/message as seen by the source
tarMessage - the action/message as seen by the target
othMessage - the action/message as seen by everyone else
Returns:
true if the message was approved and sent, false otherwise
See Also:
Room.send(MOB, CMMsg), MsgListener.okMessage(Environmental, CMMsg), CMMsg.source(), CMMsg.target(), CMMsg.tool(), CMMsg.sourceCode(), CMMsg.sourceMessage(), CMMsg.targetMessage(), CMMsg.othersMessage()

show

public boolean show(MOB source,
                    Environmental target,
                    Environmental tool,
                    int srcCode,
                    java.lang.String srcMessage,
                    int tarCode,
                    java.lang.String tarMessage,
                    int othCode,
                    java.lang.String othMessage)
Description copied from interface: Room
Creates and configures a CMMsg object for use in the room, then, if the message is not flagged for ALWAYS approval, this method submits it for approval by calling okMessage on the room, and if it is approved, calls send to send the message.

Specified by:
show in interface Room
Parameters:
source - the agent source of the action
target - the target of the action
tool - the tool used by the source to do the action
srcCode - the source code for this action
srcMessage - the action/message as seen by the source
tarCode - the target code for this action
tarMessage - the action/message as seen by the target
othCode - the others/observed code for this action
othMessage - the action/message as seen by everyone else
Returns:
true if the message was approved and sent, false otherwise
See Also:
Room.send(MOB, CMMsg), MsgListener.okMessage(Environmental, CMMsg), CMMsg.source(), CMMsg.target(), CMMsg.tool(), CMMsg.sourceCode(), CMMsg.targetCode(), CMMsg.othersCode(), CMMsg.sourceMessage(), CMMsg.targetMessage(), CMMsg.othersMessage()

showOthers

public boolean showOthers(MOB source,
                          Environmental target,
                          int allCode,
                          java.lang.String allMessage)
Description copied from interface: Room
Creates and configures a CMMsg object for use in the room, then, if the message is not flagged for ALWAYS approval, this method submits it for approval by calling okMessage on the room, and if it is approved, calls sendOthers to send the message.

Specified by:
showOthers in interface Room
Parameters:
source - the agent source of the action
target - the target of the action
allCode - the source, target, and others code to use
allMessage - the source, target, and others string msg to send
Returns:
true if the message was approved and sent, false otherwise
See Also:
Room.sendOthers(MOB, CMMsg), MsgListener.okMessage(Environmental, CMMsg), CMMsg.source(), CMMsg.target(), CMMsg.sourceCode(), CMMsg.sourceMessage()

showOthers

public boolean showOthers(MOB source,
                          Environmental target,
                          Environmental tool,
                          int allCode,
                          java.lang.String allMessage)
Description copied from interface: Room
Creates and configures a CMMsg object for use in the room, then, if the message is not flagged for ALWAYS approval, this method submits it for approval by calling okMessage on the room, and if it is approved, calls sendOthers to send the message.

Specified by:
showOthers in interface Room
Parameters:
source - the agent source of the action
target - the target of the action
tool - the tool used by the source to do the action
allCode - the source, target, and others code to use
allMessage - the source, target, and others string msg to send
Returns:
true if the message was approved and sent, false otherwise
See Also:
Room.sendOthers(MOB, CMMsg), MsgListener.okMessage(Environmental, CMMsg), CMMsg.source(), CMMsg.target(), CMMsg.tool(), CMMsg.sourceCode(), CMMsg.sourceMessage()

showSource

public boolean showSource(MOB source,
                          Environmental target,
                          int allCode,
                          java.lang.String allMessage)
Description copied from interface: Room
Creates and configures a CMMsg object for use in the room, then, if the message is not flagged for ALWAYS approval, this method submits it for approval by calling okMessage on the room, and if it is approved, calls executeMsg on the given source mob.

Specified by:
showSource in interface Room
Parameters:
source - the agent source of the action
target - the target of the action
allCode - the source, target, and others code to use
allMessage - the source, target, and others string msg to send
Returns:
true if the message was approved and sent, false otherwise
See Also:
MsgListener.executeMsg(Environmental, CMMsg), MsgListener.okMessage(Environmental, CMMsg), CMMsg.source(), CMMsg.target(), CMMsg.sourceCode(), CMMsg.sourceMessage()

showSource

public boolean showSource(MOB source,
                          Environmental target,
                          Environmental tool,
                          int allCode,
                          java.lang.String allMessage)
Description copied from interface: Room
Creates and configures a CMMsg object for use in the room, then, if the message is not flagged for ALWAYS approval, this method submits it for approval by calling okMessage on the room, and if it is approved, calls executeMsg on the given source mob.

Specified by:
showSource in interface Room
Parameters:
source - the agent source of the action
target - the target of the action
tool - the tool used by the source to do the action
allCode - the source, target, and others code to use
allMessage - the source, target, and others string msg to send
Returns:
true if the message was approved and sent, false otherwise
See Also:
MsgListener.executeMsg(Environmental, CMMsg), MsgListener.okMessage(Environmental, CMMsg), CMMsg.source(), CMMsg.target(), CMMsg.sourceCode(), CMMsg.sourceMessage()

getRawExit

public Exit getRawExit(int dir)
Description copied from interface: Room
Returns the raw unresolved exit found in this room in the given direction. This method should only be called by internal engine systems, as it may return a temporary object. Instead, you should always call Room.getExitInDir(int) if you want the final Exit object in the given direction. This method returns null if there is no exit in the given direction.

Specified by:
getRawExit in interface Room
Parameters:
dir - the direction in this room to look for an exit in
Returns:
the raw Exit object in that direction, or null
See Also:
Room.setRawExit(int, Exit), Room.getExitInDir(int), Room.getReverseExit(int), Room.getPairedExit(int), Room.fetchExit(String), Directions, Exit

rawDoors

public Room[] rawDoors()
Description copied from interface: Room
Returns array of the Raw room objects that this room connects to via exits. This array should only be used by low-level engine calls that understand the implications of accessing rooms in this way. This is because a Room returned by this method may be temporary, or even just a stand-in for a real room that is instantiated later. Always call Room.getRoomInDir(int) if you want a proper Room object. These rooms are indexed by Direction code.

Specified by:
rawDoors in interface Room
Returns:
an array of Raw room objects that this room connects to
See Also:
Directions, Room.prepareRoomInDir(Room, int), Room.getRawExit(int)

isSavable

public boolean isSavable()
Description copied from interface: Contingent
Whether, if this object is in a room, whether it is appropriate to save this object to the database as a permanent feature of its container. It always returns true except under unique circumstances.

Specified by:
isSavable in interface Contingent
Returns:
true, usually.

setSavable

public void setSavable(boolean truefalse)
Description copied from interface: Contingent
Sets whether this object can be saved as a permanent aspect of its host.

Specified by:
setSavable in interface Contingent
Parameters:
truefalse - whether this behavior can be saved as part of its host.
See Also:
Contingent.isSavable()

destroy

public void destroy()
Description copied from interface: Contingent
Utterly and permanently destroy this object, not only removing it from the map, but causing this object to be collected as garbage by Java. Containers, rooms. and mobs who have their destroy() method called will also call the destroy() methods on all items and other objects listed as content, recursively.

Specified by:
destroy in interface Contingent

amDestroyed

public final boolean amDestroyed()
Description copied from interface: Contingent
Whether the destroy() method has been previousy called on this object.

Specified by:
amDestroyed in interface Contingent
Returns:
whether the object is destroy()ed.

getCombatTurnMobIndex

public int getCombatTurnMobIndex()
Description copied from interface: Room
Returns the index number which represents which mob's "turn" it is in combat. This only applies when turn-based combat systems are being used. The index is into the ordinal list of mobs in this room.

Specified by:
getCombatTurnMobIndex in interface Room
Returns:
the index number which represents which mob's "turn" it is in combat

setCombatTurnMobIndex

public void setCombatTurnMobIndex(int index)
Description copied from interface: Room
Sets the index number which represents which mob's "turn" it is in combat. This only applies when turn-based combat systems are being used. The index is into the ordinal list of mobs in this room.

Specified by:
setCombatTurnMobIndex in interface Room
Parameters:
index - the index number which represents which mob's "turn" it is in combat

isHere

public boolean isHere(Environmental E)
Description copied from interface: Room
Returns whether the given object either IS this room, or is IN this room. This can be anything: item, mob, exit, ability, behavior -- whatever.

Specified by:
isHere in interface Room
Parameters:
E - the Environmental object to find in this room
Returns:
true if it is here, false otherwise

fetchRandomInhabitant

public MOB fetchRandomInhabitant()
Description copied from interface: Room
Returns a random inhabitant mob in this room, or null if there are none.

Specified by:
fetchRandomInhabitant in interface Room
Returns:
the random mob inhabitant
See Also:
Room.fetchInhabitant(String), Room.fetchInhabitant(int), Room.fetchInhabitants(String), Room.isInhabitant(MOB), Room.delAllInhabitants(boolean), Room.inhabitants(), Room.delInhabitant(MOB), Room.isInhabitant(MOB), Room.numInhabitants(), Room.bringMobHere(MOB, boolean), Room.numPCInhabitants(), Room.eachInhabitant(EachApplicable)

fetchInhabitant

public MOB fetchInhabitant(java.lang.String inhabitantID)
Description copied from interface: Room
Searches the inhabitants of this room for a mob with the given ID(), name, or display name. If nothing is found, it does a substring search as well. This method also respects index suffixes, such as .1, .2 to specify which of identical mobs to return.

Specified by:
fetchInhabitant in interface Room
Parameters:
inhabitantID - the name, id, or keyword to search for
Returns:
the first mob to match the search string
See Also:
Room.fetchInhabitants(String), Room.fetchInhabitantExact(String), Room.fetchInhabitant(int), Room.fetchRandomInhabitant(), Room.inhabitants(), Room.addInhabitant(MOB), Room.delInhabitant(MOB), Room.isInhabitant(MOB), Room.numInhabitants(), Room.bringMobHere(MOB, boolean), Room.numPCInhabitants(), Room.eachInhabitant(EachApplicable)

fetchInhabitantExact

public MOB fetchInhabitantExact(java.lang.String inhabitantID)
Description copied from interface: Room
Searches the inhabitants of this room for a mob with the given ID(), name, or display name. This method also respects index suffixes, such as .1, .2 to specify which of identical mobs to return.

Specified by:
fetchInhabitantExact in interface Room
Parameters:
inhabitantID - the name, id, or keyword to search for
Returns:
the first mob to match the search string
See Also:
Room.fetchInhabitants(String), Room.fetchInhabitant(String), Room.fetchInhabitant(int), Room.fetchRandomInhabitant(), Room.inhabitants(), Room.addInhabitant(MOB), Room.delInhabitant(MOB), Room.isInhabitant(MOB), Room.numInhabitants(), Room.bringMobHere(MOB, boolean), Room.numPCInhabitants(), Room.eachInhabitant(EachApplicable)

fetchInhabitants

public java.util.List<MOB> fetchInhabitants(java.lang.String inhabitantID)
Description copied from interface: Room
Searches the inhabitants of this room for mobs with the given ID(), name, or display name. If nothing is found, it does a substring search as well.

Specified by:
fetchInhabitants in interface Room
Parameters:
inhabitantID - the name, id, or keyword to search for
Returns:
all the mobs that match the search string
See Also:
Room.fetchInhabitant(String), Room.fetchInhabitant(int), Room.fetchRandomInhabitant(), Room.inhabitants(), Room.addInhabitant(MOB), Room.delInhabitant(MOB), Room.delAllInhabitants(boolean), Room.isInhabitant(MOB), Room.numInhabitants(), Room.bringMobHere(MOB, boolean), Room.numPCInhabitants(), Room.eachInhabitant(EachApplicable)

addInhabitant

public void addInhabitant(MOB mob)
Description copied from interface: Room
Adds the given mob to this room as an inhabitant. Does *not* register the new location with the mob, so you would need to also call setLocation

Specified by:
addInhabitant in interface Room
Parameters:
mob - the mob to add to this room
See Also:
MOB.setLocation(Room), Room.fetchInhabitant(String), Room.fetchInhabitant(int), Room.fetchInhabitants(String), Room.fetchRandomInhabitant(), Room.delAllInhabitants(boolean), Room.inhabitants(), Room.delInhabitant(MOB), Room.isInhabitant(MOB), Room.numInhabitants(), Room.bringMobHere(MOB, boolean), Room.numPCInhabitants(), Room.eachInhabitant(EachApplicable)

inhabitants

public java.util.Enumeration<MOB> inhabitants()
Description copied from interface: Room
Returns an enumeration of all the inhabitants of this room.

Specified by:
inhabitants in interface Room
Returns:
an enumeration of all the inhabitants
See Also:
Room.fetchInhabitant(String), Room.fetchInhabitant(int), Room.fetchInhabitants(String), Room.fetchRandomInhabitant(), Room.delAllInhabitants(boolean), Room.addInhabitant(MOB), Room.delInhabitant(MOB), Room.isInhabitant(MOB), Room.numInhabitants(), Room.bringMobHere(MOB, boolean), Room.numPCInhabitants(), Room.eachInhabitant(EachApplicable)

numInhabitants

public int numInhabitants()
Description copied from interface: Room
Returns the number of all the inhabitants of this room.

Specified by:
numInhabitants in interface Room
Returns:
the number of inhabitants
See Also:
Room.fetchInhabitant(String), Room.fetchInhabitant(int), Room.fetchInhabitants(String), Room.fetchRandomInhabitant(), Room.delAllInhabitants(boolean), Room.addInhabitant(MOB), Room.delInhabitant(MOB), Room.isInhabitant(MOB), Room.inhabitants(), Room.bringMobHere(MOB, boolean), Room.numPCInhabitants(), Room.eachInhabitant(EachApplicable)

numPCInhabitants

public int numPCInhabitants()
Description copied from interface: Room
Returns the number of player/PC inhabitants of this room.

Specified by:
numPCInhabitants in interface Room
Returns:
the number of player inhabitants
See Also:
Room.fetchInhabitant(String), Room.fetchInhabitant(int), Room.fetchInhabitants(String), Room.fetchRandomInhabitant(), Room.delAllInhabitants(boolean), Room.addInhabitant(MOB), Room.delInhabitant(MOB), Room.isInhabitant(MOB), Room.inhabitants(), Room.bringMobHere(MOB, boolean), Room.numInhabitants(), Room.eachInhabitant(EachApplicable)

isInhabitant

public boolean isInhabitant(MOB mob)
Description copied from interface: Room
Returns whether the given mob is an inhabitant of this room.

Specified by:
isInhabitant in interface Room
Parameters:
mob - the mob to look for
Returns:
true if the mob is here, false otherwise
See Also:
Room.fetchInhabitant(String), Room.fetchInhabitant(int), Room.fetchInhabitants(String), Room.fetchRandomInhabitant(), Room.delAllInhabitants(boolean), Room.inhabitants(), Room.delInhabitant(MOB), Room.addInhabitant(MOB), Room.numInhabitants(), Room.bringMobHere(MOB, boolean), Room.numPCInhabitants(), Room.eachInhabitant(EachApplicable)

fetchInhabitant

public MOB fetchInhabitant(int i)
Description copied from interface: Room
Returns the inhabitant mob in this room at the given index, or null if there are none at that index. The index is, of course, 0 based.

Specified by:
fetchInhabitant in interface Room
Parameters:
i - the index of the mob
Returns:
the mob inhabitant at that index
See Also:
Room.fetchInhabitant(String), Room.fetchRandomInhabitant(), Room.fetchInhabitants(String), Room.isInhabitant(MOB), Room.delAllInhabitants(boolean), Room.inhabitants(), Room.delInhabitant(MOB), Room.isInhabitant(MOB), Room.numInhabitants(), Room.bringMobHere(MOB, boolean), Room.numPCInhabitants(), Room.eachInhabitant(EachApplicable)

eachInhabitant

public void eachInhabitant(EachApplicable<MOB> applier)
Description copied from interface: Room
Applies the given applier Java code to each mob in this room

Specified by:
eachInhabitant in interface Room
Parameters:
applier - code to execute against each object
See Also:
Room.fetchInhabitant(String), Room.fetchInhabitant(int), Room.fetchInhabitants(String), Room.fetchRandomInhabitant(), Room.delAllInhabitants(boolean), Room.inhabitants(), Room.delInhabitant(MOB), Room.addInhabitant(MOB), Room.numInhabitants(), Room.bringMobHere(MOB, boolean), Room.numPCInhabitants(), Room.isInhabitant(MOB)

delInhabitant

public void delInhabitant(MOB mob)
Description copied from interface: Room
Removes the given mob from this room as an inhabitant. Does *not* un-register the new location with the mob, so you would need to also call setLocation

Specified by:
delInhabitant in interface Room
Parameters:
mob - the mob to remove from this room
See Also:
MOB.setLocation(Room), Room.fetchInhabitant(String), Room.fetchInhabitant(int), Room.fetchInhabitants(String), Room.fetchRandomInhabitant(), Room.inhabitants(), Room.addInhabitant(MOB), Room.delAllInhabitants(boolean), Room.isInhabitant(MOB), Room.numInhabitants(), Room.bringMobHere(MOB, boolean), Room.numPCInhabitants(), Room.eachInhabitant(EachApplicable)

delAllInhabitants

public void delAllInhabitants(boolean destroy)
Description copied from interface: Room
Removes all the mobs from this room as inhabitants and optionally destroys the mob objects as well. Does *not* un-register the new location with the mob, so you would need to also call setLocation if you don't destroy them.

Specified by:
delAllInhabitants in interface Room
Parameters:
destroy - true to also destroy the mob objects, false otherwise
See Also:
MOB.setLocation(Room), Room.fetchInhabitant(String), Room.fetchInhabitant(int), Room.fetchInhabitants(String), Room.fetchRandomInhabitant(), Room.inhabitants(), Room.delInhabitant(MOB), Room.addInhabitant(MOB), Room.isInhabitant(MOB), Room.numInhabitants(), Room.bringMobHere(MOB, boolean), Room.numPCInhabitants(), Room.eachInhabitant(EachApplicable)

fetchExit

public Exit fetchExit(java.lang.String itemID)
Description copied from interface: Room
Returns the exit in this room with the given name or display text or in the given direction. If none is found, a substring search is also done to find the exit. This method also respects context numbers suffixes, such as .1, .2, etc.

Specified by:
fetchExit in interface Room
Parameters:
itemID - the name or substring of the exit to return
Returns:
the first Exit object that matches the search string
See Also:
Room.getRawExit(int), Room.getPairedExit(int), Room.setRawExit(int, Exit), Room.getReverseExit(int), Room.getExitInDir(int), Exit

findItem

public Item findItem(java.lang.String itemID)
Description copied from interface: ItemCollection
Returns the item in this possessor that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller name is found). Handles indexing for duplicate-named items.

Specified by:
findItem in interface ItemCollection
Parameters:
itemID - the name or partial name of the item to fetch
Returns:
the item found, or null

items

public java.util.Enumeration<Item> items()
Description copied from interface: ItemCollection
An enumeration of all the items at this possessor.

Specified by:
items in interface ItemCollection
Returns:
enumeration of all the items at this possessor.

findItem

public Item findItem(Item goodLocation,
                     java.lang.String itemID)
Description copied from interface: ItemCollection
Returns the item in the given container that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller name is found). Handles indexing for duplicate-named items.

Specified by:
findItem in interface ItemCollection
Parameters:
goodLocation - the container to look in, or null for none
itemID - the name or partial name of the item to fetch
Returns:
the item found, or null

findItems

public java.util.List<Item> findItems(Item goodLocation,
                                      java.lang.String itemID)
Description copied from interface: ItemCollection
Returns all items in the given container that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller names are found).

Specified by:
findItems in interface ItemCollection
Parameters:
goodLocation - the container to look in, or null for none
itemID - the name or partial name of the item to fetch
Returns:
the item found, or null

findItems

public java.util.List<Item> findItems(java.lang.String itemID)
Description copied from interface: ItemCollection
Returns all items in this possessor that matches the given itemID, whether by full name, description, class ID, or partial name (if no fuller names are found).

Specified by:
findItems in interface ItemCollection
Parameters:
itemID - the name or partial name of the item to fetch
Returns:
the item found, or null

addItem

public void addItem(Item item,
                    ItemPossessor.Expire expire)
Description copied from interface: ItemPossessor
Adds a new item to its possessor, with an expiration code. Duplicates will not be permitted.

Specified by:
addItem in interface ItemPossessor
Parameters:
item - the item to add
expire - the expiration argument to decide when it will get cleaned up
See Also:
ItemPossessor.Expire

insertItemUpTop

protected void insertItemUpTop(Item item)

addItem

public void addItem(Item item)
Description copied from interface: ItemCollection
Adds a new item to its possessor. By default, the item is added in a default resting state -- no containers, timeouts, or other modifiers are set. Duplicates will not be permitted.

Specified by:
addItem in interface ItemCollection
Parameters:
item - the item to add
See Also:
ItemCollection.delItem(Item)

delItem

public void delItem(Item item)
Description copied from interface: ItemCollection
Removes the item from this possessor.

Specified by:
delItem in interface ItemCollection
Parameters:
item - the item to remove

delAllItems

public void delAllItems(boolean destroy)
Description copied from interface: ItemCollection
Removes all items from this collection

Specified by:
delAllItems in interface ItemCollection
Parameters:
destroy - true to also destroy the items

numItems

public int numItems()
Description copied from interface: ItemCollection
Returns the total number of items at this possessor, regardless of container status.

Specified by:
numItems in interface ItemCollection
Returns:
the total number of items

isContent

public boolean isContent(Item item)
Description copied from interface: ItemCollection
Returns whether the given item is in this possessors list.

Specified by:
isContent in interface ItemCollection
Parameters:
item - the item to check
Returns:
true if the item was found, and false otherwise

getItem

public Item getItem(int i)
Description copied from interface: ItemCollection
Returns the item at the given index, regardless of container status, visibility, or other modifiers.

Specified by:
getItem in interface ItemCollection
Parameters:
i - the index of the item
Returns:
the item at that index, or null if its not found

eachItem

public void eachItem(EachApplicable<Item> applier)
Description copied from interface: ItemCollection
Applies the given code to each item in this collection

Specified by:
eachItem in interface ItemCollection
Parameters:
applier - code to execute against each object

getRandomItem

public Item getRandomItem()
Description copied from interface: ItemCollection
Returns a random item in this collection, or null

Specified by:
getRandomItem in interface ItemCollection
Returns:
a random item in this collection, or null

getContextName

public java.lang.String getContextName(Environmental E)
Description copied from interface: Room
Generates a specific search-string name for the given object in this room. Since items or mobs with the exact same name can be in a given room, a context-number-suffix (.1, .2, etc..) is used to specify which of the identical objects to return in the list. This method wil, given an item or mob in this room, generate that search string by returning the name plus the optional context suffix.

Specified by:
getContextName in interface Room
Parameters:
E - the mob or item to return a search string for
Returns:
the specific search string that returns the given object

fetchFromMOBRoomItemExit

public PhysicalAgent fetchFromMOBRoomItemExit(MOB mob,
                                              Item goodLocation,
                                              java.lang.String thingName,
                                              Filterer<Environmental> filter)
Description copied from interface: Room
Searches the given mob and this room for a mob, item, or exit that matches the given search string, favoring the mobs inventory over other types of objects. If nothing is found, this method also does a substring search. Context-number suffix strings are also respected, such as .1, .2, etc. Only items in the given container (or null) are searched. Item searches can also be bound by the given filterer, which is a required parameter.

Specified by:
fetchFromMOBRoomItemExit in interface Room
Parameters:
mob - the mob to search the inventory of first, or null to skip
goodLocation - the container to look in for items, or null
thingName - the search string
filter - a required filter for item searches
Returns:
the mob, item, or exit that matches the search string

fetchFromRoomFavorItems

public PhysicalAgent fetchFromRoomFavorItems(Item goodLocation,
                                             java.lang.String thingName)
Description copied from interface: Room
Searches the room for a mob, item, or exit that matches the given search string, favoring Items over other types of objects. If nothing is found, this method also does a substring search. Context-number suffix strings are also respected, such as .1, .2, etc. Only items in the given container (or null) are searched.

Specified by:
fetchFromRoomFavorItems in interface Room
Parameters:
goodLocation - the container to look in for items, or null
thingName - the search string
Returns:
the exit, mob, or item found.

fetchFromRoomFavorExits

public PhysicalAgent fetchFromRoomFavorExits(java.lang.String thingName)
Description copied from interface: Room
Searches the room for a mob, item, or exit that matches the given search string, favoring Exits over other types of objects. If nothing is found, this method also does a substring search. Context-number suffix strings are also respected, such as .1, .2, etc. Only items in the room (not in containers) are returned.

Specified by:
fetchFromRoomFavorExits in interface Room
Parameters:
thingName - the search string
Returns:
the exit, mob, or item found.

fetchFromRoomFavorMOBs

public PhysicalAgent fetchFromRoomFavorMOBs(Item goodLocation,
                                            java.lang.String thingName)
Description copied from interface: Room
Searches the room for a mob, item, or exit that matches the given search string, favoring Mobs over other types of objects. If nothing is found, this method also does a substring search. Context-number suffix strings are also respected, such as .1, .2, etc. Only items in the given container (or null) are searched.

Specified by:
fetchFromRoomFavorMOBs in interface Room
Parameters:
goodLocation - the container to look in for items, or null
thingName - the search string
Returns:
the exit, mob, or item found.

fetchFromMOBRoomFavorsItems

public PhysicalAgent fetchFromMOBRoomFavorsItems(MOB mob,
                                                 Item goodLocation,
                                                 java.lang.String thingName,
                                                 Filterer<Environmental> filter)
Description copied from interface: Room
Searches the given mob and this room for a mob, item, or exit that matches the given search string, favoring the mobs inventory over other types of objects and items generally. If nothing is found, this method also does a substring search. Context-number suffix strings are also respected, such as .1, .2, etc. Only items in the given container (or null) are searched. Item searches can also be bound by the given filterer, which is a required parameter.

Specified by:
fetchFromMOBRoomFavorsItems in interface Room
Parameters:
mob - the mob to search the inventory of first, or null to skip
goodLocation - the container to look in for items, or null
thingName - the search string
filter - a required filter for item searches
Returns:
the mob, item, or exit that matches the search string

fetchFromMOBRoomFavorsMOBs

public PhysicalAgent fetchFromMOBRoomFavorsMOBs(MOB mob,
                                                Item goodLocation,
                                                java.lang.String thingName,
                                                Filterer<Environmental> filter)
Description copied from interface: Room
Searches the given mob and this room for a mob, item, or exit that matches the given search string, favoring the room mobs over other types of objects. If nothing is found, this method also does a substring search. Context-number suffix strings are also respected, such as .1, .2, etc. Only items in the given container (or null) are searched. Item searches can also be bound by the given filterer, which is a required parameter.

Specified by:
fetchFromMOBRoomFavorsMOBs in interface Room
Parameters:
mob - the mob to search the inventory of first, or null to skip
goodLocation - the container to look in for items, or null
thingName - the search string
filter - a required filter for item searches
Returns:
the mob, item, or exit that matches the search string

pointsPerMove

public int pointsPerMove()
Description copied from interface: Room
Returns the number of movement points to move through this room. Depends on the weather and the room type, mostly.

Specified by:
pointsPerMove in interface Room
Returns:
the number of movement points to move through this room

baseThirst

protected int baseThirst()

thirstPerRound

public int thirstPerRound()
Description copied from interface: Room
Returns the amount of thirst generated by moving through this room. Depends on the weather and the room type, mostly.

Specified by:
thirstPerRound in interface Room
Returns:
the amount of thirst generated by moving through this room

minRange

public int minRange()
Description copied from interface: Environmental
the minimum range of this object, if applicable. Can refer to the size of a room, the range of a weapon, or the calculated range of a mob in combat. Usually 0.

Specified by:
minRange in interface Environmental
Returns:
the minimum range

maxRange

public int maxRange()
Description copied from interface: Room
Returns the maximum range for ranged weapons in this room. It also determines the size of a room in ship combat. Typically 1-10;

Specified by:
maxRange in interface Environmental
Specified by:
maxRange in interface Room
Returns:
the maximum range

addEffect

public void addEffect(Ability to)
Description copied from interface: Affectable
Add a new effect to this object, whether permanent or temporary. After calling this method, recoverPhyStats() 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.

Specified by:
addEffect in interface Affectable
Parameters:
to - The ability object to add as an effect.
See Also:
Ability, Affectable.recoverPhyStats()

addNonUninvokableEffect

public void addNonUninvokableEffect(Ability to)
Description copied from interface: Affectable
Same as addEffect(Ability), but will set the Ability object as never being able to be uninvoked. recoverPhyStats() method should be called next. An Ability with a given ID() can only be added once per object.

Specified by:
addNonUninvokableEffect in interface Affectable
Parameters:
to - The ability object to add as an effect.
See Also:
Ability, Affectable.recoverPhyStats()

delEffect

public void delEffect(Ability to)
Description copied from interface: Affectable
Delete an effect from this object, whether permanent or temporary. After calling this method, recoverPhyStats() should be called next in case this ability object modified the stats.

Specified by:
delEffect in interface Affectable
Parameters:
to - The ability object to remove as an effect on this object
See Also:
Ability, Affectable.recoverPhyStats()

eachEffect

public void eachEffect(EachApplicable<Ability> applier)
Description copied from interface: Affectable
Applies the given code to each effect on this object

Specified by:
eachEffect in interface Affectable
Parameters:
applier - code to execute against each object

delAllEffects

public void delAllEffects(boolean unInvoke)
Description copied from interface: Affectable
Optionally uninvokes and then certainly removes all effects from this object.

Specified by:
delAllEffects in interface Affectable
Parameters:
unInvoke - send true to uninvoke before deleting

numEffects

public int numEffects()
Description copied from interface: Affectable
Returns the number of ability objects listed as effects on this object.

Specified by:
numEffects in interface Affectable
Returns:
the number of effects this object has
See Also:
Ability

effects

public java.util.Enumeration<Ability> effects()
Description copied from interface: Affectable
Returns an enumerator of abilities listed as effects on this object.

Specified by:
effects in interface Affectable
Returns:
the enumerator of ability objects effecting this object
See Also:
Ability

fetchEffect

public Ability fetchEffect(int index)
Description copied from interface: Affectable
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.

Specified by:
fetchEffect in interface Affectable
Parameters:
index - which object to return
Returns:
the ability object effecting this object
See Also:
Ability, Affectable.numEffects()

fetchEffect

public Ability fetchEffect(java.lang.String ID)
Description copied from interface: Affectable
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.

Specified by:
fetchEffect in interface Affectable
Parameters:
ID - the Ability ID to look for in effects
Returns:
the ability object effecting this object
See Also:
Ability, CMObject.ID()

addBehavior

public void addBehavior(Behavior to)
Manipulation of Behavior objects, which includes movement, speech, spellcasting, etc, etc.

Specified by:
addBehavior in interface Behavable
Parameters:
to - The behavior object to add.
See Also:
Behavior, Affectable.recoverPhyStats()

delBehavior

public void delBehavior(Behavior to)
Description copied from interface: Behavable
Delete a behavior from this object. After calling this method, recoverPhyStats() should be called next in case this behavior object modified the stats.

Specified by:
delBehavior in interface Behavable
Parameters:
to - The behavior object to remove.
See Also:
Behavior, Affectable.recoverPhyStats()

delAllBehaviors

public void delAllBehaviors()
Description copied from interface: Behavable
Removes all behaviors from this object.

Specified by:
delAllBehaviors in interface Behavable

numBehaviors

public int numBehaviors()
Description copied from interface: Behavable
The number of behaviors this object has.

Specified by:
numBehaviors in interface Behavable
Returns:
the number of behaviors
See Also:
Behavior

behaviors

public java.util.Enumeration<Behavior> behaviors()
Description copied from interface: Behavable
Returns an enumerator of all the behaviors on this object.

Specified by:
behaviors in interface Behavable
Returns:
an enumerator of all the behaviors on this object.
See Also:
Behavior

fetchBehavior

public Behavior fetchBehavior(int index)
Description copied from interface: Behavable
Returns a behavior object on this object. May return null even if the index is correct to mark a race condition.

Specified by:
fetchBehavior in interface Behavable
Parameters:
index - which object to return
Returns:
the behavior object
See Also:
Behavior, Behavable.numBehaviors()

fetchBehavior

public Behavior fetchBehavior(java.lang.String ID)
Description copied from interface: Behavable
Returns a behavior object listed on this object. The object will be the one with the same ID() string as passed in.

Specified by:
fetchBehavior in interface Behavable
Parameters:
ID - the Behavior ID to look for
Returns:
the behavior object
See Also:
Behavior, CMObject.ID()

eachBehavior

public void eachBehavior(EachApplicable<Behavior> applier)
Description copied from interface: Behavable
Applies the given code to each behavior on this object

Specified by:
eachBehavior in interface Behavable
Parameters:
applier - code to execute against each object

addScript

public void addScript(ScriptingEngine S)
Manipulation of the scripts list

Specified by:
addScript in interface Behavable
Parameters:
S - the scripting engine, fully populated, to add
See Also:
ScriptingEngine

delScript

public void delScript(ScriptingEngine S)
Description copied from interface: Behavable
Remove a running script from this object.

Specified by:
delScript in interface Behavable
Parameters:
S - the specific scripting engine to remove
See Also:
ScriptingEngine

delAllScripts

public void delAllScripts()
Description copied from interface: Behavable
Removes all executing scripts from this object.

Specified by:
delAllScripts in interface Behavable

numScripts

public int numScripts()
Description copied from interface: Behavable
Return the number of scripts running on this object

Specified by:
numScripts in interface Behavable
Returns:
number of scripts

scripts

public java.util.Enumeration<ScriptingEngine> scripts()
Description copied from interface: Behavable
Returns an enumerator of all the scripts on this object.

Specified by:
scripts in interface Behavable
Returns:
an enumerator of all the scripts on this object.
See Also:
ScriptingEngine

fetchScript

public ScriptingEngine fetchScript(int x)
Description copied from interface: Behavable
Retrieve one of the enumerated scripts running on this object

Specified by:
fetchScript in interface Behavable
Parameters:
x - which script to return
Returns:
the scripting engine
See Also:
ScriptingEngine

eachScript

public void eachScript(EachApplicable<ScriptingEngine> applier)
Description copied from interface: Behavable
Applies the given code to each scripting engine on this object

Specified by:
eachScript in interface Behavable
Parameters:
applier - code to execute against each object

L

public java.lang.String L(java.lang.String str,
                          java.lang.String... xs)
Description copied from interface: Environmental
Localize an internal string -- shortcut. Same as calling:

Specified by:
L in interface Environmental
Parameters:
str - the string to translate
xs - the array of variables to replace
Returns:
the translated string, with all variables in place
See Also:
Call with the string to translate, which may contain variables of the form @x1, @x2, etc. The array in xs is then used to replace the variables AFTER the string is translated.

getSaveStatIndex

public int getSaveStatIndex()
Description copied from interface: Modifiable
Returns the index into the stat codes array where extra savable fields begins. This number is always the same as getStatCodes().length unless there are extra fields which need to be saved in xml for generic objects. This method is used by editors for post-build user-defined fields.

Specified by:
getSaveStatIndex in interface Modifiable
Returns:
the index into getStatCodes()
See Also:
Modifiable.getStatCodes(), Modifiable.getStat(String), Modifiable.setStat(String, String)

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
Returns:
list of the fields which may be set.
See Also:
Modifiable.getStat(String), Modifiable.setStat(String, String)

isStat

public boolean isStat(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:
isStat in interface Modifiable
Parameters:
code - the name of the field to read.
Returns:
true if the code is a real value, false otherwise
See Also:
Modifiable.getStatCodes()

getCodeNum

protected int getCodeNum(java.lang.String code)

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
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
Parameters:
code - the name of the field to set
val - the value to set the field to
See Also:
Modifiable.getStatCodes()

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
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)