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".
Openable : BasicOpenable
Superclass Tree (in declaration order)
Summary of Properties
Summary of Methods
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.
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."
Contents lister to use when we're opening the object. This lister shows the items that are newly revealed when the object is opened.
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.
must be open to get into a nested room
show any special contents as well
must be open to get out of a nested room
can't lock an openable that isn't closed
make sure that our interior is reachable
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