com.planet_ink.coffee_mud.Locales.interfaces
Interface Room

All Superinterfaces:
Affectable, Behavable, java.lang.Cloneable, CMObject, java.lang.Comparable<CMObject>, Contingent, Environmental, ItemCollection, ItemPossessor, Modifiable, MsgListener, Physical, PhysicalAgent, Places, StatsAffecting, Tickable
All Known Subinterfaces:
GridLocale, LocationRoom
All Known Implementing Classes:
CaveGrid, CaveMaze, CaveRoom, CaveSurface, CityStreet, ClimbableLedge, ClimbableSurface, Desert, DesertGrid, DesertMaze, DesertThinGrid, EndlessOcean, EndlessSky, EndlessThinOcean, EndlessThinSky, FrozenMountains, FrozenPlains, GreatLake, GreatThinLake, HideoutShelter, Hills, HillsGrid, HillsThinGrid, HotRoom, IcePlains, IceRoom, IndoorInTheAir, IndoorShallowWater, IndoorUnderWater, IndoorUnderWaterColumnGrid, IndoorUnderWaterGrid, IndoorUnderWaterThinGrid, IndoorWaterSurface, IndoorWaterSurfaceColumn, IndoorWaterThinSurface, InTheAir, Jungle, JungleGrid, JungleThinGrid, LargeCaveRoom, LargeStoneRoom, LargeWoodRoom, LongerRoad, LongestRoad, LongRoad, MagicFreeRoom, MagicShelter, MetalRoom, MetalRoomMaze, Mountains, MountainsGrid, MountainsMaze, MountainsThinGrid, MountainSurface, MountainSurfaceGrid, MountainSurfaceThinGrid, OceanGrid, OceanThinGrid, OverTheLedge, Plains, PlainsGrid, PlainsThinGrid, Road, RoadGrid, RoadThinGrid, SaltWaterSurface, SaltWaterSurfaceColumn, SaltWaterThinSurface, SeaPort, SewerMaze, SewerRoom, ShallowWater, Shore, SpacePort, StdGrid, StdMaze, StdRoom, StdThinGrid, StoneGrid, StoneMaze, StoneRoom, StoneThinGrid, Swamp, SwampGrid, SwampThinGrid, ThinRoom, TreeSurface, UnderSaltWater, UnderSaltWaterColumnGrid, UnderSaltWaterGrid, UnderSaltWaterMaze, UnderSaltWaterThinGrid, UnderWater, UnderWaterColumnGrid, UnderWaterGrid, UnderWaterMaze, UnderWaterThinGrid, WaterSurface, WaterSurfaceColumn, WaterThinSurface, WetCaveGrid, WetCaveMaze, WetCaveRoom, Whirlpool, WoodenDeck, WoodRoom, WoodRoomGrid, WoodRoomMaze, WoodRoomThinGrid, Woods, WoodsGrid, WoodsMaze, WoodsThinGrid

public interface Room
extends PhysicalAgent, ItemPossessor, Places

A Room, also known as a Locale, is the basic building blocks of a world map. They represent abstract places where players, mobs, or items can be. Rooms have titles, dynamic or static descriptions, automatic "skys", domain codes to guide the engine on its physical makeup, gatherable resources, exits to other Rooms, and can each have their own behaviors and properties.


Nested Class Summary
static class Room.VariationCode
          Room titles and descriptions can be coded with xml/html-like tags that denote different parts that are shown or hidden depending on the weather, the season, the time of day, or even whether the player has been to the room before.
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.core.interfaces.ItemPossessor
ItemPossessor.Expire, ItemPossessor.Find, ItemPossessor.Move
 
Field Summary
static java.util.Map<java.lang.Object,java.lang.Integer> DOMAIN_INDOOR_MAP
          A map of indoor domain descs strings to their ordinal integer
static int DOMAIN_INDOORS_AIR
          Domain type mask denoting whether the room is indoors, but in the air @see domainType()
static int DOMAIN_INDOORS_CAVE
          Domain type mask denoting whether the room is indoors, and made of unworked/natural stone @see domainType()
static java.lang.String[] DOMAIN_INDOORS_DESCS
          Domain description array indexed by the (DOMAIN_INDOORS_* - Room.INDOORS) constants.
static int DOMAIN_INDOORS_MAGIC
          Domain type mask denoting whether the room is indoors, and made of maaaagic @see domainType()
