ScummVM API documentation
ringworld_logic.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 TSAGE_RINGWORLD_LOGIC_H
23 #define TSAGE_RINGWORLD_LOGIC_H
24 
25 #include "common/scummsys.h"
26 #include "tsage/events.h"
27 #include "tsage/core.h"
28 #include "tsage/scenes.h"
29 #include "tsage/globals.h"
30 
31 namespace TsAGE {
32 
33 namespace Ringworld {
34 
35 using namespace TsAGE;
36 
37 class SceneFactory {
38 public:
39  static Scene *createScene(int sceneNumber);
40 };
41 
42 class DisplayHotspot : public SceneObject {
43 private:
44  Common::Array<int> _actions;
45  bool performAction(int action);
46 public:
47  DisplayHotspot(int regionId, ...);
48 
49  void doAction(int action) override {
50  if (!performAction(action))
51  SceneHotspot::doAction(action);
52  }
53 };
54 
55 class DisplayObject : public SceneObject {
56 private:
57  Common::Array<int> _actions;
58  bool performAction(int action);
59 public:
60  DisplayObject(int firstAction, ...);
61 
62  void doAction(int action) override {
63  if (!performAction(action))
64  SceneHotspot::doAction(action);
65  }
66 };
67 
68 class SceneObjectExt : public SceneObject {
69 public:
70  int _state;
71 
72  void synchronize(Serializer &s) override {
73  SceneObject::synchronize(s);
74  s.syncAsSint16LE(_state);
75  }
76  Common::String getClassName() override { return "SceneObjectExt"; }
77 };
78 
79 class SceneArea : public SavedObject {
80 public:
81  GfxSurface _surface;
82  GfxSurface *_savedArea;
83  Common::Point _pt;
84  int _resNum;
85  int _rlbNum;
86  int _subNum;
87  int _actionId;
88  Rect _bounds;
89 public:
90  SceneArea();
91  ~SceneArea() override;
92 
93  void setup(int resNum, int rlbNum, int subNum, int actionId);
94  void draw2();
95  void display();
96  void restore();
97 
98  void synchronize(Serializer &s) override;
99  virtual void draw(bool flag);
100  virtual void wait();
101 };
102 
103 /*--------------------------------------------------------------------------*/
104 
106 private:
107  bool _ESP;
108  bool _RUS;
109 public:
110  InvObject _stunner;
111  InvObject _scanner;
112  InvObject _stasisBox;
113  InvObject _infoDisk;
114  InvObject _stasisNegator;
115  InvObject _keyDevice;
116  InvObject _medkit;
117  InvObject _ladder;
118  InvObject _rope;
119  InvObject _key;
120  InvObject _translator;
121  InvObject _ale;
122  InvObject _paper;
123  InvObject _waldos;
124  InvObject _stasisBox2;
125  InvObject _ring;
126  InvObject _cloak;
127  InvObject _tunic;
128  InvObject _candle;
129  InvObject _straw;
130  InvObject _scimitar;
131  InvObject _sword;
132  InvObject _helmet;
133  InvObject _items;
134  InvObject _concentrator;
135  InvObject _nullifier;
136  InvObject _peg;
137  InvObject _vial;
138  InvObject _jacket;
139  InvObject _tunic2;
140  InvObject _bone;
141  InvObject _jar;
142  InvObject _emptyJar;
143 public:
145 
146  Common::String getClassName() override { return "RingworldInvObjectList"; }
147 };
148 
149 #define RING_INVENTORY (*((::TsAGE::Ringworld::RingworldInvObjectList *)g_globals->_inventory))
150 
151 class RingworldGame: public Game {
152 public:
153  void start() override;
154  void restart() override;
155  void endGame(int resNum, int lineNum) override;
156 
157  Scene *createScene(int sceneNumber) override;
158  void processEvent(Event &event) override;
159  void rightClick() override;
160  bool canSaveGameStateCurrently() override;
161  bool canLoadGameStateCurrently() override;
162 };
163 
164 class NamedHotspot : public SceneHotspot {
165 public:
166  NamedHotspot();
167 
168  void doAction(int action) override;
169  Common::String getClassName() override { return "NamedHotspot"; }
170  void synchronize(Serializer &s) override;
171 };
172 
174 public:
175  int _flag;
176  NamedHotspotExt() { _flag = 0; }
177 
178  Common::String getClassName() override { return "NamedHotspot"; }
179  void synchronize(Serializer &s) override {
180  NamedHotspot::synchronize(s);
181  s.syncAsSint16LE(_flag);
182  }
183 };
184 
185 } // End of namespace Ringworld
186 
187 } // End of namespace TsAGE
188 
189 #endif
Definition: core.h:75
Definition: core.h:443
Definition: str.h:59
Definition: saveload.h:98
Definition: ringworld_logic.h:151
Definition: ringworld_logic.h:55
Definition: ringworld_logic.h:68
Definition: ringworld_logic.h:42
Definition: ringworld_logic.h:105
Definition: ringworld_logic.h:173
Definition: graphics.h:79
Definition: core.h:47
Definition: rect.h:45
Definition: events.h:47
Definition: blueforce_dialogs.h:30
Definition: saveload.h:63
Definition: scenes.h:33
Definition: core.h:519
Definition: graphics.h:40
Definition: ringworld_logic.h:79
Definition: ringworld_logic.h:37
Definition: ringworld_logic.h:164
Definition: scenes.h:109