Openableclass
Openable: a mix-in class that can be combined with an object’s other superclasses to make the object respond to the verbs “open” and “close.” We also add some extra features for other related verbs, such as a must-be-open precondition “look in” and “board”.
class
Openable
:
BasicOpenable
Superclass Tree (in declaration order)
Openable
BasicOpenable
Linkable
` object`
Subclass Tree
Openable
Door
AutoClosingDoor
Matchbook
OpenableContainer
KeyedContainer
LockableContainer
Global Objects
(none)
Summary of Properties
descContentsLister
lockStatusReportable
openingLister
Inherited from BasicOpenable
:
cannotMoveThroughMsg
cannotTouchThroughMsg
initiallyOpen
isOpen_
openDesc
Summary of Methods
addInteriorReachableCond
dobjFor(Board)
dobjFor(Close)
dobjFor(GetOutOf)
dobjFor(Lock)
dobjFor(LockWith)
dobjFor(LookIn)
dobjFor(Open)
dobjFor(Search)
iobjFor(PourInto)
iobjFor(PutIn)
openStatus
Inherited from BasicOpenable
:
initializeThing
isOpen
makeOpen
tryImplicitRemoveObstructor
Inherited from Linkable
:
masterObject
Properties
descContentsLister
Describe our contents using a special version of the contents lister, so that we add our open/closed status to the listing. The message we add is given by our openStatus method, so if all you want to change is the “it’s open” status message, you can just override openStatus rather than providing a whole new lister.
lockStatusReportable
By default, an Openable that’s also a Lockable must be closed to be locked. This means that when it’s open, the object is implicitly unlocked, in which case “It’s unlocked” isn’t worth mentioning when the description says “It’s open.”
openingLister
Contents lister to use when we’re opening the object. This lister shows the items that are newly revealed when the object is opened.
Methods
addInteriorReachableCond (lst)
Generate a precondition to make sure gActor can reach the interior of the container. We consider the inside reachable if either the actor is located inside the container, or the actor is outside and the container is open.
dobjFor(Board)
must be open to get into a nested room
dobjFor(Close)
show any special contents as well
dobjFor(GetOutOf)
must be open to get out of a nested room
dobjFor(Lock)
can’t lock an openable that isn’t closed
dobjFor(LockWith)
no description available
dobjFor(LookIn)
show the default report
dobjFor(Open)
Action handlers
dobjFor(Search)
return the result
iobjFor(PourInto)
make sure that our interior is reachable
iobjFor(PutIn)
return the result
openStatus ( )
Get our “open status” message - this is a complete sentence saying that we’re open or closed. By default, in English, we just say “it’s open” (adjusted for number and gender, of course).
Note that this message has to be a stand-alone independent clause. In particular note that we don’t put any spacing after it, since we need to be able to add sentence-ending or clause-ending punctuation immediately after it.
TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3