diff options
author | Paul Gilbert | 2016-06-09 20:12:29 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-15 19:21:32 -0400 |
commit | f6cd02ce78627cfbc725eb999aca1a623cf43917 (patch) | |
tree | c3a3c33406eb48b402ce9f41d3cd8e37f83111c3 /engines/titanic/true_talk | |
parent | d99e06f373da39f7eda3c302619709d1e042ec8b (diff) | |
download | scummvm-rg350-f6cd02ce78627cfbc725eb999aca1a623cf43917.tar.gz scummvm-rg350-f6cd02ce78627cfbc725eb999aca1a623cf43917.tar.bz2 scummvm-rg350-f6cd02ce78627cfbc725eb999aca1a623cf43917.zip |
TITANIC: Added TTsentence contains
Diffstat (limited to 'engines/titanic/true_talk')
-rw-r--r-- | engines/titanic/true_talk/tt_sentence.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_sentence.h | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp index 54c66446f3..56ccc5ab04 100644 --- a/engines/titanic/true_talk/tt_sentence.cpp +++ b/engines/titanic/true_talk/tt_sentence.cpp @@ -266,4 +266,8 @@ bool TTsentence::localWord(const char *str) const { return false; } +bool TTsentence::contains(const char *str) const { + return _initialLine.contains(str) || _normalizedLine.contains(str); +} + } // End of namespace Titanic diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h index c9e8de9a7a..94cc265f5f 100644 --- a/engines/titanic/true_talk/tt_sentence.h +++ b/engines/titanic/true_talk/tt_sentence.h @@ -119,6 +119,12 @@ public: bool isConcept34(int slotIndex, TTconceptNode *node = nullptr); bool localWord(const char *str) const; + + /** + * Returns true if the sentence (either the original or normalized lines) + * contain the specified substring + */ + bool contains(const char *str) const; }; } // End of namespace Titanic |