com.planet_ink.coffee_mud.Locales
Class ThinRoom

java.lang.Object
  extended by com.planet_ink.coffee_mud.Locales.ThinRoom
All Implemented Interfaces:
Affectable, Behavable, CMModifiable, CMObject, Environmental, MsgListener, StatsAffecting, Tickable, Room, java.lang.Cloneable, java.lang.Comparable<CMObject>

public class ThinRoom
extends java.lang.Object
implements Room


Field Summary
protected static java.util.Vector empty
           
protected static EnvStats envStats
           
protected static Exit[] exits
           
protected  Area myArea
           
protected  java.lang.String roomID
           
protected static Room[] rooms
           
 
Fields inherited from interface com.planet_ink.coffee_mud.Locales.interfaces.Room
CONDITION_COLD, CONDITION_HOT, CONDITION_NORMAL, CONDITION_WET, DOMAIN_INDOORS_AIR, DOMAIN_INDOORS_CAVE, DOMAIN_INDOORS_MAGIC, DOMAIN_INDOORS_METAL, DOMAIN_INDOORS_STONE, DOMAIN_INDOORS_UNDERWATER, DOMAIN_INDOORS_WATERSURFACE, DOMAIN_INDOORS_WOOD, 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_SPACEPORT, DOMAIN_OUTDOORS_SWAMP, DOMAIN_OUTDOORS_UNDERWATER, DOMAIN_OUTDOORS_WATERSURFACE, DOMAIN_OUTDOORS_WOODS, indoorDomainDescs, INDOORS, outdoorDomainDescs, variationCodes
 
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_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_EMAIL, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MOB, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SPELL_AFFECT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET, TICKMASK_SOLITARY, TICKS_PER_RLMIN, TIME_MILIS_PER_MUDHOUR, TIME_TICK, TIME_TICK_DOUBLE
 
Constructor Summary
ThinRoom()
           
 
Method Summary
 void addBehavior(Behavior to)
          Add a new behavior to this object.
 void addEffect(Ability to)
          Add a new effect to this object, whether permanent or temporary.
 void addInhabitant(MOB mob)
           
 void addItem(Item item)
           
 void addItemRefuse(Item item, int expireMins)
           
 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)
          Add a new runnable script to this object.
 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 affectEnvStats(Environmental affected, EnvStats affectableStats)
          This method is called by the recoverEnvStats() method on other Environmental objects.
 boolean amDestroyed()
          Whether the destroy() method has been previousy called on this object.
 EnvStats baseEnvStats()
          Object containing a set of base, unmodified, mostly numeric fields.
 void bringItemHere(Item item, int expireMins, boolean andRiders)
           
 void bringMobHere(MOB mob, boolean andFollowers)
           
 void clearSky()
           
 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 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)
           
 void delItem(Item item)
           
 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.
 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.
 int domainConditions()
           
 int domainType()
           
 EnvStats envStats()
          Object containing a set of current, modified, usable, mostly numeric fields.
 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.
 Item fetchAnyItem(java.lang.String itemID)
           
 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.
 Environmental fetchFromMOBRoomFavorsItems(MOB mob, Item goodLocation, java.lang.String thingName, int wornReqCode)
           
 Environmental fetchFromMOBRoomItemExit(MOB mob, Item goodLocation, java.lang.String thingName, int wornReqCode)
           
 Environmental fetchFromRoomFavorItems(Item goodLocation, java.lang.String thingName, int wornReqCode)
           
 Environmental fetchFromRoomFavorMOBs(Item goodLocation, java.lang.String thingName, int wornReqCode)
           
 MOB fetchInhabitant(int i)
           
 MOB fetchInhabitant(java.lang.String inhabitantID)
           
 Item fetchItem(int i)
           
 Item fetchItem(Item goodLocation, java.lang.String itemID)
           
 MOB fetchPCInhabitant(int i)
           
 ScriptingEngine fetchScript(int x)
          Retreive one of the enumerated scripts running on this object
