com.planet_ink.coffee_mud.Locales
Class StdThinGrid

java.lang.Object
  extended by com.planet_ink.coffee_mud.Locales.StdRoom
      extended by com.planet_ink.coffee_mud.Locales.StdThinGrid
All Implemented Interfaces:
GridZones, Affectable, Behavable, CMObject, Contingent, Environmental, ItemCollection, ItemPossessor, Modifiable, MsgListener, Physical, PhysicalAgent, Places, StatsAffecting, Tickable, GridLocale, Room, java.lang.Cloneable, java.lang.Comparable<CMObject>
Direct Known Subclasses:
DesertThinGrid, EndlessThinOcean, EndlessThinSky, GreatThinLake, HillsThinGrid, JungleThinGrid, MountainsThinGrid, MountainSurfaceThinGrid, OceanThinGrid, PlainsThinGrid, RoadThinGrid, StoneThinGrid, SwampThinGrid, UnderWaterThinGrid, WoodRoomThinGrid, WoodsThinGrid

public class StdThinGrid
extends StdRoom
implements GridLocale


Nested Class Summary
protected static class StdThinGrid.ThinGridEntry
           
protected static class StdThinGrid.ThinGridEntryConverter
           
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Locales.interfaces.GridLocale
GridLocale.CrossExit
 
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
 
Nested classes/interfaces inherited from interface com.planet_ink.coffee_mud.Areas.interfaces.GridZones
GridZones.XYVector
 
Field Summary
protected  java.lang.String[] descriptions
           
protected  java.lang.String[] displayTexts
           
protected  SVector<GridLocale.CrossExit> gridexits
           
protected  Exit ox
           
protected  SVector<StdThinGrid.ThinGridEntry> rooms
           
protected static boolean tickStarted
           
protected  int xsize
           
protected  int yLength
           
protected  int ysize
           
 
Fields inherited from class com.planet_ink.coffee_mud.Locales.StdRoom
affectPhyStats, affects, amDestroyed, atmosphere, basePhyStats, behaviors, cachedImageName, climask, combatTurnMobIndex, contents, description, displayText, doors, exits, expirationDate, gridParent, inhabitants, lastResourceTime, me, mobility, myArea, myID, myResource, name, phyStats, rawImageName, roomRecoverMarker, scripts, skyedYet, STDCODES, tickStatus, 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
StdThinGrid()
           
 
Method Summary
 void addOuterExit(GridLocale.CrossExit x)
          Normally the grid-child rooms can only exit to each other, or to the same places as the gridlocale host.
protected  Room alternativeLink(Room room, Room defaultRoom, int dir)
           
 void buildGrid()
          Called whenever structural changes are made to either the grid room, or one of the adjacent connecting rooms, this method will "rebuild" the grids internal structure as necessary.
 void clearGrid(Room bringBackHere)
          Empties the grid-children rooms of all contents, mob and item, and then destroys the internal grid-children rooms themselves.
protected  void cloneFix(Room E)
           
 void delOuterExit(GridLocale.CrossExit x)
          Normally the grid-child rooms can only exit to each other, or to the same places as the gridlocale host.
 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.
 void executeMsg(Environmental myHost, CMMsg msg)
          The general message event handler for the object.
protected  void fillExitsOfGridRoom(Room R, int x, int y)
           
 java.util.List<Room> getAllRooms()
          Returns a read-only list of grid-child rooms.
 java.util.List<Room> getAllRoomsFilled()
          Returns a read-only list of grid-child rooms, and any skys or seas attached to them.
 Room getAltRoomFrom(Room loc, int direction)
           
 java.util.Iterator<Room> getExistingRooms()
          Returns a read-only iterator over the existing grid-child rooms.
 Room getGridChild(GridZones.XYVector xy)
          Returns the Room object at the given coordinates.
 Room getGridChild(int x, int y)
          Returns the Room object at the given coordinates.
 Room getGridChild(java.lang.String childCode)
          Returns the fully-qualified Room ID of this room
 java.lang.String getGridChildCode(Room loc)
          Returns the fully-qualified Room ID of this room
 java.lang.String getGridChildLocaleID()
          Gets the Room ID() for the type of Java room class used to populate the grid.
 int getGridChildX(Room loc)
          Returns the X coordinate of the given Room object
 int getGridChildY(Room loc)
          Returns the Y coordinate of the given Room object
protected  Room getGridRoomIfExists(int x, int y)
           
protected  Room getMakeGridRoom(int x, int y)
           
