From bfe075d314f8e9d7010d0f5e60d44bb314e53846 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 5 Jun 2016 14:27:31 -0400 Subject: TITANIC: Further fleshing out of TTquotes and TTquotesTree --- engines/titanic/true_talk/tt_quotes_tree.h | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'engines/titanic/true_talk/tt_quotes_tree.h') diff --git a/engines/titanic/true_talk/tt_quotes_tree.h b/engines/titanic/true_talk/tt_quotes_tree.h index 9496fa8887..fb7d262879 100644 --- a/engines/titanic/true_talk/tt_quotes_tree.h +++ b/engines/titanic/true_talk/tt_quotes_tree.h @@ -31,24 +31,41 @@ namespace Titanic { #define QUOTES_TREE_COUNT 1022 -enum TreeEntryType { ET_END = 0, ET_TABLE = 1, ET_STRING = 2 }; +class TTtreeBuffer { +public: + int _field0; + const char *_strP; +public: + TTtreeBuffer() : _field0(0), _strP(nullptr) {} +}; class TTquotesTree { struct TTquotesTreeEntry { uint _id; - TreeEntryType _type; TTquotesTreeEntry *_subTable; CString _string; - TTquotesTreeEntry() : _id(0), _type(ET_END), _subTable(nullptr) {} + TTquotesTreeEntry() : _id(0), _subTable(nullptr) {} }; private: TTquotesTreeEntry _entries[QUOTES_TREE_COUNT]; +private: + /** + * Inner search method + */ + void search(const char **str, TTquotesTreeEntry *bTree, TTtreeBuffer *buffer, + int quoteId); + + /** + * Compare the current word in the string against a specified word + */ + bool compareWord(const char **str, const char *refStr); public: /** * Load data for the quotes tree */ void load(); + }; } // End of namespace Titanic -- cgit v1.2.3