static int DOMAIN_INDOORS_METAL
          Domain type mask denoting whether the room is indoors, and made of metal @see domainType()
static int DOMAIN_INDOORS_STONE
          Domain type mask denoting whether the room is indoors, and made of worked stone @see domainType()
static int DOMAIN_INDOORS_UNDERWATER
          Domain type mask denoting whether the room is indoors, and underwater @see domainType()
static int DOMAIN_INDOORS_WATERSURFACE
          Domain type mask denoting whether the room is indoors, with a watery surface @see domainType()
static int DOMAIN_INDOORS_WOOD
          Domain type mask denoting whether the room is indoors, and made of wood @see domainType()
static java.lang.String[] DOMAIN_OUTDOOR_DESCS
          Domain description array indexed by the DOMAIN_OUTDOOR_* constants.
static java.util.Map<java.lang.Object,java.lang.Integer> DOMAIN_OUTDOOR_MAP
          A map of outdoor domain descs strings to their ordinal integer
static int DOMAIN_OUTDOORS_AIR
          Domain type mask denoting whether the room is outdoors, up in the sky @see domainType()
static int DOMAIN_OUTDOORS_CITY
          Domain type mask denoting whether the room is outdoors, in the city @see domainType()
static int DOMAIN_OUTDOORS_DESERT
          Domain type mask denoting whether the room is outdoors, in the desert @see domainType()
static int DOMAIN_OUTDOORS_HILLS
          Domain type mask denoting whether the room is outdoors, in the hills @see domainType()
static int DOMAIN_OUTDOORS_JUNGLE
          Domain type mask denoting whether the room is outdoors, in the jungle @see domainType()
static int DOMAIN_OUTDOORS_MOUNTAINS
          Domain type mask denoting whether the room is outdoors, in the mountains @see domainType()
static int DOMAIN_OUTDOORS_PLAINS
          Domain type mask denoting whether the room is outdoors, in the grassy plains @see domainType()
static int DOMAIN_OUTDOORS_ROCKS
          Domain type mask denoting whether the room is outdoors, in the rocky wastes @see domainType()
static int DOMAIN_OUTDOORS_SEAPORT
          Domain type mask denoting whether the room is outdoors, at a seaport @see domainType()
static int DOMAIN_OUTDOORS_SPACEPORT
          Domain type mask denoting whether the room is outdoors, at a spaceport @see domainType()
static int DOMAIN_OUTDOORS_SWAMP
          Domain type mask denoting whether the room is outdoors, in the swamp @see domainType()
static int DOMAIN_OUTDOORS_UNDERWATER
          Domain type mask denoting whether the room is outdoors, but underwater (think ocean) @see domainType()
static int DOMAIN_OUTDOORS_WATERSURFACE
          Domain type mask denoting whether the room is outdoors, on the surface of the water @see domainType()
static int DOMAIN_OUTDOORS_WOODS
          Domain type mask denoting whether the room is outdoors, in the woods @see domainType()
static Filterer<Environmental> FILTER_ROOMONLY
          a constant used in the Locale item search classes to filter on only items in rooms
static int INDOORS
          Domain type mask denoting whether the room is indoor (has a roof) @see domainType()
 
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
 