protected  Room getMakeSingleGridRoom(int x, int y)
           
 Room getRandomGridChild()
          Returns a random Room object that is a child of this one.
 GridZones.XYVector getRoomXY(Room room)
          Returns the XY coordinates of the Room, if a child of this gridzone, in XYVector format.
 GridZones.XYVector getRoomXY(java.lang.String roomID)
          Returns the XY coordinates of the Room with the given roomID in XYVector format.
 java.lang.String getStat(java.lang.String code)
          An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders.
 java.lang.String[] getStatCodes()
          Returns an array of the string names of those fields which are modifiable on this object at run-time by builders.
protected  int getStdGridCodeNum(java.lang.String code)
           
protected  void halfLink(Room room, Room loc, int dirCode, Exit o)
           
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 boolean isMyGridChild(Room loc)
          Returns whether the given Room is a child of this particular Grid instance.
protected  void linkRoom(Room room, Room loc, int dirCode, Exit o, Exit ao)
           
 boolean okMessage(Environmental myHost, CMMsg msg)
          The general message event previewer for the object.
 java.util.Iterator<GridLocale.CrossExit> outerExits()
          Normally the grid-child rooms can only exit to each other, or to the same places as the gridlocale host.
 Room prepareGridLocale(Room fromRoom, Room toRoom, int direction)
          Returns the room found in the given direction from the from-room, where the stand-in room is the to-room.
 Room prepareRoomInDir(Room fromRoom, int direction)
          This method is called by an adjoining room to resolve this room to its final object.
 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 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.
 void setXGridSize(int x)
          Sets the total width of this grid.
 void setYGridSize(int y)
          Sets the total height of this grid.
 void tryFillInExtraneousExternal(GridLocale.CrossExit EX, Exit ox, Room linkFrom)
           
 int xGridSize()
          Returns the total width of this grid.
 int yGridSize()
          Returns the total height of this grid
 
Methods inherited from class com.planet_ink.coffee_mud.Locales.StdRoom
addBehavior, addEffect, addInhabitant, addItem, addItem, addNonUninvokableEffect, addScript, affectCharState, affectCharStats, affectPhyStats, amDestroyed, basePhyStats, baseThirst, behaviors, bringMobHere, clearSky, compareTo, copyOf, delAllBehaviors, delAllEffects, delAllInhabitants, delAllItems, delAllScripts, delBehavior, delEffect, delInhabitant, delItem, delScript, description, description, displayText, displayText, domainType, eachBehavior, eachEffect, eachInhabitant, eachItem, eachScript, effects, expirationDate, fetchBehavior, fetchBehavior, fetchEffect, fetchEffect, fetchExit, fetchFromMOBRoomFavorsItems, fetchFromMOBRoomFavorsMOBs, fetchFromMOBRoomItemExit, fetchFromRoomFavorExits, fetchFromRoomFavorItems, fetchFromRoomFavorMOBs, fetchInhabitant, fetchInhabitant, fetchInhabitantExact, fetchInhabitants, fetchRandomInhabitant, fetchScript, findItem, findItem, findItems, findItems, getArea, getAtmosphere, getAtmosphereCode, getClimateType, getClimateTypeCode, getCodeNum, getCombatTurnMobIndex, getContextName, getExitInDir, getGridParent, getItem, getMobility, getPairedExit, getRandomItem, getRawExit, getReverseExit, getRoomInDir, getSaveStatIndex, getSky, getTickStatus, giveASky, image, inhabitants, initializeClass, insertItemUpTop, isContent, isGeneric, isHere, isInhabitant, isSavable, isStat, items, L, maxRange, minRange, miscTextFormat, moveItemTo, moveItemTo, myResource, name, Name, name, newInstance, numBehaviors, numEffects, numInhabitants, numItems, numPCInhabitants, numScripts, parseVaries, parseVariesCodes, phyStats, pointsPerMove, rawDoors, rawImage, recoverPhyStats, recoverRoomStats, resourceChoices, roomID, sameAs, scripts, send, sendAndExec, sendOthers, sendTrailermsgs, setArea, setAtmosphere, setBasePhyStats, setClimateType, setCombatTurnMobIndex, setExpirationDate, setGridParent, setImage, setMiscText, setName, setRawExit, setResource, setRoomID, setSavable, show, show, show, show, show, showHappens, showHappens, showOthers, showOthers, showSource, showSource, startItemRejuv, text, thirstPerRound, tick, toggleMobility
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.planet_ink.coffee_mud.Locales.interfaces.Room
addInhabitant, bringMobHere, clearSky, delAllInhabitants, delInhabitant, domainType, eachInhabitant, fetchExit, fetchFromMOBRoomFavorsItems, fetchFromMOBRoomFavorsMOBs, fetchFromMOBRoomItemExit, fetchFromRoomFavorExits, fetchFromRoomFavorItems, fetchFromRoomFavorMOBs, fetchInhabitant, fetchInhabitant, fetchInhabitantExact, fetchInhabitants, fetchRandomInhabitant, getArea, getCombatTurnMobIndex, getContextName, getExitInDir, getGridParent, getMobility, getPairedExit, getRawExit, getReverseExit, getRoomInDir, getSky, giveASky, inhabitants, isHere, isInhabitant, maxRange, myResource, numInhabitants, numPCInhabitants, pointsPerMove, rawDoors, recoverRoomStats, resourceChoices, roomID, send, sendOthers, setArea, setCombatTurnMobIndex, setGridParent, setRawExit, setResource, setRoomID, show, show, show, show, show, showHappens, showHappens, showOthers, showOthers, showSource, showSource, startItemRejuv, thirstPerRound, toggleMobility
 
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, 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.Contingent
amDestroyed, isSavable, setSavable
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.CMObject
copyOf, initializeClass, newInstance
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Modifiable
getSaveStatIndex, isStat
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Affectable
addEffect, addNonUninvokableEffect, basePhyStats, delAllEffects, delEffect, eachEffect, effects, fetchEffect, fetchEffect, numEffects, phyStats, recoverPhyStats, setBasePhyStats
 
