ScummVM API documentation
tt_script_base.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_SCRIPT_BASE_H
23#define TITANIC_TT_SCRIPT_BASE_H
24
25#include "titanic/true_talk/tt_string.h"
26#include "titanic/true_talk/tt_hist.h"
27#include "titanic/true_talk/tt_node.h"
28#include "titanic/true_talk/tt_response.h"
29
30namespace Titanic {
31
32enum ScriptChangedResult {
33 SCR_0 = 0, SCR_1 = 1, SCR_2 = 2, SCR_3 = 3, SCR_4 = 4, SCR_5 = 5
34};
35
36class TTsentence;
37
39private:
40 void reset();
41protected:
42 TTnode *_nodesP;
43 TThist *_hist1P;
44 TTstring _charName, _charClass;
45 int _field20;
46 int _field24;
47 int _field28;
48 int _field2C;
49 int _field30;
50 int _state;
51 TThist *_hist2P;
52 int _field3C;
53 TTresponse *_respTailP;
54 TTresponse *_respHeadP;
55 TTresponse *_oldResponseP;
56 int _status;
57protected:
62
67 void appendResponse(int index, int *maxP, int id);
68
72 void appendResponse(int index, int *maxP, const TTstring &str);
73
77 void appendResponse2(int index, int *maxP, const TTstring &str) {
78 appendResponse(index, maxP, str);
79 }
80
84 void setState(int state) { _state = state; }
85
89 int getState() const { return _state; }
90public:
91 int _id;
92public:
93 TTscriptBase(int scriptId, const char *charClass, int v2, const char *charName,
94 int v3, int v4, int v5, int v6, int v7);
95 virtual ~TTscriptBase();
96
97 virtual void addResponse(const TTstring &str);
98
99 virtual void addResponse(int id);
100
105 virtual void applyResponse();
106
110 bool isValid();
111
115 int getId() const { return _id; }
116
120 int getStatus() const { return _status; }
121
125 const TTstring getText() { return _charClass; }
126
131
132};
133
134
135} // End of namespace Titanic
136
137#endif /* TITANIC_TT_SCRIPT_BASE_H */
Definition: tt_hist.h:29
Definition: tt_node.h:27
Definition: tt_response.h:30
Definition: tt_script_base.h:38
int getState() const
Definition: tt_script_base.h:89
void appendResponse(int index, int *maxP, int id)
int getId() const
Definition: tt_script_base.h:115
const TTstring getText()
Definition: tt_script_base.h:125
void appendResponse(int index, int *maxP, const TTstring &str)
int getStatus() const
Definition: tt_script_base.h:120
void setState(int state)
Definition: tt_script_base.h:84
virtual void applyResponse()
int scriptPreprocess(TTsentence *sentence)
void appendResponse2(int index, int *maxP, const TTstring &str)
Definition: tt_script_base.h:77
Definition: tt_sentence.h:49
Definition: tt_string.h:45