Method Summary
 void addInhabitant(MOB mob)
          Adds the given mob to this room as an inhabitant.
 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.
 void delAllInhabitants(boolean destroy)
          Removes all the mobs from this room as inhabitants and optionally destroys the mob objects as well.
 void delInhabitant(MOB mob)
          Removes the given mob from this room as an inhabitant.
 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 eachInhabitant(EachApplicable<MOB> applier)
          Applies the given applier Java code to each mob in this room
 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.
 Area getArea()
          Returns the Area to which this room belongs.
 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.
 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.
 Exit getRawExit(int direction)
          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.
 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.
 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.util.Enumeration<MOB> inhabitants()
          Returns an enumeration of all the inhabitants of this room.
 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.
 int maxRange()
          Returns the maximum range for ranged weapons in this room.
 int myResource()
          Returns the full resource code for the current gatherable resource in this room.
 int numInhabitants()
          Returns the number of all the inhabitants of this room.
 int numPCInhabitants()
          Returns the number of player/PC inhabitants of this room.
 int pointsPerMove()
          Returns the number of movement points to move through this room.
 Room prepareRoomInDir(Room fromRoom, 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.
 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.
 void send(MOB source, CMMsg msg)
          Sends the message to the given source, then to the room, and then handles any trailing messages.
 void sendOthers(MOB source, CMMsg msg)
          Sends the message to the room, skipping the given source, and then handles any trailing messages.
 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 setCombatTurnMobIndex(int index)
          Sets the index number which represents which mob's "turn" it is in combat.
 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 setRawExit(int direction, Exit E)
          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 newRoomID)
          Changes the room ID of this room.
 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.
 int thirstPerRound()
          Returns the amount of thirst generated by moving through this room.
 void toggleMobility(boolean onoff)
          Sets or clears whether any mobs in this room may, in fact, leave it.
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.ItemPossessor
addItem, moveItemTo, moveItemTo
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.ItemCollection
addItem, delAllItems, delItem, eachItem, findItem, findItem, findItems, findItems, getItem, getRandomItem, isContent, items, numItems
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Places
getAtmosphere, getAtmosphereCode, getClimateType, getClimateTypeCode, setAtmosphere, setClimateType
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Physical
description, displayText, name
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Environmental
description, displayText, expirationDate, image, isGeneric, L, minRange, miscTextFormat, Name, rawImage, sameAs, setDescription, setDisplayText, setExpirationDate, setImage, setMiscText, setName, text
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Tickable
getTickStatus, tick
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.StatsAffecting
affectCharState, affectCharStats, affectPhyStats
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.MsgListener
executeMsg, okMessage
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Contingent
amDestroyed, destroy, isSavable, setSavable
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, ID, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Modifiable
getSaveStatIndex, getStat, getStatCodes, isStat, setStat
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Affectable
addEffect, addNonUninvokableEffect, basePhyStats, delAllEffects, delEffect, eachEffect, effects, fetchEffect, fetchEffect, numEffects, phyStats, recoverPhyStats, setBasePhyStats
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Behavable
addBehavior, addScript, behaviors, delAllBehaviors, delAllScripts, delBehavior, delScript, eachBehavior, eachScript, fetchBehavior, fetchBehavior, fetchScript, numBehaviors, numScripts, scripts
 

Field Detail

INDOORS

static final int INDOORS
Domain type mask denoting whether the room is indoor (has a roof) @see domainType()

See Also:
Constant Field Values

DOMAIN_OUTDOORS_CITY

static final int DOMAIN_OUTDOORS_CITY
Domain type mask denoting whether the room is outdoors, in the city @see domainType()

See Also:
Constant Field Values

DOMAIN_OUTDOORS_WOODS

static final int DOMAIN_OUTDOORS_WOODS
Domain type mask denoting whether the room is outdoors, in the woods @see domainType()

See Also:
Constant Field Values

DOMAIN_OUTDOORS_ROCKS

static final int DOMAIN_OUTDOORS_ROCKS
Domain type mask denoting whether the room is outdoors, in the rocky wastes @see domainType()

See Also:
Constant Field Values

DOMAIN_OUTDOORS_PLAINS

static final int DOMAIN_OUTDOORS_PLAINS
Domain type mask denoting whether the room is outdoors, in the grassy plains @see domainType()

See Also:
Constant Field Values

DOMAIN_OUTDOORS_UNDERWATER

static final int DOMAIN_OUTDOORS_UNDERWATER
Domain type mask denoting whether the room is outdoors, but underwater (think ocean) @see domainType()

See Also:
Constant Field Values

DOMAIN_OUTDOORS_AIR

static final int DOMAIN_OUTDOORS_AIR
Domain type mask denoting whether the room is outdoors, up in the sky @see domainType()

See Also:
Constant Field Values

DOMAIN_OUTDOORS_WATERSURFACE

static final int DOMAIN_OUTDOORS_WATERSURFACE
Domain type mask denoting whether the room is outdoors, on the surface of the water @see domainType()

See Also:
Constant Field Values

DOMAIN_OUTDOORS_JUNGLE

static final int DOMAIN_OUTDOORS_JUNGLE
Domain type mask denoting whether the room is outdoors, in the jungle @see domainType()

See Also:
Constant Field Values

DOMAIN_OUTDOORS_SWAMP

static final int DOMAIN_OUTDOORS_SWAMP
Domain type mask denoting whether the room is outdoors, in the swamp @see domainType()

See Also:
Constant Field Values

DOMAIN_OUTDOORS_DESERT

