Planeshift
|
#include <dictionary.h>
Public Member Functions | |
void | AddMenu (const char *name, NpcDialogMenu *menu) |
Store an initial trigger menu with the specified NPC name. | |
void | AddMenu (NpcDialogMenu *menu) |
Store a menu with the dictionary NOTE: this is hacky - natoka. | |
void | AddResponse (iDataConnection *db, int databaseID) |
Loads a response from database (its id=databaseID) | |
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. | |
NpcResponse * | AddResponse (const char *script) |
Adds a scripted response. | |
bool | AddTrigger (iDataConnection *db, int databaseID, int responseID) |
Loads a trigger from database (its id=databaseID) | |
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. | |
void | DeleteMenusForQuest (psQuest *quest) |
Remove the quest related NpcDialogMenu entries. | |
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. | |
NpcResponse * | FindResponse (int responseID) |
Lookup the response with the given ID from responses. | |
NpcResponse * | FindResponse (gemNPC *npc, const char *area, const char *trigger, int faction, int priorresponse, Client *client, int questID=-1) |
NpcTerm * | FindTerm (const char *term) |
Returns record of 'term' (or NULL if unknown) | |
NpcTerm * | FindTermOrSynonym (const csString &term) |
Returns synonym of 'term' (or NULL if unknown). | |
bool | Initialize (iDataConnection *db) |
NPCDialogDict () | |
void | Print (const char *area) |
Dump the entire dictionary. | |
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'. | |
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'. | |
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. | |
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.
typedef csRedBlackTree<NpcTrigger*, CS::Container::DefaultRedBlackTreeAllocator<NpcTrigger*>, NpcTriggerOrdering> NPCDialogDict::NpcTriggerTree [protected] |
Definition at line 77 of file dictionary.h.
NPCDialogDict::NPCDialogDict | ( | ) |
virtual 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 |
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.
void NPCDialogDict::AddResponse | ( | iDataConnection * | db, |
int | databaseID | ||
) |
Loads a response from database (its id=databaseID)
NpcTerm* NPCDialogDict::AddTerm | ( | const char * | term | ) | [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 | ||
) |
void NPCDialogDict::AddWords | ( | csString & | trigger | ) | [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 | ) |
bool NPCDialogDict::LoadDisallowedWords | ( | iDataConnection * | db | ) | [protected] |
bool NPCDialogDict::LoadResponses | ( | iDataConnection * | db | ) | [protected] |
bool NPCDialogDict::LoadSynonyms | ( | iDataConnection * | db | ) | [protected] |
bool NPCDialogDict::LoadTriggerGroups | ( | iDataConnection * | db | ) | [protected] |
bool NPCDialogDict::LoadTriggers | ( | iDataConnection * | db | ) | [protected] |
csArray<NpcTrigger*> NPCDialogDict::ParseMultiTrigger | ( | NpcTrigger * | parsetrig | ) | [protected] |
void NPCDialogDict::Print | ( | const char * | area | ) |
Dump the entire dictionary.
void NPCDialogDict::RemoveEmptyMenu | ( | NpcDialogMenu * | menu | ) |
csHash<bool, csString> NPCDialogDict::disallowed_words [protected] |
Definition at line 84 of file dictionary.h.
int NPCDialogDict::dynamic_id [protected] |
Definition at line 91 of file dictionary.h.
csHash<NpcDialogMenu*,csString> NPCDialogDict::initial_popup_menus [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.
csHash<NpcDialogMenu*> NPCDialogDict::initial_popup_menus_by_quest_id [protected] |
Definition at line 89 of file dictionary.h.
csHash<csString,csString> NPCDialogDict::knowledgeAreas [protected] |
Definition at line 85 of file dictionary.h.
csHash<NpcTerm*, csString> NPCDialogDict::phrases [protected] |
Definition at line 78 of file dictionary.h.
csHash<NpcResponse*> NPCDialogDict::responses [protected] |
Definition at line 83 of file dictionary.h.
csHash<NpcTrigger*> NPCDialogDict::trigger_by_id [protected] |
Definition at line 82 of file dictionary.h.
csHash<NpcTriggerGroupEntry*, csString> NPCDialogDict::trigger_groups [protected] |
Definition at line 79 of file dictionary.h.
csHash<NpcTriggerGroupEntry*> NPCDialogDict::trigger_groups_by_id [protected] |
Definition at line 80 of file dictionary.h.
NpcTriggerTree NPCDialogDict::triggers [protected] |
Definition at line 81 of file dictionary.h.