xoreos  0.0.5
module.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef ENGINES_SONIC_MODULE_H
26 #define ENGINES_SONIC_MODULE_H
27 
28 #include "src/common/types.h"
29 #include "src/common/scopedptr.h"
30 
31 #include "src/events/types.h"
32 
35 
36 namespace Engines {
37 
38 class Console;
39 
40 namespace Sonic {
41 
42 class Area;
43 
46 public:
47  Module(::Engines::Console &console);
48  ~Module();
49 
51  void clear();
52 
54  void run();
56  void exit();
57 
59  bool isRunning() const;
60 
63 
65  void movePC(int32 area);
66 
67 
68 protected:
70 
71  bool _running;
72  bool _exit;
73 
75 
77 
78 
79  void unload();
80 
81  void loadArea();
82  void unloadArea();
83 
84  void handleEvents();
85  bool handleCameraEvents(const Events::Event &event);
86 };
87 
88 } // End of namespace Sonic
89 
90 } // End of namespace Engines
91 
92 #endif // ENGINES_SONIC_MODULE_H
Basic event types.
::Engines::Console * _console
Definition: module.h:69
Common::ScopedPtr< Area > _area
The current area.
Definition: module.h:76
Module(::Engines::Console &console)
Definition: module.cpp:44
void run()
Run the module.
Definition: module.cpp:63
A simple scoped smart pointer template.
int32 _newArea
The new area to enter.
Definition: module.h:74
An object within a Sonic area.
Definition: object.h:40
SDL_Event Event
Definition: types.h:42
void clear()
Clear the whole context.
Definition: module.cpp:59
Low-level type definitions to handle fixed width types portably.
A scoped plain pointer, allowing pointer-y access and normal deletion.
Definition: scopedptr.h:120
bool _exit
Should we exit the module?
Definition: module.h:72
A Sonic module.
Definition: module.h:45
void movePC(int32 area)
Move the player character to this area.
Definition: module.cpp:203
A container of Sonic Chronicles: The Dark Brotherhood objects.
An object in a Sonic Chronicles: The Dark Brotherhood area.
void exit()
Exit the module.
Definition: module.cpp:100
bool handleCameraEvents(const Events::Event &event)
Definition: module.cpp:164
bool isRunning() const
Is the module currently running?
Definition: module.cpp:96
bool _running
Are we currently running a module?
Definition: module.h:71
int32_t int32
Definition: types.h:203
Area * getCurrentArea()
Return the area the PC is currently in.
Definition: module.cpp:199