ScummVM API documentation
tt_scripts.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_SCRIPTS_H
23#define TITANIC_TT_SCRIPTS_H
24
25#include "titanic/core/list.h"
26#include "titanic/true_talk/tt_npc_script.h"
27#include "titanic/true_talk/tt_room_script.h"
28
29namespace Titanic {
30
31class CTitleEngine;
32
34public:
35 TTnpcScript *_npcScript;
36 TTroomScript *_roomScript;
37public:
38 TTnpcScriptListItem() : _npcScript(nullptr), _roomScript(nullptr) {}
39 TTnpcScriptListItem(TTnpcScript *script, TTroomScript *roomScript) :
40 _npcScript(script), _roomScript(roomScript) {}
41 ~TTnpcScriptListItem() override { delete _npcScript; }
42};
43
44PTR_LIST_ITEM(TTroomScript);
45
46class TTnpcScriptList : public List<TTnpcScriptListItem> {
47public:
48 TTnpcScript *findById(int charId) const;
49};
50
51class TTroomScriptList : public List<TTroomScriptListItem> {
52public:
53 TTroomScript *findById(uint scriptId) const;
54};
55
56class TTscripts {
57private:
58 TTnpcScriptList _npcScripts;
59 TTroomScriptList _roomScripts;
60private:
64 void addScript(TTnpcScript *script, int charId);
65
69 void addScript(TTroomScript *script);
70public:
71 TTscripts();
72
76 TTroomScript *getRoomScript(int scriptId) const;
77
81 TTnpcScript *getNpcScript(int charId) const;
82};
83
84} // End of namespace Titanic
85
86#endif /* TITANIC_TT_CHARACTERS_H */
Definition: list.h:71
Definition: list.h:35
Definition: tt_npc_script.h:88
Definition: tt_scripts.h:46
Definition: tt_scripts.h:33
Definition: tt_room_script.h:61
Definition: tt_scripts.h:51
Definition: tt_scripts.h:56
TTnpcScript * getNpcScript(int charId) const
TTroomScript * getRoomScript(int scriptId) const