static final int DOMAIN_OUTDOORS_DESERT
Domain type mask denoting whether the room is outdoors, in the desert @see domainType()

See Also:
Constant Field Values

DOMAIN_OUTDOORS_HILLS

static final int DOMAIN_OUTDOORS_HILLS
Domain type mask denoting whether the room is outdoors, in the hills @see domainType()

See Also:
Constant Field Values

DOMAIN_OUTDOORS_MOUNTAINS

static final int DOMAIN_OUTDOORS_MOUNTAINS
Domain type mask denoting whether the room is outdoors, in the mountains @see domainType()

See Also:
Constant Field Values

DOMAIN_OUTDOORS_SPACEPORT

static final int DOMAIN_OUTDOORS_SPACEPORT
Domain type mask denoting whether the room is outdoors, at a spaceport @see domainType()

See Also:
Constant Field Values

DOMAIN_OUTDOORS_SEAPORT

static final int DOMAIN_OUTDOORS_SEAPORT
Domain type mask denoting whether the room is outdoors, at a seaport @see domainType()

See Also:
Constant Field Values

DOMAIN_OUTDOOR_DESCS

static final java.lang.String[] DOMAIN_OUTDOOR_DESCS
Domain description array indexed by the DOMAIN_OUTDOOR_* constants. @see DOMAIN_OUTDOORS_CITY


DOMAIN_OUTDOOR_MAP

static final java.util.Map<java.lang.Object,java.lang.Integer> DOMAIN_OUTDOOR_MAP
A map of outdoor domain descs strings to their ordinal integer


DOMAIN_INDOORS_STONE

static final int DOMAIN_INDOORS_STONE
Domain type mask denoting whether the room is indoors, and made of worked stone @see domainType()

See Also:
Constant Field Values

DOMAIN_INDOORS_WOOD

static final int DOMAIN_INDOORS_WOOD
Domain type mask denoting whether the room is indoors, and made of wood @see domainType()

See Also:
Constant Field Values

DOMAIN_INDOORS_CAVE

static final int DOMAIN_INDOORS_CAVE
Domain type mask denoting whether the room is indoors, and made of unworked/natural stone @see domainType()

See Also:
Constant Field Values

DOMAIN_INDOORS_MAGIC

static final int DOMAIN_INDOORS_MAGIC
Domain type mask denoting whether the room is indoors, and made of maaaagic @see domainType()

See Also:
Constant Field Values

DOMAIN_INDOORS_UNDERWATER

static final int DOMAIN_INDOORS_UNDERWATER
Domain type mask denoting whether the room is indoors, and underwater @see domainType()

See Also:
Constant Field Values

DOMAIN_INDOORS_AIR

static final int DOMAIN_INDOORS_AIR
Domain type mask denoting whether the room is indoors, but in the air @see domainType()

See Also:
Constant Field Values

DOMAIN_INDOORS_WATERSURFACE

static final int DOMAIN_INDOORS_WATERSURFACE
Domain type mask denoting whether the room is indoors, with a watery surface @see domainType()

See Also:
Constant Field Values

DOMAIN_INDOORS_METAL

static final int DOMAIN_INDOORS_METAL
Domain type mask denoting whether the room is indoors, and made of metal @see domainType()

See Also:
Constant Field Values

DOMAIN_INDOORS_DESCS

static final java.lang.String[] DOMAIN_INDOORS_DESCS
Domain description array indexed by the (DOMAIN_INDOORS_* - Room.INDOORS) constants. @see DOMAIN_INDOORS_STONE


DOMAIN_INDOOR_MAP

static final java.util.Map<java.lang.Object,java.lang.Integer> DOMAIN_INDOOR_MAP
A map of indoor domain descs strings to their ordinal integer


FILTER_ROOMONLY

static final Filterer<Environmental> FILTER_ROOMONLY
a constant used in the Locale item search classes to filter on only items in rooms

Method Detail

roomID

java.lang.String roomID()
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.

Returns:
room ID is the "address" of the primary room on the world map
See Also:
setRoomID(String)

setRoomID

void setRoomID(java.lang.String newRoomID)
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.

Parameters:
newRoomID - the new room ID of this room
See Also:
roomID()

domainType

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.

Returns:
the domain-code for this room
See Also:
INDOORS, DOMAIN_INDOORS_CAVE, DOMAIN_INDOORS_DESCS, DOMAIN_OUTDOORS_CITY, DOMAIN_OUTDOOR_DESCS

