ScummVM API documentation
tt_concept.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef TITANIC_TT_CONCEPT_H
23#define TITANIC_TT_CONCEPT_H
24
25#include "titanic/true_talk/tt_string.h"
26#include "titanic/true_talk/tt_word.h"
27
28namespace Titanic {
29
30enum ScriptType { ST_UNKNOWN_SCRIPT = 0, ST_ROOM_SCRIPT = 1, ST_NPC_SCRIPT = 2 };
31
32class TTscriptBase;
33class TTword;
34
35class TTconcept {
36private:
37 TTstring _string1;
38 int _field1C;
39 TTword *_word2P;
40 int _field30;
41 bool _flag;
42 int _status;
43private:
47 bool setStatus();
48
52 void setScriptType(ScriptType scriptType);
53
57 int initializeWordRef(TTword *word);
58
62 void reset();
63
67 void initialize(TTconcept &src);
68public:
69 TTconcept *_nextP;
70 TTscriptBase *_scriptP;
71 TTword *_wordP;
72 int _scriptType;
73 int _field14;
74 int _field20;
75 int _field34;
76 TTstring _string2;
77public:
78 TTconcept();
79 TTconcept(TTscriptBase *script, ScriptType scriptType);
80 TTconcept(TTword *word, ScriptType scriptType = ST_UNKNOWN_SCRIPT);
81 TTconcept(TTconcept &src);
82 ~TTconcept();
83
88
92 void copyFrom(TTconcept *src);
93
97 bool compareTo(const char *str) const;
98
102 bool compareTo(TTword *word) const;
103
108
112 int setOwner(TTword *src, bool dontDup);
113
117 int getStatus() const { return _status; }
118
122 bool isValid() const { return _status == SS_VALID; }
123
127 bool isWordClass(WordClass wordClass) const {
128 return _wordP && _wordP->isClass(wordClass);
129 }
130
131 void setFlag(bool val) { _flag = val; }
132 void set1C(int val) { _field1C = val; }
133 int get20() const { return _field20; }
134 int getState() const { return _field34; }
135
136 bool checkWordId1() const;
137 bool checkWordId2() const;
138 bool checkWordId3() const;
139 bool checkWordClass() const;
140
145
150
154 static TTconcept *findByWordClass(TTconcept *conceptP, WordClass wordClass);
155
156 TTconcept *findBy20(int val);
157
161 bool isTheWordId(int id) const;
162
166 int getTheWordId() const;
167};
168
169extern bool isWordId(const TTconcept *conceptP, int id);
170
171extern int getWordId(const TTconcept *conceptP);
172
173} // End of namespace Titanic
174
175#endif /* TITANIC_TT_CONCEPT_H */
Definition: tt_concept.h:35
int setOwner(TTword *src, bool dontDup)
void copyFrom(TTconcept *src)
bool compareTo(TTword *word) const
bool isWordClass(WordClass wordClass) const
Definition: tt_concept.h:127
bool compareTo(const char *str) const
bool isTheWordId(int id) const
TTconcept * findByWordId(int id)
static TTconcept * findByWordClass(TTconcept *conceptP, WordClass wordClass)
int getStatus() const
Definition: tt_concept.h:117
bool isValid() const
Definition: tt_concept.h:122
const TTstring getText()
int getTheWordId() const
int setOwner(TTconcept *src)
Definition: tt_script_base.h:38
Definition: tt_string.h:45
Definition: tt_word.h:41
bool isClass(WordClass wordClass) const
Definition: tt_word.h:148