Methods inherited from interface com.planet_ink.coffee_mud.core.interfaces.Behavable
addBehavior, addScript, behaviors, delAllBehaviors, delAllScripts, delBehavior, delScript, eachBehavior, eachScript, fetchBehavior, fetchBehavior, fetchScript, numBehaviors, numScripts, scripts
 

Field Detail

descriptions

protected java.lang.String[] descriptions

displayTexts

protected java.lang.String[] displayTexts

gridexits

protected SVector<GridLocale.CrossExit> gridexits

xsize

protected int xsize

ysize

protected int ysize

yLength

protected int yLength

ox

protected Exit ox

rooms

protected final SVector<StdThinGrid.ThinGridEntry> rooms

tickStarted

protected static boolean tickStarted
Constructor Detail

StdThinGrid

public StdThinGrid()
Method Detail

ID

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

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

cloneFix

protected void cloneFix(Room E)
Overrides:
cloneFix in class StdRoom

getGridChildLocaleID

public java.lang.String getGridChildLocaleID()
Description copied from interface: GridLocale
Gets the Room ID() for the type of Java room class used to populate the grid. For example: StdRoom.

Specified by:
getGridChildLocaleID in interface GridLocale
Returns:
the Room ID() for the type of Java room class

xGridSize

public int xGridSize()
Description copied from interface: GridZones
Returns the total width of this grid.

Specified by:
xGridSize in interface GridZones
Returns:
the width

yGridSize

public int yGridSize()
Description copied from interface: GridZones
Returns the total height of this grid

Specified by:
yGridSize in interface GridZones
Returns:
the height

setXGridSize

public void setXGridSize(int x)
Description copied from interface: GridZones
Sets the total width of this grid.

Specified by:
setXGridSize in interface GridZones
Parameters:
x - the width

setYGridSize

public void setYGridSize(int y)
Description copied from interface: GridZones
Sets the total height of this grid.

Specified by:
setYGridSize in interface GridZones
Parameters:
y - the height

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
Overrides:
destroy in class StdRoom

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
Overrides:
setDescription in class StdRoom
Parameters:
newDescription - the basic detail description of this object

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
Overrides:
setDisplayText in class StdRoom
Parameters:
newDisplayText - the string describing how this object looks in the room

prepareRoomInDir

