ScummVM API documentation
tt_sentence.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_SENTENCE_H
23 #define TITANIC_TT_SENTENCE_H
24 
25 #include "common/array.h"
26 #include "titanic/true_talk/tt_concept_node.h"
27 #include "titanic/true_talk/tt_npc_script.h"
28 #include "titanic/true_talk/tt_room_script.h"
29 #include "titanic/true_talk/tt_sentence_node.h"
30 #include "titanic/true_talk/tt_string.h"
31 
32 namespace Titanic {
33 
34 class CScriptHandler;
35 class TTword;
36 
38 public:
41  ~TTsentenceConcept() override;
42 
47 };
48 
49 class TTsentence {
50 private:
51  CScriptHandler *_owner;
52  int _inputCtr;
53  int _field34;
54  TTsentenceNode *_nodesP;
55  int _field5C;
56  int _status;
57 private:
61  void copyFrom(const TTsentence &src);
62 public:
63  TTsentenceConcept _sentenceConcept;
64  TTstring _initialLine;
65  TTstring _normalizedLine;
66  int _field38;
67  int _field58;
68  TTroomScript *_roomScript;
69  TTnpcScript *_npcScript;
70  int _category;
71 public:
72  TTsentence(int inputCtr, const TTstring &line, CScriptHandler *owner,
73  TTroomScript *roomScript, TTnpcScript *npcScript);
74  TTsentence(const TTsentence *src);
75  ~TTsentence();
76 
77  void setState(int v) { _field34 = v; }
78  void set38(int v) { _field38 = v; }
79  bool checkCategory() const { return _category > 1 && _category <= 10; }
80  int concept18(TTconceptNode *conceptNode) {
81  return conceptNode ? conceptNode->get18() : 0;
82  }
83  int get58() const { return _field58; }
84  int is18(int val, const TTconceptNode *node) const;
85  int is1C(int val, const TTconceptNode *node) const;
86 
87  int getStatus() const { return _status; }
88 
92  TTconcept *getFrameEntry(int slotIndex, const TTconceptNode *conceptNode = nullptr) const;
93 
97  TTconcept *getFrameSlot(int slotIndex, const TTconceptNode *conceptNode = nullptr) const;
98 
102  bool isFrameSlotClass(int slotIndex, WordClass wordClass, const TTconceptNode *conceptNode = nullptr) const;
103 
109  int storeVocabHit(TTword *word);
110 
111  bool fn1(const CString &str, int wordId1, const CString &str1, const CString &str2,
112  const CString &str3, int wordId2, int val1, int val2, const TTconceptNode *node) const;
113  bool fn3(const CString &str1, const CString &str2, const CString &str3,
114  const CString &str4, const CString &str5, const CString &str6,
115  int val1, int val2, const TTconceptNode *node) const;
116  bool fn2(int slotIndex, const TTstring &str, const TTconceptNode *node = nullptr) const;
117  bool fn4(int mode, int wordId, const TTconceptNode *node = nullptr) const;
118 
119  bool isConcept34(int slotIndex, const TTconceptNode *node = nullptr) const;
120 
125  bool localWord(const char *str) const;
126 
131  bool contains(const char *str) const;
132 };
133 
134 } // End of namespace Titanic
135 
136 #endif /* TITANIC_TT_SENTENCE_H */
Definition: tt_sentence.h:37
Definition: tt_concept.h:35
TTsentenceConcept * addSibling()
Definition: tt_room_script.h:61
Definition: tt_sentence.h:49
Definition: tt_npc_script.h:88
Definition: tt_concept_node.h:29
Definition: arm.h:30
Definition: string.h:40
Definition: tt_string.h:45
Definition: tt_word.h:41
Definition: script_handler.h:36
Definition: tt_sentence_node.h:30