Help DB Class #15
2 verbs · 15 properties · 6 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
find_topics | this none this | rwxd | #15 | 14 |
add_topic | this none this | rwxd | #15 | 28 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
index | #15 | rw | #10 | {} |
description | #1 | rw | #10 | <clear> |
aliases | #1 | rw | #10 | <clear> |
home | #1 | rw | #10 | <clear> |
short_desc | #1 | rw | #10 | <clear> |
core | #1 | rw | #10 | 1 |
handedness | #1 | rw | #10 | <clear> |
base_enc | #1 | rw | #10 | <clear> |
base_weight | #1 | rw | #10 | <clear> |
capacity | #1 | rw | #10 | <clear> |
max_fit | #1 | rw | #10 | <clear> |
pprep | #1 | rw | #10 | <clear> |
gprep | #1 | rw | #10 | <clear> |
generic_name | #1 | rw | #10 | <clear> |
age | #1 | rw | #10 | <clear> |
Ancestry
Ancestors (nearest first): #1 Root Class
Children: #28 Player Help Database, #29 Coder Help Database, #30 Architect Help Database, #31 Dungeon Master Help Database, #53 NPC Help Database, #54 Animate Help Database
Source
find_topics
Referenced by
none
Source
1"#15:find_topics(STR) this none this"; 2"takes one string argument, finds an exact matching topic keyword."; 3"if no exact match, then finds all partial matches."; 4"returns topic/article pairs."; 5{?topic = "help"} = args; 6matches = {}; 7for each in (this.index) 8if (each[1] == topic) 9return {each}; 10elseif (index(each[1], topic) == 1) 11matches = {@matches, each}; 12endif 13endfor 14return matches;
add_topic
Referenced by
none
Source
1"#15:add_topic this none this"; 2"takes one or two args, first is topic keyword, second optionally an"; 3"existing articlenum. if no article specified, adds new topic and articlenum."; 4"if specified, creates a new topic/article pair in index."; 5"must preserve many to one topic/article relationship."; 6{topic, ?article = ""} = args; 7found = 0; 8for each in (this.index) 9if (each[1] == topic) 10return {0, ((("Topic keyword %W" + topic) + "%w already exists in %W") + this.name) + "%w."}; 11endif 12endfor 13if (article != "") 14if (article in properties(this)) 15this.index = {@this.index, {topic, article}}; 16return {1, ((((("Topic keyword %W" + topic) + "%w added to %W") + this.name) + "%w for %Warticle #") + tostr(article)) + "%w."}; 17else 18return {0, ((("Specified article number %W" + tostr(article)) + "%w does not exist in %W") + this.name) + "%w."}; 19endif 20else 21article = $get_next_help_id(); 22value = {}; 23perms = "rw"; 24owner = $dm; 25add_property(this, article, value, {owner, perms}); 26this.index = {@this.index, {topic, article}}; 27return {1, ((((((((("Topic keyword %W" + topic) + "%w added to %W") + this.name) + "%w for %Wnew article #") + article) + "%w. Don't forget to %Wedit ") + tostr(this)) + ".") + article) + "%w."}; 28endif