xoreos  0.0.5
engine.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_ENGINE_H
26 #define ENGINES_ENGINE_H
27 
28 #include <vector>
29 
30 #include <boost/noncopyable.hpp>
31 
32 #include "src/common/scopedptr.h"
33 #include "src/common/ustring.h"
34 
35 #include "src/aurora/types.h"
36 #include "src/aurora/language.h"
37 
38 namespace Graphics {
39  namespace Aurora {
40  class FPS;
41  }
42 }
43 
44 namespace Engines {
45 
46 class Console;
47 
49 class Engine : boost::noncopyable {
50 public:
51  Engine();
52  virtual ~Engine();
53 
55  virtual bool detectLanguages(Aurora::GameID game, const Common::UString &target,
56  Aurora::Platform platform,
57  std::vector<Aurora::Language> &languages) const;
58 
60  virtual bool detectLanguages(Aurora::GameID game, const Common::UString &target,
61  Aurora::Platform platform,
62  std::vector<Aurora::Language> &languagesText,
63  std::vector<Aurora::Language> &languagesVoice) const;
64 
65  bool detectLanguages(std::vector<Aurora::Language> &languages) const;
66  bool detectLanguages(std::vector<Aurora::Language> &languagesText,
67  std::vector<Aurora::Language> &languagesVoice) const;
68 
70  virtual bool getLanguage(Aurora::Language &language) const;
72  virtual bool getLanguage(Aurora::Language &languageText, Aurora::Language &languageVoice) const;
73 
75  virtual bool changeLanguage();
76 
77  void start(Aurora::GameID game, const Common::UString &target, Aurora::Platform platform);
78 
80  void showFPS();
81 
82 protected:
86 
88 
90 
91 
93  virtual void run() = 0;
94 
95  bool evaluateLanguage(bool find, Aurora::Language &language) const;
96  bool evaluateLanguage(bool find, Aurora::Language &languageVoice, Aurora::Language &languageText) const;
97 };
98 
99 } // End of namespace Engines
100 
101 #endif // ENGINES_ENGINE_H
virtual bool getLanguage(Aurora::Language &language) const
Return the game&#39;s current language.
Definition: engine.cpp:68
Aurora::Platform _platform
Definition: engine.h:84
GameID
Definition: types.h:393
A class holding an UTF-8 string.
Definition: ustring.h:48
Common::ScopedPtr< Console > _console
Definition: engine.h:87
bool evaluateLanguage(bool find, Aurora::Language &language) const
Definition: engine.cpp:198
Language
Definition: language.h:46
A simple scoped smart pointer template.
Types and functions related to language.
virtual void run()=0
Run the game.
A scoped plain pointer, allowing pointer-y access and normal deletion.
Definition: scopedptr.h:120
virtual ~Engine()
Definition: engine.cpp:42
Unicode string handling.
Basic type definitions to handle files used in BioWare&#39;s Aurora engine.
The base class for an engine within BioWare&#39;s Aurora family.
Definition: engine.h:49
void start(Aurora::GameID game, const Common::UString &target, Aurora::Platform platform)
Definition: engine.cpp:81
virtual bool changeLanguage()
Change the game&#39;s current language.
Definition: engine.cpp:77
Common::UString _target
Definition: engine.h:85
void showFPS()
Evaluate the FPS display setting and show/hide the FPS display.
Definition: engine.cpp:91
Aurora::GameID _game
Definition: engine.h:83
Common::ScopedPtr< Graphics::Aurora::FPS > _fps
Definition: engine.h:89
virtual bool detectLanguages(Aurora::GameID game, const Common::UString &target, Aurora::Platform platform, std::vector< Aurora::Language > &languages) const
Detect which languages this game instance supports.
Definition: engine.cpp:45
Platform
Definition: types.h:429