protected  void finalize()
           
 Area getArea()
           
protected  int getCodeNum(java.lang.String code)
           
 java.lang.String getContextName(Environmental E)
           
 Exit getExitInDir(int direction)
           
 GridLocale getGridParent()
           
 boolean getMobility()
           
 Exit getPairedExit(int direction)
           
 Exit getRawExit(int dir)
           
 Exit getReverseExit(int direction)
           
 Room getRoomInDir(int direction)
           
 int getSaveStatIndex()
          Returns the index into the stat codes array where extra savable fields begins.
 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.
 long getTickStatus()
          A coded status for this object during the period where its tick method is being called.
 void giveASky(int zero)
           
 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.
 void initializeClass()
          Called ONCE after all objects are loaded, but before the map is read in during initialization.
 boolean isContent(Item item)
           
 boolean isGeneric()
          Whether the fields of this item are set in code, or set by builders.
 boolean isHere(Environmental E)
           
 boolean isInhabitant(MOB mob)
           
 boolean isSameRoom(java.lang.Object O)
           
 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.
 int maxRange()
          the maximum range of this object, if applicable.
 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.
 int myResource()
           
 java.lang.String name()
          The displayable name of this object.
 java.lang.String Name()
          The raw unmodified name of this object as stored in the database.
 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()
           
 int numItems()
           
 int numPCInhabitants()
           
 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.
 int pointsPerMove(MOB mob)
           
 Room prepareRoomInDir(Room R, int direction)
           
 Room[] rawDoors()
           
 java.lang.String rawImage()
          Returns the raw name of the image file to display for this object when MXP is used.
 void recoverEnvStats()
          This method copies the baseEnvStats() object into the envStats() object, then makes repeated calls to all surrounding objects with affectEnvStats(Environmental,EnvStats) method.
 void recoverRoomStats()
           
 void resetVectors()
           
 java.util.Vector resourceChoices()
           
 java.lang.String roomDescription()
           
 java.lang.String roomID()
           
 java.lang.String roomTitle()
           
 boolean sameAs(Environmental E)
          Whether this object instance is functionally identical to the object passed in.
 boolean savable()
          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.
 void send(MOB source, CMMsg msg)
           
 void sendOthers(MOB source, CMMsg msg)
           
 void setArea(Area newArea)
           
 void setBaseEnvStats(EnvStats newBaseEnvStats)
          Re-sets the object containing a set of base, unmodified, mostly numeric fields.
 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)
           
 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, Environmental E)
           
 void setResource(int resourceCode)
           
 void setRoomID(java.lang.String newRoomID)
           
 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)
           
 boolean show(MOB source, Environmental target, Environmental tool, int allCode, java.lang.String allMessage)
           
 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)
           
 boolean show(MOB source, Environmental target, Environmental tool, int allCode, java.lang.String srcMessage, java.lang.String tarMessage, java.lang.String othMessage)
           
 boolean show(MOB source, Environmental target, int allCode, java.lang.String allMessage)
           
 void showHappens(int allCode, Environmental like, java.lang.String allMessage)
           
 void showHappens(int allCode, java.lang.String allMessage)
           
 boolean showOthers(MOB source, Environmental target, Environmental tool, int allCode, java.lang.String allMessage)
           
 boolean showOthers(MOB source, Environmental target, int allCode, java.lang.String allMessage)
           
 boolean showSource(MOB source, Environmental target, Environmental tool, int allCode, java.lang.String allMessage)
           
 boolean showSource(MOB source, Environmental target, int allCode, java.lang.String allMessage)
           
 void startItemRejuv()
           
 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(MOB mob)
           
 boolean tick(Tickable ticking, int tickID)
          this is the method which is called periodically by the threading engine.
 void toggleMobility(boolean onoff)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

roomID

protected java.lang.String roomID

myArea

protected Area myArea

empty

