Room class | travel.t[4313], en_us.t[2938]

Room: the basic class for top-level game locations (that is, game locations that aren't inside any other simulation objects, but are at the top level of the containment hierarchy). This is the smallest unit of movement; we do not distinguish among locations within a room, even if a Room represents a physically large location. If it is necessary to distinguish among different locations in a large physical room, simply divide the physical room into sections and represent each section with a separate Room object.

A Room is not necessarily indoors; it is simply a location where an actor can be located. This peculiar usage of "room" to denote any atomic location, even outdoors, was adopted by the authors of the earliest adventure games, and has been the convention ever since.

A room's contents are the objects contained directly within the room. These include fixed features of the room as well as loose items in the room, which are effectively "on the floor" in the room.

The Room class implements the Travel Connector interface in such a way that travel from one room to another can be established simply by setting a direction property (north, south, etc) in the origin room to point to the destination room. This type of travel link has no side effects and is unconditional.

A room is by default an indoor location; this means that it contains walls, floor, and ceiling. An outdoor location should be based on OutdoorRoom rather than Room.

Modified in en_us.t[2938]:
English-specific modifications for Room.

`class Room : Fixture BasicLocation RoomAutoConnector`

Superclass Tree (in declaration order)

`Room`
`Fixture`
`NonPortable`
`Thing`
`VocabObject`
`object`
`BasicLocation`
`Thing`
`VocabObject`
`object`
`RoomAutoConnector`
`RoomConnector`
`TravelConnector`
`Thing`
`VocabObject`
`object`

Subclass Tree

`Room`
`DarkRoom`
`FloorlessRoom`
`OutdoorRoom`
`ShipboardRoom`

Global Objects

(none)

Summary of Properties

`atmosphereList brightness destName isTopLevel name putDestMessage roomFloor roomParts`

Inherited from `Fixture` :
`cannotMoveMsg cannotPutMsg cannotTakeMsg`

Inherited from `NonPortable` :
`bulk contentsListed isListed isListedInContents isListedInInventory weight`

Inherited from `Thing` :
`actorInAName actorInName actorInPrep actorIntoName actorOutOfName actorOutOfPrep aDisambigName allStates aName canBeHeard canBeSeen canBeSmelled canBeTouched canMatchHer canMatchHim canMatchIt canMatchThem circularlyInMessage collectiveGroup collectiveGroups contents contentsListedInExamine contentsListedSeparately contentsLister descContentsLister described disambigEquivName disambigName distantDesc distantInitSpecialDesc distantSpecialDesc distinguishers dummyName effectiveFollowLocation equivalenceKey equivalentGrouper equivalentGrouperClass equivalentGrouperTable esEndingPat explicitVisualSenseInfo getState globalParamName holdingIndex iesEndingPat initDesc initNominalRoomPartLocation initSpecialDesc inlineContentsLister isEquivalent isHer isHim isInInitState isKnown isLikelyCommandTarget isListedAboardVehicle isMassNoun isPlural isProperName isQualifiedName isThingConstructed listName listWith location lookInLister moved nameDoes nameSays nameSees notTravelReadyMsg objectNotifyList objInPrep obscuredInitSpecialDesc obscuredSpecialDesc owner patElevenEighteen patIsAlpha patLeadingTagOrQuote patOfPhrase patOneLetterAnWord patOneLetterWord patSingleApostropheS patTagOrQuoteChar patUpperOrDigit patVowelY pluralDisambigName pluralName pronounSelector roomDarkName roomLocation roomName seen sightPresence sightSize smellPresence smellSize soundPresence soundSize specialContentsLister specialDesc specialDescBeforeContents specialDescListWith specialDescOrder specialNominalRoomPartLocation suppressAutoSeen takeFromNotInMessage theDisambigName theName theNamePossNoun tmpAmbient_ tmpAmbientFill_ tmpAmbientWithin_ tmpFillMedium_ tmpObstructor_ tmpObstructorWithin_ tmpPathIsIn_ tmpTrans_ tmpTransWithin_ touchPresence touchSize verbCan verbCannot verbCant verbEndingSD verbEndingSEd verbEndingSMessageBuilder_ verbMust verbToCome verbToDo verbToGo verbToLeave verbToSay verbToSee verbWill verbWont`

Inherited from `VocabObject` :
`canResolvePossessive disambigPromptOrder pluralOrder vocabLikelihood vocabWords weakTokens`

Inherited from `BasicLocation` :
`cannotGoThatWayMsg defaultPosture listWithActorInTable mustDefaultPostureProp roomNotifyList roomTravelPreCond`

``

``

``

Inherited from `RoomConnector` :
`room1 room2`

Inherited from `TravelConnector` :
`connectorStagingLocation isCircularPassage isConnectorListed rememberCircularPassage travelBarrier travelMemory`

``

``

Summary of Methods

`childInName childInNameWithOwner dobjFor(Board) dobjFor(Enter) dobjFor(Examine) dobjFor(GetOutOf) dobjFor(LieOn) dobjFor(ListenTo) dobjFor(LookBehind) dobjFor(LookIn) dobjFor(LookUnder) dobjFor(SitOn) dobjFor(Smell) dobjFor(StandOn) getDestName getExtraScopeItems getNominalActorContainer getNominalDropDestination getRoomPartLocation hideFromAll hideFromDefault initializeThing mustMoveObjInto roomDaemon tryMovingObjInto`

Inherited from `Fixture` :
`dobjFor(Move) dobjFor(MoveTo) dobjFor(MoveWith) dobjFor(Pull) dobjFor(Push) dobjFor(PushTravel) dobjFor(PutBehind) dobjFor(PutIn) dobjFor(PutOn) dobjFor(PutUnder) dobjFor(Take) dobjFor(TakeFrom) dobjFor(ThrowAt) dobjFor(ThrowDir) isOwnedBy verifyMoveTo`

Inherited from `NonPortable` :
`contentsInFixedIn dobjFor(ShowTo) isHeldBy meetsObjHeld`

Inherited from `Thing` :
`acceptCommand addAllContents addDirectConnections addObjectNotifyItem addToContents addToSenseInfoTable adjustLookAroundTable adjustThrowDestination afterAction afterTravel allContents aNameFrom aNameObj aNameOwnerLoc announceDefaultObject appendHeldContents atmosphereList baseMoveInto basicExamine basicExamineFeel basicExamineListen basicExamineSmell basicExamineTaste beforeAction beforeTravel buildContainmentPaths cacheAmbientInfo cacheSenseInfo cacheSensePath canBeHeardBy canBeSeenBy canBeSensed canBeSmelledBy canBeTouchedBy canDetailsBeSensed canHear canMatchPronounType canMoveViaPath cannotGoShowExits cannotReachObject cannotSeeSmellSource cannotSeeSoundSource canOwn canSee canSmell canThrowViaPath canTouch canTouchViaPath checkActorOutOfNested checkBulkChange checkBulkChangeWithin checkMoveViaPath checkStagingLocation checkThrowViaPath checkTouchViaPath checkTravelerDirectlyInRoom childInNameGen childInRemoteName clearSenseInfo cloneForMultiInstanceContents cloneMultiInstanceContents conjugateRegularVerb connectionTable construct countDisambigName countListName countName countNameFrom countNameOwnerLoc darkRoomContentsLister defaultDistantDesc defaultObscuredDesc desc directionForConnector distantSmellDesc distantSoundDesc dobjFor(AskAbout) dobjFor(AskFor) dobjFor(AskVague) dobjFor(AttachTo) dobjFor(Attack) dobjFor(AttackWith) dobjFor(Break) dobjFor(Burn) dobjFor(BurnWith) dobjFor(Clean) dobjFor(CleanWith) dobjFor(Climb) dobjFor(ClimbDown) dobjFor(ClimbUp) dobjFor(Close) dobjFor(Consult) dobjFor(ConsultAbout) dobjFor(CutWith) dobjFor(Detach) dobjFor(DetachFrom) dobjFor(Dig) dobjFor(DigWith) dobjFor(Doff) dobjFor(Drink) dobjFor(Drop) dobjFor(Eat) dobjFor(EnterOn) dobjFor(Extinguish) dobjFor(Fasten) dobjFor(FastenTo) dobjFor(Feel) dobjFor(Flip) dobjFor(Follow) dobjFor(GetOffOf) dobjFor(GiveTo) dobjFor(GoThrough) dobjFor(JumpOff) dobjFor(JumpOver) dobjFor(Kiss) dobjFor(Light) dobjFor(Lock) dobjFor(LockWith) dobjFor(LookThrough) dobjFor(Open) dobjFor(PlugIn) dobjFor(PlugInto) dobjFor(Pour) dobjFor(PourInto) dobjFor(PourOnto) dobjFor(Read) dobjFor(Remove) dobjFor(Screw) dobjFor(ScrewWith) dobjFor(Search) dobjFor(Set) dobjFor(SetTo) dobjFor(Strike) dobjFor(Switch) dobjFor(TalkTo) dobjFor(Taste) dobjFor(TellAbout) dobjFor(TellVague) dobjFor(Throw) dobjFor(ThrowTo) dobjFor(Turn) dobjFor(TurnOff) dobjFor(TurnOn) dobjFor(TurnTo) dobjFor(TurnWith) dobjFor(TypeLiteralOn) dobjFor(TypeOn) dobjFor(Unfasten) dobjFor(UnfastenFrom) dobjFor(Unlock) dobjFor(UnlockWith) dobjFor(Unplug) dobjFor(UnplugFrom) dobjFor(Unscrew) dobjFor(UnscrewWith) dobjFor(Wear) examineListContents examineListContentsWith examineSpecialContents examineStatus failCheck feelDesc fillMedium findOpaqueObstructor findTouchObstructor forEachConnectedContainer forEachContainer fromPOV getAllForTakeFrom getAllPathsTo getAnnouncementDistinguisher getBagAffinities getBagsOfHolding getBestDistinguisher getBulk getBulkWithin getCarryingActor getCommonContainer getCommonDirectContainer getConnectedContainers getConnectorTo getContentsForExamine getDropDestination getEncumberingBulk getEncumberingWeight getHitFallDestination getIdentityObject getInScopeDistinguisher getListedContents getLocPushTraveler getLocTraveler getMovePathTo getNoise getNominalOwner getObjectNotifyList getOdor getOutermostRoom getOutermostVisibleRoom getRoomNotifyList getStateWithInfo getStatuslineExitsHeight getThrowPathTo getTouchPathTo getTravelConnector getVisualSenseInfo getWeight hasCollectiveGroup initializeEquivalent initializeLocation inRoomName iobjFor(AttachTo) iobjFor(AttackWith) iobjFor(BurnWith) iobjFor(CleanWith) iobjFor(CutWith) iobjFor(DetachFrom) iobjFor(DigWith) iobjFor(FastenTo) iobjFor(GiveTo) iobjFor(LockWith) iobjFor(MoveWith) iobjFor(PlugInto) iobjFor(PourInto) iobjFor(PourOnto) iobjFor(PutBehind) iobjFor(PutIn) iobjFor(PutOn) iobjFor(PutUnder) iobjFor(ScrewWith) iobjFor(ShowTo) iobjFor(TakeFrom) iobjFor(ThrowAt) iobjFor(ThrowTo) iobjFor(TurnWith) iobjFor(UnfastenFrom) iobjFor(UnlockWith) iobjFor(UnplugFrom) iobjFor(UnscrewWith) isActorTravelReady isComponentOf isDirectlyIn isIn isInFixedIn isListed isListedInContents isListedInInventory isListedInRoomPart isLookAroundCeiling isNominallyIn isNominallyInRoomPart isOccludedBy isOrIsIn isShipboard isVocabEquivalent itIs itNom itObj itPossAdj itPossNoun itVerb listCardinality localDirectionLinkForConnector lookAround lookAroundPov lookAroundWithin lookAroundWithinContents lookAroundWithinDesc lookAroundWithinName lookAroundWithinSense lookAroundWithinShowExits lookInDesc mainExamine mainMoveInto mapPushTravelHandlers mapPushTravelHandlers mapPushTravelHandlers mapPushTravelHandlers mapPushTravelHandlers mergeSenseInfo mergeSenseInfoTable moveInto moveIntoForTravel moveIntoNotifyPath nameIs nameIsnt nameVerb normalizePath notePromptByOwnerLoc notePromptByPossAdj noteSeenBy notifyInsert notifyMoveInto notifyMoveViaPath notifyRemove obscuredDesc obscuredSmellDesc obscuredSoundDesc pluralNameFrom processThrow propHidesProp propWithPresent putInName receiveDrop remoteDesc remoteInitSpecialDesc remoteRoomContentsLister remoteSpecialDesc removeFromContents removeObjectNotifyItem restoreLocation roomActorThereDesc roomContentsLister roomDarkDesc roomDesc roomFirstDesc roomRemoteDesc roomTravelPreCond saveLocation selectPathTo sendNotifyInsert sendNotifyRemove senseAmbientMax senseInfoTable senseObj sensePathFromWithin sensePathFromWithout sensePathToContents sensePathToLoc sensePresenceList setAllSeenBy setContentsSeenBy setGlobalParamName setVisualSenseInfo shineFromWithin shineFromWithout shineOnContents shineOnLoc showDistantSpecialDesc showDistantSpecialDescInContents showInventoryContents showInventoryItem showInventoryItemCounted showListItem showListItemCounted showListItemCountedGen showListItemGen showObjectContents showObscuredSpecialDesc showObscuredSpecialDescInContents showRemoteSpecialDesc showRemoteSpecialDescInContents showSpecialDesc showSpecialDescInContents showSpecialDescInContentsWithInfo showSpecialDescWithInfo showStatuslineExits showWornItem showWornItemCounted smellDesc smellHereDesc soundDesc soundHereDesc specialDescList specialPathFrom statusName stopThrowViaPath superHidesSuper tasteDesc thatNom thatObj theNameFrom theNameObj theNameOwnerLoc theNameWithOwner throwTargetCatch throwTargetHitWith throwViaPath transmitAmbient transSensingIn transSensingOut traversePath tryHolding tryImplicitRemoveObstructor useInitDesc useInitSpecialDesc useSpecialDesc useSpecialDescInContents useSpecialDescInRoom useSpecialDescInRoomPart verbEndingEs verbEndingIes verbEndingS verbToHave verbWas verifyFollowable verifyInsert verifyRemove whatIf whatIfHeldBy withVisualSenseInfo`

Inherited from `VocabObject` :
`addToDictionary expandPronounList filterResolveList getFacets inheritVocab initializeVocab initializeVocabWith matchName matchNameCommon matchNameDisambig throwNoMatchForLocation throwNoMatchForPossessive throwNothingInLocation`

Inherited from `BasicLocation` :
`actorInGroupPrefix actorInGroupSuffix actorIsFamiliar actorKnowsDestination actorTravelingWithin addRoomNotifyItem cannotGoThatWay cannotGoThatWayInDark cannotTravel checkActorReadyToEnterNestedRoom checkMovingActorInto disembarkRoom dispatchRoomDaemon enteringRoom leavingRoom listWithActorIn makeStandingUp removeRoomNotifyItem roomActorHereDesc roomActorPostureDesc roomActorStatus roomAfterAction roomBeforeAction roomDarkTravel roomListActorPosture roomOkayPostureChange travelerArriving travelerLeaving tryMakingDefaultPosture tryMakingTravelReady wouldBeLitFor`

``

``

Inherited from `RoomAutoConnector` :
`getDestination`

Inherited from `RoomConnector` :
`connectorTravelPreCond fixedSource`

Inherited from `TravelConnector` :
`actorTravelPreCond canTravelerPass checkTravelBarriers connectorBack connectorGetConnectorTo createUnlistedProxy darkTravel describeArrival describeDeparture describeLocalArrival describeLocalDeparture describeRemoteTravel dobjFor(TravelVia) explainTravelBarrier getApparentDestination isConnectorApparent isConnectorPassable isConnectorVisibleInDark noteTraversal rememberTravel`

``

``

Properties

`atmosphereList` | `travel.t[4395]`

My "atmosphere" list. This can be set to an EventList object to provide atmosphere messages while the player character is within this room. The default roomDaemon will show one message from this EventList (by calling the EventList's doScript() method) on each turn the player character is in this location.

`brightness` OVERRIDDEN | `travel.t[4362]`

Most rooms provide their own implicit lighting. We'll use 'medium' lighting (level 3) by default, which provides enough light for all activities, but is reduced to dim light (level 2) when it goes through obscuring media or over distance.

`destName` | `travel.t[4386]`

Our destination name, if we have one. By default, we make this nil, which means the room cannot be described as a destination of connectors from adjoining locations.

`isTopLevel` OVERRIDDEN | `travel.t[4334]`

we're a "top-level" location: we don't have any other object containing us, but we're nonetheless part of the game world, so we're at the top level of the containment tree

`name` OVERRIDDEN | `en_us.t[2960]`

The ordinary 'name' property is used the same way it's used for any other object, to refer to the room when it shows up in library messages and the like: "You can't take the hallway."

By default, we derive the name from the roomName by converting the roomName to lower case. Virtually every room will need a custom room name setting, since the room name is used mostly as a title for the room, and good titles are hard to generate mechanically. Many times, converting the roomName to lower case will produce a decent name to use in messages: "Ice Cave" gives us "You can't eat the ice cave." However, games will want to customize the ordinary name separately in many cases, because the elliptical, title-like format of the room name doesn't always translate well to an object name: "West of Statue" gives us the unworkable "You can't eat the west of statue"; better to make the ordinary name something like "plaza". Note also that some rooms have proper names that want to preserve their capitalization in the ordinary name: "You can't eat the Hall of the Ancient Kings." These cases need to be customized as well.

`putDestMessage` | `travel.t[4438]`

Since we could be our own nominal drop destination, we need a message to describe things being put here.

`roomFloor` | `travel.t[4533]`

Get the room's floor. This looks for an object of class Floor in the roomParts list; if there is no such object, we'll return nil, indicating that the room has no floor at all.

`roomParts` | `travel.t[4524]`

Get the list of extra parts for the room. An indoor location has walls, floor, and ceiling; these are all generic objects that are included for completeness only.

A room with special walls, floor, or ceiling should override this to eliminate the default objects from appearing in the room. Note that if the room has a floor, it should always be represented by an object of class Floor, and should always be part of this list.

Methods

`childInName (childName)`OVERRIDDEN | `en_us.t[3000]`

For top-level rooms, describe an object as being in the room by describing it as being in the room's nominal drop destination, since that's the nominal location for the objects directly in the room. (In most cases, the nominal drop destination for a room is its floor.)

If the player character isn't in the same outermost room as this container, use our remote name instead of the nominal drop destination. The nominal drop destination is usually something like the floor or the ground, so it's only suitable when we're in the same location as what we're describing.

`childInNameWithOwner (chiName)`OVERRIDDEN | `en_us.t[3008]`

if the PC isn't inside us, we're viewing this remotely

`dobjFor(Board)`OVERRIDDEN | `travel.t[4660]`

for BOARD and ENTER, there are three possibilities:

- we're already directly in this room, in which case it's illogical to travel here again

- we're in a nested room within this room, in which case ENTER <self> is the same as GET OUT OF <outermost nested room within self>

- we're in a separate top-level room that's connected by a sense connector, in which case ENTER <self> should be handled as TRAVEL VIA <connector from actor's current location to self>

`dobjFor(Enter)`OVERRIDDEN | `travel.t[4661]`

no description available

`dobjFor(Examine)`OVERRIDDEN | `travel.t[4570]`

When we're in the room, treat EXAMINE <ROOM> the same as LOOK AROUND. (This will only work if the room is given vocabulary like a normal object.)

`dobjFor(GetOutOf)`OVERRIDDEN | `travel.t[4624]`

treat an explicit GET OUT OF <ROOM> as OUT if there's an apparent destination for OUT; otherwise treat it as "vague travel," which simply tells the player that they need to specify a direction

`dobjFor(LieOn)`OVERRIDDEN | `travel.t[4617]`

no description available

`dobjFor(ListenTo)`OVERRIDDEN | `travel.t[4612]`

no description available

`dobjFor(LookBehind)`OVERRIDDEN | `travel.t[4608]`

no description available

`dobjFor(LookIn)`OVERRIDDEN | `travel.t[4604]`

treat LOOK IN <room> as EXAMINE <room>

`dobjFor(LookUnder)`OVERRIDDEN | `travel.t[4607]`

LOOK UNDER and BEHIND are illogical

`dobjFor(SitOn)`OVERRIDDEN | `travel.t[4616]`

no description available

`dobjFor(Smell)`OVERRIDDEN | `travel.t[4611]`

treat SMELL/LISTEN TO <room> as just SMELL/LISTEN

`dobjFor(StandOn)`OVERRIDDEN | `travel.t[4615]`

map STAND/SIT/LIE ON <room> to my default floor

`getDestName (actor, origin)`OVERRIDDEN | `travel.t[4379]`

Get my "destination name," as seen by the given actor from the given origin location. This gives the name we can use to describe this location from the perspective of an actor in an adjoining location looking at a travel connector from that location to here.

By default, we simply return our destName property. This default behavior can be overridden if it's necessary for a location to have different destination names in different adjoining locations, or when seen by different actors.

If this location's name cannot or should not be described from an adjoining location, this should simply return nil.

`getExtraScopeItems (actor)`OVERRIDDEN | `travel.t[4551]`

Get any extra items in scope in this location. These are items that are to be in scope even if they're not reachable through any of the normal sense paths (so they'll be in scope even in the dark, for example).

By default, if we have a floor, and the actor is directly in this room, we return our floor: this is because an actor is presumed to be in physical contact with the floor whenever directly in the room, and thus the actor would be aware that there's a floor there, even if the actor can't see the floor. In some rooms, it's desirable to have certain objects in scope because they're essential features of the room; for example, a location that is part of a stairway would probably have the stairs in scope by virtue of the actor standing on them.

`getNominalActorContainer (posture)`OVERRIDDEN | `travel.t[4445]`

The nominal actor container. By default, this is the room's nominal drop destination, which is usually the floor or equivalent.

`getNominalDropDestination ( )`OVERRIDDEN | `travel.t[4423]`

The nominal drop destination - this is the location where we describe objects as being when they're actually directly within the room.

By default, we return the object representing the room's floor. If there's no floor, we simply return 'self'.

`getRoomPartLocation (part)`OVERRIDDEN | `travel.t[4488]`

Get the apparent location of one of our room parts.

In most cases, we use generic objects (defaultFloor, defaultNorthWall, etc.) for the room parts. There's only one instance of each of these generic objects in the whole game - there's only one floor, one north wall, and so on - so these instances can't have specific locations the way normal objects do. Thus the need for this method: this tells us the *apparent* location of one of the room part objects as perceived from this room.

If the part isn't in this location, we'll return nil.

`hideFromAll (action)`OVERRIDDEN | `travel.t[4340]`

we generally do not want rooms to be included when a command refers to 'all'

`hideFromDefault (action)`OVERRIDDEN | `travel.t[4343]`

don't consider myself a default for STAND ON, SIT ON, or LIE ON

`initializeThing ( )`OVERRIDDEN | `travel.t[4317]`

Initialize

`mustMoveObjInto (obj)`OVERRIDDEN | `travel.t[4463]`

explain that something must be in the room first

`roomDaemon ( )`OVERRIDDEN | `travel.t[4401]`

Room daemon - this is invoked on the player character's immediate location once per turn in a daemon.

`tryMovingObjInto (obj)`OVERRIDDEN | `travel.t[4451]`

move something into a room is accomplished by putting the object on the floor

TADS 3 Library Manual
Generated on 8/21/2012 from TADS version 3.1.2