xoreos  0.0.5
game.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_KOTOR2_GAME_H
26 #define ENGINES_KOTOR2_GAME_H
27 
28 #include <vector>
29 
30 #include "src/common/scopedptr.h"
31 #include "src/common/ustring.h"
32 
33 #include "src/sound/types.h"
34 
35 namespace Engines {
36 
37 class Console;
38 
39 namespace KotOR2 {
40 
41 class KotOR2Engine;
42 
43 class Functions;
44 
45 class Module;
46 
47 class Game {
48 public:
49  Game(KotOR2Engine &engine, ::Engines::Console &console, Aurora::Platform platform);
50  ~Game();
51 
53  Module &getModule();
54 
56  void playMusic(const Common::UString &music = "");
58  void stopMusic();
59 
60  void run();
61 
63  static void getModules(std::vector<Common::UString> &modules);
64 
65 
66 private:
68 
71 
73 
75 
77 
78 
79  void stopMenuMusic();
80  void playMenuMusic(Common::UString music = "");
81 
82  void mainMenu();
83  void runModule();
84 };
85 
86 } // End of namespace KotOR2
87 
88 } // End of namespace Engines
89 
90 #endif // ENGINES_KOTOR2_GAME_H
Common::ScopedPtr< Module > _module
Definition: game.h:69
A class holding an UTF-8 string.
Definition: ustring.h:48
void playMusic(const Common::UString &music="")
Overwrite all currently playing music.
Definition: game.cpp:117
Sound::ChannelHandle _menuMusic
Definition: game.h:76
Basic sound types.
::Engines::Console * _console
Definition: game.h:74
A simple scoped smart pointer template.
Game(KotOR2Engine &engine, ::Engines::Console &console, Aurora::Platform platform)
Definition: game.cpp:54
KotOR2Engine * _engine
Definition: game.h:67
void playMenuMusic(Common::UString music="")
Definition: game.cpp:104
static void getModules(std::vector< Common::UString > &modules)
Return a list of all modules.
Definition: game.cpp:155
Module & getModule()
Return the module context.
Definition: game.cpp:63
void stopMenuMusic()
Definition: game.cpp:113
A scoped plain pointer, allowing pointer-y access and normal deletion.
Definition: scopedptr.h:120
void stopMusic()
Force all currently playing music stopped.
Definition: game.cpp:129
Common::ScopedPtr< Functions > _functions
Definition: game.h:70
Unicode string handling.
A handle to a sound channel.
Definition: types.h:35
Aurora::Platform _platform
Definition: game.h:72
Platform
Definition: types.h:429