myResource

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

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

setResource

void setResource(int resourceCode)
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.

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

resourceChoices

java.util.List<java.lang.Integer> resourceChoices()
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.

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

toggleMobility

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

Parameters:
onoff - true to allow mobility, false to disallow mobility

getMobility

boolean getMobility()
Gets whether any mobs in this room may, in fact, leave it. This applies to player and npc mobs equally.

Returns:
true if anyone can leave this room, false otherwise

startItemRejuv

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. Rejuvinating items are items that once, removed from a room, restore themselves after the rejuv-time clears.


recoverRoomStats

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.

See Also:
Affectable.recoverPhyStats(), MOB.recoverCharStats()

clearSky

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.

See Also:
giveASky(int), getSky()

giveASky

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.

Parameters:
depth - the diameter of the sky or underwater to create
See Also:
clearSky(), getSky()

getSky

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.

See Also:
clearSky(), getSky()

getArea

Area getArea()
Returns the Area to which this room belongs. Guaranteed to be non-null.

Returns:
the Area to which this room belongs
See Also:
setArea(Area), Area

setArea

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.

Parameters:
newArea - the new area that this room belongs ro
See Also:
Area, getArea()

setGridParent

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.

Parameters:
room - the GridLocale parent room to this room
See Also:
getGridParent(), GridLocale

getGridParent

GridLocale getGridParent()
If this room is a grid-child room, this method is called to return the identity of its parent gridlocale room.

Returns:
the GridLocale parent room to this room
See Also:
setGridParent(GridLocale), GridLocale

rawDoors

Room[] rawDoors()
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 getRoomInDir(int) if you want a proper Room object. These rooms are indexed by Direction code.

Returns:
an array of Raw room objects that this room connects to
See Also:
Directions, prepareRoomInDir(Room, int), getRawExit(int)

getRoomInDir

Room getRoomInDir(int direction)
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.

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

maxRange

int maxRange()
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
Returns:
the maximum range

prepareRoomInDir

Room prepareRoomInDir(Room fromRoom,
                      int direction)
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".

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

getRawExit

Exit getRawExit(int direction)
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 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.

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

setRawExit

void setRawExit(int direction,
                Exit E)
Sets the Exit object found in this room in the given direction.

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

getReverseExit

Exit getReverseExit(int direction)
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.

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:
getRawExit(int), getExitInDir(int), setRawExit(int, Exit), getPairedExit(int), fetchExit(String), Directions, Exit

getPairedExit

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

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:
getRawExit(int), getExitInDir(int), setRawExit(int, Exit), getReverseExit(int), fetchExit(String), Directions, Exit

getExitInDir

Exit getExitInDir(int direction)
Returns the Exit in this room, in the given direction.

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

fetchExit

Exit fetchExit(java.lang.String itemID)
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.

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

getCombatTurnMobIndex

int getCombatTurnMobIndex()
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.

Returns:
the index number which represents which mob's "turn" it is in combat

setCombatTurnMobIndex

void setCombatTurnMobIndex(int index)
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.

Parameters:
index - the index number which represents which mob's "turn" it is in combat

pointsPerMove

int pointsPerMove()
Returns the number of movement points to move through this room. Depends on the weather and the room type, mostly.

Returns:
the number of movement points to move through this room

thirstPerRound

int thirstPerRound()
Returns the amount of thirst generated by moving through this room. Depends on the weather and the room type, mostly.

Returns:
the amount of thirst generated by moving through this room

send

void send(MOB source,
          CMMsg msg)
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.

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

sendOthers

void sendOthers(MOB source,
                CMMsg msg)
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.

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

showHappens

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. This should be used very sparingly for acts-of-God.

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

showHappens

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. This should be used very sparingly for acts-of-objects.

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, show(MOB, Environmental, Environmental, int, String), showHappens(int, Environmental, String), send(MOB, CMMsg), show(MOB, Environmental, Environmental, int, String, int, String, int, String)

show

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.

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:
send(MOB, CMMsg), MsgListener.okMessage(Environmental, CMMsg), CMMsg.source(), CMMsg.target(), CMMsg.sourceCode(), CMMsg.sourceMessage()

