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 
29 namespace Titanic {
30 
31 class CTitleEngine;
32 
33 class TTnpcScriptListItem : public ListItem {
34 public:
35  TTnpcScript *_npcScript;
36  TTroomScript *_roomScript;
37 public:
38  TTnpcScriptListItem() : _npcScript(nullptr), _roomScript(nullptr) {}
39  TTnpcScriptListItem(TTnpcScript *script, TTroomScript *roomScript) :
40  _npcScript(script), _roomScript(roomScript) {}
41  ~TTnpcScriptListItem() override { delete _npcScript; }
42 };
43 
44 PTR_LIST_ITEM(TTroomScript);
45 
46 class TTnpcScriptList : public List<TTnpcScriptListItem> {
47 public:
48  TTnpcScript *findById(int charId) const;
49 };
50 
51 class TTroomScriptList : public List<TTroomScriptListItem> {
52 public:
53  TTroomScript *findById(uint scriptId) const;
54 };
55 
56 class TTscripts {
57 private:
58  TTnpcScriptList _npcScripts;
59  TTroomScriptList _roomScripts;
60 private:
64  void addScript(TTnpcScript *script, int charId);
65 
69  void addScript(TTroomScript *script);
70 public:
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: tt_scripts.h:56
Definition: tt_room_script.h:61
Definition: list.h:35
Definition: tt_scripts.h:33
Definition: tt_scripts.h:46
Definition: tt_npc_script.h:88
Definition: list.h:71
Definition: arm.h:30
Definition: tt_scripts.h:51