diff options
author | Paul Gilbert | 2016-05-22 15:02:02 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-15 19:14:30 -0400 |
commit | c3055aeaf08601f8072de1c7d1922284bc3f933f (patch) | |
tree | b235bce204ce084224fe5b0e57d2a351d916ea30 /engines/titanic/true_talk | |
parent | 6ab35972e87fd1ac6a2eab7a4a07683f2e844d76 (diff) | |
download | scummvm-rg350-c3055aeaf08601f8072de1c7d1922284bc3f933f.tar.gz scummvm-rg350-c3055aeaf08601f8072de1c7d1922284bc3f933f.tar.bz2 scummvm-rg350-c3055aeaf08601f8072de1c7d1922284bc3f933f.zip |
TITANIC: Added TTconcept setOwner
Diffstat (limited to 'engines/titanic/true_talk')
-rw-r--r-- | engines/titanic/true_talk/tt_concept.cpp | 30 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_concept.h | 10 |
2 files changed, 40 insertions, 0 deletions
diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp index f88722eb48..8f428391bf 100644 --- a/engines/titanic/true_talk/tt_concept.cpp +++ b/engines/titanic/true_talk/tt_concept.cpp @@ -202,6 +202,36 @@ void TTconcept::copyFrom(TTconcept *src) { reset(); } +int TTconcept::setOwner(TTconcept *src) { + if (this) { + if (src->_wordP) { + TTword *newWord = src->_wordP->copy(); + return setOwner(newWord, 1); + } + } + + return 0; +} + +int TTconcept::setOwner(TTword *src, bool dontDup) { + TTword *word = dontDup ? src : src->copy(); + + if (word) { + if (!_word2P) { + _word2P = word; + } else { + // Add word to end of word list + TTword *tailP = _word2P; + while (tailP->_nextP) + tailP = tailP->_nextP; + + tailP->_nextP = word; + } + } + + return 0; +} + bool TTconcept::checkWordId1() const { return (_wordP && (_wordP->_id == 200 || _wordP->_id == 201 || _wordP->_id == 602 || _wordP->_id == 607)) || diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h index a2e5fb2e2a..4b908ca2b2 100644 --- a/engines/titanic/true_talk/tt_concept.h +++ b/engines/titanic/true_talk/tt_concept.h @@ -98,6 +98,16 @@ public: bool compareTo(const char *str) const; /** + * Set an owner for the concept + */ + int setOwner(TTconcept *src); + + /** + * Set an owner for the concept + */ + int setOwner(TTword *src, bool dontDup); + + /** * Return the status of the concept */ int getStatus() const { return _status; } |