aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/true_talk
diff options
context:
space:
mode:
authorPaul Gilbert2016-06-09 20:12:29 -0400
committerPaul Gilbert2016-07-15 19:21:32 -0400
commitf6cd02ce78627cfbc725eb999aca1a623cf43917 (patch)
treec3a3c33406eb48b402ce9f41d3cd8e37f83111c3 /engines/titanic/true_talk
parentd99e06f373da39f7eda3c302619709d1e042ec8b (diff)
downloadscummvm-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.cpp4
-rw-r--r--engines/titanic/true_talk/tt_sentence.h6
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