OBJECT
/obj/key
SYNOPSIS
#include <lock.h>
inherit "/obj/key";
LAST UPDATE
Mateese, 09-Sep-94 23:00 MET
DESCRIPTION
The /obj/key is a simple generic key. It is nothing more
than a /std/thing with two properties builtin. In itself it
defines no commands!
It is built to cooperate with /std/lock.
If /obj/key is just cloned, it's preconfigured to be a
'key' of 10 coins worth and 50 gr weight.
It has no keycode or keyid then.
The /obj/key implements two builtin properties:
mixed P_KEYCODE "KeyCode"
The code the lock checks against if it found a key with
matching ids.
A value of 0 counts as 'no code'.
string * P_KEYIDS "KeyIds"
The special key ids this key reacts on.
This is a purely informational property, which is _not_
dirctly used by /std/lock.
In contrast to P_IDS, the P_KEYIDS are not normalized.
An auxiliary function is:
string * AddKeyId (string id)
Add <id> to the P_KEYIDS. Result is the new P_KEYIDS setting.
As for the lock mechanism the id() has to recognize both P_IDS
and P_KEYIDS, there is an own
int id (string str)
which first tries the normal match agains P_IDS, and if that
fails, tries matching <str> against P_KEYIDS. In contrast to
the normal id(), the latter match must be exact in case and
spacing as well.
The object is initialised here:
void create ()
Calls /std/thing::create() and then configures the
/obj/key.
INHERITANCE TREE
key
`-thing
|-thing/moving
|-thing/description
`-base
SEE ALSO
thing(S), lock(S), locks(C)