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_KOTOR_GAME_H
26 #define ENGINES_KOTOR_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 KotOR {
40 
41 class KotOREngine;
42 
43 class Functions;
44 
45 class Version;
46 class Module;
47 
48 class Game {
49 public:
50  Game(KotOREngine &engine, ::Engines::Console &console, const Version &gameVersion);
51  ~Game();
52 
54  Module &getModule();
55 
57  void playMusic(const Common::UString &music = "");
59  void stopMusic();
60 
61  void run();
62 
64  static void getModules(std::vector<Common::UString> &modules);
65 
66 
67 private:
69 
72 
74 
76 
78 
79 
80  void stopMenuMusic();
81  void playMenuMusic(Common::UString music = "");
82 
83  void mainMenu();
84  void runModule();
85 };
86 
87 } // End of namespace KotOR
88 
89 } // End of namespace Engines
90 
91 #endif // ENGINES_KOTOR_GAME_H
void stopMenuMusic()
Definition: game.cpp:115
A class holding an UTF-8 string.
Definition: ustring.h:48
const Version * _gameVersion
Definition: game.h:73
void playMusic(const Common::UString &music="")
Overwrite all currently playing music.
Definition: game.cpp:119
Basic sound types.
Common::ScopedPtr< Functions > _functions
Definition: game.h:71
::Engines::Console * _console
Definition: game.h:75
void stopMusic()
Force all currently playing music stopped.
Definition: game.cpp:131
A simple scoped smart pointer template.
void runModule()
Definition: game.cpp:82
A scoped plain pointer, allowing pointer-y access and normal deletion.
Definition: scopedptr.h:120
Common::ScopedPtr< Module > _module
Definition: game.h:70
KotOREngine * _engine
Definition: game.h:68
Unicode string handling.
static void getModules(std::vector< Common::UString > &modules)
Return a list of all modules.
Definition: game.cpp:159
Sound::ChannelHandle _menuMusic
Definition: game.h:77
A handle to a sound channel.
Definition: types.h:35
Module & getModule()
Return the module context.
Definition: game.cpp:65
Game(KotOREngine &engine, ::Engines::Console &console, const Version &gameVersion)
Definition: game.cpp:56
void playMenuMusic(Common::UString music="")
Definition: game.cpp:106