diff options
author | Paul Gilbert | 2016-05-22 15:44:50 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-15 19:14:36 -0400 |
commit | 73e2e8f429eea33e121d93dbc2c38b8be52709d8 (patch) | |
tree | 675c18a92249e4e5dcb4d901e93a6861a8ad2234 /engines/titanic/true_talk | |
parent | 76c84afdfe5cf020f74d724d8cc3bcf67b6d754d (diff) | |
download | scummvm-rg350-73e2e8f429eea33e121d93dbc2c38b8be52709d8.tar.gz scummvm-rg350-73e2e8f429eea33e121d93dbc2c38b8be52709d8.tar.bz2 scummvm-rg350-73e2e8f429eea33e121d93dbc2c38b8be52709d8.zip |
TITANIC: Added TTconcept id methods
Diffstat (limited to 'engines/titanic/true_talk')
-rw-r--r-- | engines/titanic/true_talk/tt_concept.cpp | 8 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_concept.h | 10 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_pronoun.h | 4 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_word.h | 9 |
4 files changed, 29 insertions, 2 deletions
diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp index 6683c8e457..05e6401018 100644 --- a/engines/titanic/true_talk/tt_concept.cpp +++ b/engines/titanic/true_talk/tt_concept.cpp @@ -273,4 +273,12 @@ TTconcept *TTconcept::findByWordClass(WordClass wordClass) { return nullptr; } +bool TTconcept::isWordId(int id) const { + return this && _wordP && _wordP->_id == id; +} + +int TTconcept::getWordId() const { + return this && _wordP ? _wordP->_id : 0; +} + } // End of namespace Titanic diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h index eefe113533..112d864e19 100644 --- a/engines/titanic/true_talk/tt_concept.h +++ b/engines/titanic/true_talk/tt_concept.h @@ -135,6 +135,16 @@ public: * Find a word by it's class */ TTconcept *findByWordClass(WordClass wordClass); + + /** + * Returns true if the concept has a word with a given Id + */ + bool isWordId(int id) const; + + /** + * If a word is associated, return it's Id + */ + int getWordId() const; }; } // End of namespace Titanic diff --git a/engines/titanic/true_talk/tt_pronoun.h b/engines/titanic/true_talk/tt_pronoun.h index 041ea1d5b8..ccc077152c 100644 --- a/engines/titanic/true_talk/tt_pronoun.h +++ b/engines/titanic/true_talk/tt_pronoun.h @@ -48,7 +48,9 @@ public: */ virtual TTword *copy() const; - virtual bool proc19(int val) const { return _field30 == val; } + virtual bool comparePronounTo(int val) const { + return _field30 == val; + } /** * Dumps data associated with the word to file diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h index 09d9f5e667..05108817ce 100644 --- a/engines/titanic/true_talk/tt_word.h +++ b/engines/titanic/true_talk/tt_word.h @@ -125,6 +125,13 @@ public: bool compareTo(const char *str) const; /** + * Compares the word's text to a passed string + */ + bool compareTo(TTstring *str) const { + return compareTo(str->c_str()); + } + + /** * Return the status of the word */ TTstringStatus getStatus() const { return _status; } @@ -176,7 +183,7 @@ public: virtual bool proc16() const { return false; } virtual bool proc17() const { return false; } virtual bool proc18() const { return false; } - virtual bool proc19(int val) const { return false; } + virtual bool comparePronounTo(int val) const { return false; } virtual int proc20() const { return 0; } /** |