show

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.

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:
send(MOB, CMMsg), MsgListener.okMessage(Environmental, CMMsg), CMMsg.source(), CMMsg.target(), CMMsg.tool(), CMMsg.sourceCode(), CMMsg.sourceMessage()

show

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.

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:
send(MOB, CMMsg), MsgListener.okMessage(Environmental, CMMsg), CMMsg.source(), CMMsg.target(), CMMsg.tool(), CMMsg.sourceCode(), CMMsg.targetCode(), CMMsg.othersCode(), CMMsg.sourceMessage()

show

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.

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

show

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.

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:
send(MOB, CMMsg), MsgListener.okMessage(Environmental, CMMsg), CMMsg.source(), CMMsg.target(), CMMsg.tool(), CMMsg.sourceCode(), CMMsg.sourceMessage(), CMMsg.targetMessage(), CMMsg.othersMessage()

showOthers

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.

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:
sendOthers(MOB, CMMsg), MsgListener.okMessage(Environmental, CMMsg), CMMsg.source(), CMMsg.target(), CMMsg.sourceCode(), CMMsg.sourceMessage()

showSource

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.

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

showOthers

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.

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:
sendOthers(MOB, CMMsg), MsgListener.okMessage(Environmental, CMMsg), CMMsg.source(), CMMsg.target(), CMMsg.tool(), CMMsg.sourceCode(), CMMsg.sourceMessage()

showSource

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.

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

isHere

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

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

fetchInhabitant

MOB fetchInhabitant(java.lang.String inhabitantID)
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.

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

fetchInhabitantExact

MOB fetchInhabitantExact(java.lang.String inhabitantID)
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.

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

fetchInhabitants

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. If nothing is found, it does a substring search as well.

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

fetchRandomInhabitant

MOB fetchRandomInhabitant()
Returns a random inhabitant mob in this room, or null if there are none.

Returns:
the random mob inhabitant
See Also:
fetchInhabitant(String), fetchInhabitant(int), fetchInhabitants(String), isInhabitant(MOB), delAllInhabitants(boolean), inhabitants(), delInhabitant(MOB), isInhabitant(MOB), numInhabitants(), bringMobHere(MOB, boolean), numPCInhabitants(), eachInhabitant(EachApplicable)

fetchInhabitant

MOB fetchInhabitant(int i)
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.

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

inhabitants

java.util.Enumeration<MOB> inhabitants()
Returns an enumeration of all the inhabitants of this room.

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

addInhabitant

void addInhabitant(MOB mob)
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

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

delInhabitant

void delInhabitant(MOB mob)
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

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

delAllInhabitants

void delAllInhabitants(boolean destroy)
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.

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

numInhabitants

int numInhabitants()
Returns the number of all the inhabitants of this room.

Returns:
the number of inhabitants
See Also:
fetchInhabitant(String), fetchInhabitant(int), fetchInhabitants(String), fetchRandomInhabitant(), delAllInhabitants(boolean), addInhabitant(MOB), delInhabitant(MOB), isInhabitant(MOB), inhabitants(), bringMobHere(MOB, boolean), numPCInhabitants(), eachInhabitant(EachApplicable)

isInhabitant

boolean isInhabitant(MOB mob)
Returns whether the given mob is an inhabitant of this room.

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

eachInhabitant

void eachInhabitant(EachApplicable<MOB> applier)
Applies the given applier Java code to each mob in this room

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

numPCInhabitants

int numPCInhabitants()
Returns the number of player/PC inhabitants of this room.

Returns:
the number of player inhabitants
See Also:
fetchInhabitant(String), fetchInhabitant(int), fetchInhabitants(String), fetchRandomInhabitant(), delAllInhabitants(boolean), addInhabitant(MOB), delInhabitant(MOB), isInhabitant(MOB), inhabitants(), bringMobHere(MOB, boolean), numInhabitants(), eachInhabitant(EachApplicable)

bringMobHere

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. It does not affect those that the given mob are themselves following, however.

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

getContextName

java.lang.String getContextName(Environmental E)
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.

Parameters:
E - the mob or item to return a search string for
Returns:
the specific search string that returns the given object

fetchFromRoomFavorExits

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

Parameters:
thingName - the search string
Returns:
the exit, mob, or item found.

fetchFromRoomFavorItems

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

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

fetchFromRoomFavorMOBs

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

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

fetchFromMOBRoomItemExit

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

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

fetchFromMOBRoomFavorsItems

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

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

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

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