protected static final java.util.Vector empty

exits

protected static final Exit[] exits

rooms

protected static final Room[] rooms

envStats

protected static final EnvStats envStats
Constructor Detail

ThinRoom

public ThinRoom()
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, MiscTech. The name is typically identical to the class name.

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

name

public java.lang.String name()
Description copied from interface: Environmental
The displayable name of this object. May be modified by envStats() object. Is derived from the Name().

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

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:
Environmental.name()

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

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

maxRange

public int maxRange()
Description copied from interface: Environmental
the maximum 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.

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

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

savable

public boolean savable()
Description copied from interface: Environmental
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:
savable in interface Environmental
Returns:
true, usually.

getTickStatus

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

roomID

public java.lang.String roomID()
Specified by:
roomID in interface Room

setRoomID

public void setRoomID(java.lang.String newRoomID)
Specified by:
setRoomID in interface Room

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

getContextName

public java.lang.String getContextName(Environmental E)
Specified by:
getContextName in interface Room

domainType

public int domainType()
Specified by:
domainType in interface Room

domainConditions

public int domainConditions()
Specified by:
domainConditions in interface Room

myResource

public int myResource()
Specified by:
myResource in interface Room

setResource

public void setResource(int resourceCode)
Specified by:
setResource in interface Room

resetVectors

public void resetVectors()
Specified by:
resetVectors in interface Room

resourceChoices

public java.util.Vector resourceChoices()
Specified by:
resourceChoices in interface Room

toggleMobility

public void toggleMobility(boolean onoff)
Specified by:
toggleMobility in interface Room

getMobility

public boolean getMobility()
Specified by:
getMobility in interface Room

isHere

public boolean isHere(Environmental E)
Specified by:
isHere in interface Room

setRawExit

public void setRawExit(int direction,
                       Environmental E)
Specified by:
setRawExit in interface Room

prepareRoomInDir

public Room prepareRoomInDir(Room R,
                             int direction)
Specified by:
prepareRoomInDir in interface Room

startItemRejuv

public void startItemRejuv()
Specified by:
startItemRejuv in interface Room

recoverRoomStats

public void recoverRoomStats()
Specified by:
recoverRoomStats in interface Room

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

clearSky

public void clearSky()
Specified by:
clearSky in interface Room

giveASky

public void giveASky(int zero)
Specified by:
giveASky in interface Room

isSameRoom

public boolean isSameRoom(java.lang.Object O)
Specified by:
isSameRoom in interface Room

getArea

public Area getArea()
Specified by:
getArea in interface Room

setArea

public void setArea(Area newArea)
Specified by:
setArea in interface Room

setGridParent

public void setGridParent(GridLocale room)
Specified by:
setGridParent in interface Room

getGridParent

public GridLocale getGridParent()
Specified by:
getGridParent in interface Room

rawDoors

public Room[] rawDoors()
Specified by:
rawDoors in interface Room

getRawExit

public Exit getRawExit(int dir)
Specified by:
getRawExit in interface Room

getReverseExit

public Exit getReverseExit(int direction)
Specified by:
getReverseExit in interface Room

getPairedExit

public Exit getPairedExit(int direction)
Specified by:
getPairedExit in interface Room

getRoomInDir

public Room getRoomInDir(int direction)
Specified by:
getRoomInDir in interface Room

getExitInDir

public Exit getExitInDir(int direction)
Specified by:
getExitInDir in interface Room

pointsPerMove

public int pointsPerMove(MOB mob)
Specified by:
pointsPerMove in interface Room

thirstPerRound

public int thirstPerRound(MOB mob)
Specified by:
thirstPerRound in interface Room

roomTitle

public java.lang.String roomTitle()
Specified by:
roomTitle in interface Room

roomDescription

public java.lang.String roomDescription()
Specified by:
roomDescription in interface Room

send

public void send(MOB source,
                 CMMsg msg)
Specified by:
send in interface