LockableWithKeyclass | objects.t[4021] |
Superclass Tree | Subclass Tree | Global Objects | Property Summary | Method Summary | Property Details | Method Details |
Note that LockableWithKey should usually go BEFORE a Thing-derived class in the superclass list.
class
LockableWithKey : Lockable
LockableWithKey
Lockable
Linkable
object
LockableWithKey
KeyedContainer
keyList
knownKeyList
lockStatusObvious
rememberKnownKeys
Inherited from Lockable
:
autoUnlockOnOpen
initiallyLocked
isLocked_
lockedDesc
lockStatusReportable
autoUnlockOnOpen
dobjFor(Lock)
dobjFor(LockWith)
dobjFor(Unlock)
dobjFor(UnlockWith)
getKnownKeyList
getKnownKeyOwner
isKeyKnown
keyFitsLock
keyIsPlausible
lockOrUnlockAction
Inherited from Lockable
:
dobjFor(Open)
examineStatus
initializeThing
isLocked
makeLocked
Inherited from Linkable
:
masterObject
keyList | objects.t[4070] |
knownKeyList | objects.t[4077] |
lockStatusObvious OVERRIDDEN | objects.t[4138] |
rememberKnownKeys | objects.t[4120] |
Some authors might prefer not to assume that the player should remember which keys operate which locks, so this property can be changed to nil to eliminate this memory feature. By default we set this to true, since it shouldn't generally give away any secrets or puzzles for the game to assume that a key that was used successfully once with a given lock is the one to be used subsequently with the same lock.
autoUnlockOnOpen ( ) | objects.t[4148] |
dobjFor(Lock) OVERRIDDEN | objects.t[4158] |
dobjFor(LockWith) OVERRIDDEN | objects.t[4265] |
dobjFor(Unlock) OVERRIDDEN | objects.t[4184] |
dobjFor(UnlockWith) OVERRIDDEN | objects.t[4281] |
getKnownKeyList ( ) | objects.t[4083] |
getKnownKeyOwner ( ) | objects.t[4091] |
isKeyKnown (key) | objects.t[4127] |
keyFitsLock (key) | objects.t[4027] |
keyIsPlausible (key) | objects.t[4067] |
The point of this routine is to make this class concerned only with the abstract notion of objects that serve to lock and unlock other objects, without requiring that the key objects resemble little notched metal sticks or that the lock objects resemble cylinders with pins - or, more specifically, without requiring that all of the kinds of keys in a game remotely resemble one another.
For example, one kind of "key" in a game might be a plastic card with a magnetic stripe, and the corresponding lock would be a card slot; another kind of key might the traditional notched metal stick. Clearly, no one would ever think to use a plastic card with a conventional door lock, nor would one try to put a house key into a card slot (not with the expectation that it would actually work, anyway). This routine is meant to facilitate this kind of distinction: the card slot can use this routine to indicate that only plastic card objects are plausible as keys, and door locks can indicate that only metal keys are plausible.
This routine can be used for disambiguation and other purposes when we must programmatically select a key that is not specified or is only vaguely specified. For example, the keyring searcher uses it so that, when we're searching for a key on a keyring to open this lock, we implicitly try only the kinds of keys that would be plausibly useful for this kind of lock.
By default, we'll simply return true. Subclasses specific to a game (such as the "card reader" base class or the "door lock" base class) can override this to discriminate among the game-specific key classes.
lockOrUnlockAction (lock) | objects.t[4220] |