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_NWN_GAME_H
26 #define ENGINES_NWN_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 NWN {
40 
41 class NWNEngine;
42 class Version;
43 
44 class Functions;
45 
46 class Module;
47 
48 class Game {
49 public:
50  Game(NWNEngine &engine, ::Engines::Console &console, const Version &version);
51  ~Game();
52 
53  const Version &getVersion() const;
54 
56  Module &getModule();
57 
59  void playMusic(const Common::UString &music = "");
61  void stopMusic();
62 
63  void run();
64 
66  static void getModules(std::vector<Common::UString> &modules);
68  static void getPremiumModules(std::vector<Common::UString> &modules);
70  static bool hasPremiumModules();
72  static bool isPremiumModule(const Common::UString &module);
74  static bool hasModule(Common::UString &module);
76  static void getCharacters(std::vector<Common::UString> &characters, bool local);
77 
78 
79 private:
81 
84 
86 
87  const Version *_version;
88 
90 
91 
92  void stopMenuMusic();
93  void playMenuMusic(Common::UString music = "");
94 
95  void mainMenu(bool playStartSound, bool showLegal);
96  void runModule();
97 };
98 
99 } // End of namespace NWN
100 
101 } // End of namespace Engines
102 
103 #endif // ENGINES_NWN_GAME_H
Common::ScopedPtr< Functions > _functions
Definition: game.h:83
A class holding an UTF-8 string.
Definition: ustring.h:48
static void getCharacters(std::vector< Common::UString > &characters, bool local)
Return a list of local player characters.
Definition: game.cpp:190
static void getModules(std::vector< Common::UString > &modules)
Return a list of all modules.
Definition: game.cpp:210
Game(NWNEngine &engine, ::Engines::Console &console, const Version &version)
Definition: game.cpp:57
Basic sound types.
void stopMenuMusic()
Definition: game.cpp:124
void playMusic(const Common::UString &music="")
Overwrite all currently playing music.
Definition: game.cpp:128
const Version * _version
Definition: game.h:87
A simple scoped smart pointer template.
static bool hasModule(Common::UString &module)
Does this module exist?
Definition: game.cpp:266
static void getPremiumModules(std::vector< Common::UString > &modules)
Return a list of all premium modules.
Definition: game.cpp:230
void playMenuMusic(Common::UString music="")
Definition: game.cpp:115
Sound::ChannelHandle _menuMusic
Definition: game.h:89
void mainMenu(bool playStartSound, bool showLegal)
Definition: game.cpp:150
const Version & getVersion() const
Definition: game.cpp:66
A scoped plain pointer, allowing pointer-y access and normal deletion.
Definition: scopedptr.h:120
static bool hasPremiumModules()
Do we actually have any premium modules installed at all?
Definition: game.cpp:242
Unicode string handling.
A handle to a sound channel.
Definition: types.h:35
Common::ScopedPtr< Module > _module
Definition: game.h:82
NWNEngine * _engine
Definition: game.h:80
::Engines::Console * _console
Definition: game.h:85
static bool isPremiumModule(const Common::UString &module)
Is this module file (including extension) a premium module?
Definition: game.cpp:249
void runModule()
Definition: game.cpp:89
void stopMusic()
Force all currently playing music stopped.
Definition: game.cpp:140
Module & getModule()
Return the module context.
Definition: game.cpp:70