|
Planeshift
|
#include <dictionary.h>
Public Member Functions | |
| void | AddMenu (const char *name, NpcDialogMenu *menu) |
| Store an initial trigger menu with the specified NPC name. More... | |
| void | AddMenu (NpcDialogMenu *menu) |
| Store a menu with the dictionary NOTE: this is hacky - natoka. More... | |
| void | AddResponse (iDataConnection *db, int databaseID) |
| Loads a response from database (its id=databaseID) More... | |
| NpcResponse * | AddResponse (const char *response_text, const char *pronoun_him, const char *pronoun_her, const char *pronoun_it, const char *pronoun_them, const char *npc_name, int &new_id, psQuest *quest, const char *audio_path) |
| Adds a response dynamically not from the database. More... | |
| NpcResponse * | AddResponse (const char *script) |
| Adds a scripted response. More... | |
| bool | AddTrigger (iDataConnection *db, int databaseID, int responseID) |
| Loads a trigger from database (its id=databaseID) More... | |
| NpcTrigger * | AddTrigger (const char *k_area, const char *mytrigger, int prior_response, int trigger_response) |
| bool | CheckForTriggerGroup (csString &trigger) |
| substitute master trigger if this is child trigger in group. More... | |
| void | DeleteMenusForQuest (psQuest *quest) |
| Remove the quest related NpcDialogMenu entries. More... | |
| void | DeleteTriggerResponse (NpcTrigger *trigger, int responseID) |
| bool | FindKnowledgeArea (const csString &name) |
| NpcDialogMenu * | FindMenu (const char *name) |
| Find a stored initial trigger menu with the specified NPC name. More... | |
| NpcResponse * | FindResponse (gemNPC *npc, const char *area, const char *trigger, int faction, int priorresponse, Client *client, int questID=-1) |
| NpcResponse * | FindResponse (int responseID) |
| Lookup the response with the given ID from responses. More... | |
| NpcTerm * | FindTerm (const char *term) |
| Returns record of 'term' (or NULL if unknown) More... | |
| NpcTerm * | FindTermOrSynonym (const csString &term) |
| Returns synonym of 'term' (or NULL if unknown). More... | |
| bool | Initialize (iDataConnection *db) |
| NPCDialogDict () | |
| void | Print (const char *area) |
| Dump the entire dictionary. More... | |
| void | RemoveEmptyMenu (NpcDialogMenu *menu) |
| virtual | ~NPCDialogDict () |
Protected Types | |
| typedef csRedBlackTree< NpcTrigger *, CS::Container::DefaultRedBlackTreeAllocator< NpcTrigger * >, NpcTriggerOrdering > | NpcTriggerTree |
Protected Member Functions | |
| NpcTerm * | AddTerm (const char *term) |
| Adds a new record to 'terms'. More... | |
| int | AddTriggerGroupEntry (int id, const char *txt, int equivID) |
| void | AddWords (csString &trigger) |
| All unknown words from 'trigger' that are not disallowed are added to 'phrases'. More... | |
| bool | LoadDisallowedWords (iDataConnection *db) |
| bool | LoadResponses (iDataConnection *db) |
| bool | LoadSynonyms (iDataConnection *db) |
| bool | LoadTriggerGroups (iDataConnection *db) |
| bool | LoadTriggers (iDataConnection *db) |
| csArray< NpcTrigger * > | ParseMultiTrigger (NpcTrigger *parsetrig) |
Protected Attributes | |
| csHash< bool, csString > | disallowed_words |
| int | dynamic_id |
| csHash< NpcDialogMenu *, csString > | initial_popup_menus |
| Collection of all referenced knowledge areas. More... | |
| csHash< NpcDialogMenu * > | initial_popup_menus_by_quest_id |
| csHash< csString, csString > | knowledgeAreas |
| csHash< NpcTerm *, csString > | phrases |
| csHash< NpcResponse * > | responses |
| csHash< NpcTrigger * > | trigger_by_id |
| csHash< NpcTriggerGroupEntry *, csString > | trigger_groups |
| csHash< NpcTriggerGroupEntry * > | trigger_groups_by_id |
| NpcTriggerTree | triggers |
Definition at line 74 of file dictionary.h.
|
protected |
Definition at line 77 of file dictionary.h.
| NPCDialogDict::NPCDialogDict | ( | ) |
|
virtual |
| void NPCDialogDict::AddMenu | ( | const char * | name, |
| NpcDialogMenu * | menu | ||
| ) |
Store an initial trigger menu with the specified NPC name.
| void NPCDialogDict::AddMenu | ( | NpcDialogMenu * | menu | ) |
Store a menu with the dictionary NOTE: this is hacky - natoka.
| menu | to register - it will get cleaned up on dict destruction |
| void NPCDialogDict::AddResponse | ( | iDataConnection * | db, |
| int | databaseID | ||
| ) |
Loads a response from database (its id=databaseID)
| NpcResponse* NPCDialogDict::AddResponse | ( | const char * | response_text, |
| const char * | pronoun_him, | ||
| const char * | pronoun_her, | ||
| const char * | pronoun_it, | ||
| const char * | pronoun_them, | ||
| const char * | npc_name, | ||
| int & | new_id, | ||
| psQuest * | quest, | ||
| const char * | audio_path | ||
| ) |
Adds a response dynamically not from the database.
Supplies new_id if 0.
| NpcResponse* NPCDialogDict::AddResponse | ( | const char * | script | ) |
Adds a scripted response.
|
protected |
Adds a new record to 'terms'.
Loads a trigger from database (its id=databaseID)
| NpcTrigger* NPCDialogDict::AddTrigger | ( | const char * | k_area, |
| const char * | mytrigger, | ||
| int | prior_response, | ||
| int | trigger_response | ||
| ) |
|
protected |
All unknown words from 'trigger' that are not disallowed are added to 'phrases'.
All disallowed words from 'trigger' are removed from 'trigger'
| bool NPCDialogDict::CheckForTriggerGroup | ( | csString & | trigger | ) |
substitute master trigger if this is child trigger in group.
return true if substituted
| void NPCDialogDict::DeleteMenusForQuest | ( | psQuest * | quest | ) |
Remove the quest related NpcDialogMenu entries.
Will remove the DialogTrigger entries (as storde in triggers) of all NpcDialogMenu objects that have been registered in this dictionary.
| quest | pointer to delete the menus for. |
| void NPCDialogDict::DeleteTriggerResponse | ( | NpcTrigger * | trigger, |
| int | responseID | ||
| ) |
| bool NPCDialogDict::FindKnowledgeArea | ( | const csString & | name | ) |
| NpcDialogMenu* NPCDialogDict::FindMenu | ( | const char * | name | ) |
Find a stored initial trigger menu with the specified NPC name.
| NpcResponse* NPCDialogDict::FindResponse | ( | gemNPC * | npc, |
| const char * | area, | ||
| const char * | trigger, | ||
| int | faction, | ||
| int | priorresponse, | ||
| Client * | client, | ||
| int | questID = -1 |
||
| ) |
| NpcResponse* NPCDialogDict::FindResponse | ( | int | responseID | ) |
Lookup the response with the given ID from responses.
| NpcTerm* NPCDialogDict::FindTerm | ( | const char * | term | ) |
Returns record of 'term' (or NULL if unknown)
| NpcTerm* NPCDialogDict::FindTermOrSynonym | ( | const csString & | term | ) |
Returns synonym of 'term' (or NULL if unknown).
If 'term' is known but has no synonym, then 'term' itself is returned
| bool NPCDialogDict::Initialize | ( | iDataConnection * | db | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| void NPCDialogDict::Print | ( | const char * | area | ) |
Dump the entire dictionary.
| void NPCDialogDict::RemoveEmptyMenu | ( | NpcDialogMenu * | menu | ) |
|
protected |
Definition at line 84 of file dictionary.h.
|
protected |
Definition at line 91 of file dictionary.h.
|
protected |
Collection of all referenced knowledge areas.
This is a storage area for popup menus parsed during quest loading, which is done before NPCs are spawned.
Definition at line 88 of file dictionary.h.
|
protected |
Definition at line 89 of file dictionary.h.
|
protected |
Definition at line 85 of file dictionary.h.
|
protected |
Definition at line 78 of file dictionary.h.
|
protected |
Definition at line 83 of file dictionary.h.
|
protected |
Definition at line 82 of file dictionary.h.
|
protected |
Definition at line 79 of file dictionary.h.
|
protected |
Definition at line 80 of file dictionary.h.
|
protected |
Definition at line 81 of file dictionary.h.