generic interface #204

Parent #1Owner #361Flags read, fertileSource hellcore/hellcore.db

Aliases: generic interface

3 verbs · 11 properties · 3 children

Verbs

VerbSpecFlagsDefinerLines
validatethis none thisrxd#20425
registerthis none thisrxd#2048
is_onthis none thisrxd#2047

Properties

PropertyDefinerFlagsOwnerValue
implementors#204rc#361{}
aliases#1rc#361{"generic interface"}
description#1rc#361<clear>
object_size#1r#29{2050, 1298434189}
hidden_verbs#1rc#361<clear>
phelp_msg#1rc#361<clear>
weight#1rc#361<clear>
owner_verbs#1rc#361<clear>
plural_name#1rc#361<clear>
client_image#1rc#361<clear>
listening#1rc#361<clear>

Ancestry

Ancestors (nearest first): #1 root

Children: #191 container, #343 attackable, #363 heart

Call graph

calls n204_0 #204:validate n45_1 #45:all_properties n204_0->n45_1 n20_38 #20:explode n204_0->n20_38 n48_8 #48:suspend_if_needed n204_0->n48_8 n107_43 #107:tell n204_0->n107_43 n20_59 #20:name_and_number n204_0->n20_59 n204_1 #204:register n204_1->n204_0

Source

validate

Spec this none thisFlags rxdOwner #361Definer #204

Referenced by

Source

1":validate(OBJ what) => Does 'what' actually implement me?";
2what = args[1];
3allverbs = $ou:all_verbs(what);
4for verb in (verbs(this))
5found = 0;
6for candidate in (allverbs)
7if (verb in $su:explode(candidate, " "))
8found = 1;
9break;
10endif
11$cu:sin();
12endfor
13if (!found)
14player:tell("Sorry, ", $su:nn(what), " needs to define the verb :", verb, " to implement ", $su:nn(this), ".");
15return E_VERBNF;
16endif
17endfor
18allprops = $ou:all_properties(what);
19for prop in (properties(this))
20if (!(prop in allprops))
21player:tell("Sorry, ", $su:nn(what), " needs to define the property .", prop, " to implement ", $su:nn(this), ".");
22return E_PROPNF;
23endif
24endfor
25return 1;

register

Spec this none thisFlags rxdOwner #361Definer #204

Referenced by

none

Source

1":register(OBJ what) => Register 'what' as an implementor of me.";
2what = args[1];
3if (v = this:validate(what))
4this.implementors = setadd(this.implementors, what);
5return 1;
6else
7return v;
8endif

is_on

Spec this none thisFlags rxdOwner #361Definer #204

Referenced by

none

Source

1what = args[1];
2while (valid(what))
3if (what in this.implementors)
4return 1;
5endif
6what = parent(what);
7endwhile