generic interface #204
Aliases: generic interface
3 verbs · 11 properties · 3 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
validate | this none this | rxd | #204 | 25 |
register | this none this | rxd | #204 | 8 |
is_on | this none this | rxd | #204 | 7 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
implementors | #204 | rc | #361 | {} |
aliases | #1 | rc | #361 | {"generic interface"} |
description | #1 | rc | #361 | <clear> |
object_size | #1 | r | #29 | {2050, 1298434189} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rc | #361 | <clear> |
owner_verbs | #1 | rc | #361 | <clear> |
plural_name | #1 | rc | #361 | <clear> |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #361 | <clear> |
Ancestry
Ancestors (nearest first): #1 root
Children: #191 container, #343 attackable, #363 heart
Call graph
Source
validate
Referenced by
- #204:register line 3:
this:validate
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
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
Referenced by
none
Source
1what = args[1]; 2while (valid(what)) 3if (what in this.implementors) 4return 1; 5endif 6what = parent(what); 7endwhile