public Room prepareRoomInDir(Room fromRoom,
                             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
Overrides:
prepareRoomInDir in class StdRoom
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.

getGridRoomIfExists

protected Room getGridRoomIfExists(int x,
                                   int y)

prepareGridLocale

public Room prepareGridLocale(Room fromRoom,
                              Room toRoom,
                              int direction)
Description copied from interface: GridLocale
Returns the room found in the given direction from the from-room, where the stand-in room is the to-room. Grids are not required to actually fill themselves in at boot time, nor are they required to remain filled in. Therefore, rooms can be constructed in real time. This method is called whenever a player wants to move into another room from a room that is part of a grid to some other room.

Specified by:
prepareGridLocale in interface GridLocale
Parameters:
fromRoom - the room moving from, also the grid child
toRoom - the room ostensibly being moved into
direction - the direction from the from room moving
Returns:
the new to-room, the actual room to move into

getGridChild

public Room getGridChild(int x,
                         int y)
Description copied from interface: GridZones
Returns the Room object at the given coordinates.

Specified by:
getGridChild in interface GridZones
Parameters:
x - the x coordinate
y - the y coordinate
Returns:
the Room object at those coordinates
See Also:
Room

getGridChild

public Room getGridChild(GridZones.XYVector xy)
Description copied from interface: GridZones
Returns the Room object at the given coordinates.

Specified by:
getGridChild in interface GridZones
Parameters:
xy - the x and y coordinate
Returns:
the Room object at those coordinates
See Also:
Room, GridZones.XYVector

getMakeSingleGridRoom

protected Room getMakeSingleGridRoom(int x,
                                     int y)

getRoomXY

public GridZones.XYVector getRoomXY(Room room)
Description copied from interface: GridZones
Returns the XY coordinates of the Room, if a child of this gridzone, in XYVector format.

Specified by:
getRoomXY in interface GridZones
Parameters:
room - the room to get coordinates for
Returns:
coordinates in XYVector format.
See Also:
GridZones.XYVector

getRoomXY

public GridZones.XYVector getRoomXY(java.lang.String roomID)
Description copied from interface: GridZones
Returns the XY coordinates of the Room with the given roomID in XYVector format.

Specified by:
getRoomXY in interface GridZones
Parameters:
roomID - the roomID of the room to get coordinates for
Returns:
coordinates in XYVector format.
See Also:
GridZones.XYVector

fillExitsOfGridRoom

protected void fillExitsOfGridRoom(Room R,
                                   int x,
                                   int y)

tryFillInExtraneousExternal

public void tryFillInExtraneousExternal(GridLocale.CrossExit EX,
                                        Exit ox,
                                        Room linkFrom)

getMakeGridRoom

protected Room getMakeGridRoom(int x,
                               int y)

outerExits

public java.util.Iterator<GridLocale.CrossExit> outerExits()
Description copied from interface: GridLocale
Normally the grid-child rooms can only exit to each other, or to the same places as the gridlocale host. Outer Exits are a way around this by pre-defining exits from grid children to elsewhere on the map, including into other gridlocales.

Specified by:
outerExits in interface GridLocale
Returns:
an iterator of cross ("outer") exits.
See Also:
GridLocale.CrossExit, GridLocale.addOuterExit(GridLocale.CrossExit), GridLocale.delOuterExit(GridLocale.CrossExit)

delOuterExit

public void delOuterExit(GridLocale.CrossExit x)
Description copied from interface: GridLocale
Normally the grid-child rooms can only exit to each other, or to the same places as the gridlocale host. Outer Exits are a way around this by pre-defining exits from grid children to elsewhere on the map, including into other gridlocales. This method will remove an existing one

Specified by:
delOuterExit in interface GridLocale
Parameters:
x - the existing cross ("outer") exit to delete
See Also:
GridLocale.CrossExit, GridLocale.outerExits(), GridLocale.addOuterExit(GridLocale.CrossExit)

addOuterExit

public void addOuterExit(GridLocale.CrossExit x)
Description copied from interface: GridLocale
Normally the grid-child rooms can only exit to each other, or to the same places as the gridlocale host. Outer Exits are a way around this by pre-defining exits from grid children to elsewhere on the map, including into other gridlocales. This method will add a new one.

Specified by:
addOuterExit in interface GridLocale
Parameters:
x - the new cross ("outer") exit
See Also:
GridLocale.CrossExit, GridLocale.outerExits(), GridLocale.delOuterExit(GridLocale.CrossExit)

getAltRoomFrom

public Room getAltRoomFrom(Room loc,
                           int direction)

getAllRooms

public java.util.List<Room> getAllRooms()
Description copied from interface: GridLocale
Returns a read-only list of grid-child rooms. You are guaranteed at least one room, even from grids that create them as-needed.

Specified by:
getAllRooms in interface GridLocale
Returns:
a read-only list of grid-child rooms.

getAllRoomsFilled

public java.util.List<Room> getAllRoomsFilled()
Description copied from interface: GridLocale
Returns a read-only list of grid-child rooms, and any skys or seas attached to them.

Specified by:
getAllRoomsFilled in interface GridLocale
Returns:
a read-only list of all rooms around here.

getExistingRooms

public java.util.Iterator<Room> getExistingRooms()
Description copied from interface: GridLocale
Returns a read-only iterator over the existing grid-child rooms. This iterator may be empty if the grid creates children as-needed.

Specified by:
getExistingRooms in interface GridLocale
Returns:
a read-only iterator over the existing grid-child rooms.

alternativeLink

protected Room alternativeLink(Room room,
                               Room defaultRoom,
                               int dir)

halfLink

protected void halfLink(Room room,
                        Room loc,
                        int dirCode,
                        Exit o)

linkRoom

protected void linkRoom(Room room,
                        Room loc,
                        int dirCode,
                        Exit o,
                        Exit ao)

buildGrid

public void buildGrid()
Description copied from interface: GridLocale
Called whenever structural changes are made to either the grid room, or one of the adjacent connecting rooms, this method will "rebuild" the grids internal structure as necessary.

Specified by:
buildGrid in interface GridLocale

isMyGridChild

public boolean isMyGridChild(Room loc)
Description copied from interface: GridZones
Returns whether the given Room is a child of this particular Grid instance.

Specified by:
isMyGridChild in interface GridZones
Parameters:
loc - a Room object
Returns:
whether the room is a child
See Also:
Room

clearGrid

public void clearGrid(Room bringBackHere)
Description copied from interface: GridLocale
Empties the grid-children rooms of all contents, mob and item, and then destroys the internal grid-children rooms themselves. This puts the grid back into a default state.

Specified by:
clearGrid in interface GridLocale
Parameters:
bringBackHere - a room to teleport *ALL* mobs and items to

getGridChildCode

public java.lang.String getGridChildCode(Room loc)
Description copied from interface: GridZones
Returns the fully-qualified Room ID of this room

Specified by:
getGridChildCode in interface GridZones
Parameters:
loc - a Room object
Returns:
a fully qualified room ID
See Also:
Room, GridZones.getGridChild(String)

getGridChildX

public int getGridChildX(Room loc)
Description copied from interface: GridZones
Returns the X coordinate of the given Room object

Specified by:
getGridChildX in interface GridZones
Parameters:
loc - the Room object
Returns:
the x coordinate of the room
See Also:
Room

getRandomGridChild

public Room getRandomGridChild()
Description copied from interface: GridZones
Returns a random Room object that is a child of this one.

Specified by:
getRandomGridChild in interface GridZones
Returns:
a Room object
See Also:
Room

getGridChildY

public int getGridChildY(Room loc)
Description copied from interface: GridZones
Returns the Y coordinate of the given Room object

Specified by:
getGridChildY in interface GridZones
Parameters:
loc - the Room object
Returns:
the y coordinate of the room
See Also:
Room

getGridChild

public Room getGridChild(java.lang.String childCode)
Description copied from interface: GridZones
Returns the fully-qualified Room ID of this room

Specified by:
getGridChild in interface GridZones
Parameters:
childCode - a fully-qualified Room ID for this Room
Returns:
a Room object
See Also:
Room, GridZones.getGridChildCode(Room)

executeMsg

public void executeMsg(Environmental myHost,
                       CMMsg msg)
Description copied from interface: MsgListener
The general message event handler for the object. Messages passed herein may not necessarily be FOR this object, or from it, but will almost always represent events happening in the same room. The messages have already been through an approval process, so this method is called only to affect the final execution of the meaning of the message. Every game event goes through these methods.

Specified by:
executeMsg in interface MsgListener
Overrides:
executeMsg in class StdRoom
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that needs to be executed
See Also:
CMMsg

okMessage

public boolean okMessage(Environmental myHost,
                         CMMsg msg)
Description copied from interface: MsgListener
The general message event previewer for the object. Messages passed herein are in a pending state, and may be safely modified or rejected without fear that they might be in the middle of being executed. Messages passed herein may not necessarily be FOR or FROM this object, but will almost always represent events which want to happen in the same rom. This method should always always return true UNLESS this message needs to be canceled, in which case it is necessary to tell the mob initiating the event (CMMsg.source()) why it is being cancelled. Every game event goes through these methods.

Specified by:
okMessage in interface MsgListener
Overrides:
okMessage in class StdRoom
Parameters:
myHost - either the initiator of the event, or the host of this object
msg - the CMMsg that wants to be executed
Returns:
whether this message is allowed to execute
See Also:
CMMsg, CMMsg.source()

getStat

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

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

setStat

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

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

getStdGridCodeNum

protected int getStdGridCodeNum(java.lang.String code)

getStatCodes

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

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