ScummVM API documentation
nuvie.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef NUVIE_NUVIE_H
23 #define NUVIE_NUVIE_H
24 
25 #include "ultima/shared/engine/events.h"
26 #include "ultima/shared/std/string.h"
27 #include "ultima/nuvie/conf/configuration.h"
28 #include "common/archive.h"
29 #include "common/random.h"
30 #include "engines/engine.h"
31 #include "gui/debugger.h"
32 
33 namespace Ultima {
34 namespace Nuvie {
35 
36 class Events;
37 class Game;
38 class SaveGame;
39 class Screen;
40 class Script;
41 class SoundManager;
42 
43 class NuvieEngine : public Engine {
44 private:
45  Common::RandomSource _randomSource;
46  Configuration *_config;
47  Screen *_screen;
48  Script *_script;
49  Game *_game;
50  SaveGame *_savegame;
51 
52  SoundManager *_soundManager;
53  Events *_events;
54 protected:
55  const UltimaGameDescription *_gameDescription;
56 private:
57  void initConfig();
58  void assignGameConfigValues(uint8 game_type);
59  bool checkGameDir(uint8 game_type);
60  bool checkDataDir();
61 
62  bool playIntro();
63 protected:
64  bool initialize();
65 
69  bool isDataRequired(Common::Path &folder, int &majorVersion, int &minorVersion);
70 public:
71  const Std::string c_empty_string;
72 public:
73  NuvieEngine(OSystem *syst, const Ultima::UltimaGameDescription *gameDesc);
74  ~NuvieEngine() override;
75 
79  GameId getGameId() const;
80 
85  bool isEnhanced() const;
86 
90  Common::Error run() override;
91 
95  bool hasFeature(EngineFeature f) const override;
96 
100  uint getRandomNumber(uint maxVal) { return _randomSource.getRandomNumber(maxVal); }
101 
105  void syncSoundSettings() override;
106 
110  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
111 
115  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
116 
122  Common::Error loadGameState(int slot) override;
123 
131  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave) override;
132 
136  bool journeyOnwards();
137 
141  bool loadLatestSave();
142 
146  bool quickSave(int saveSlot, bool isLoad);
147 
152  return _soundManager;
153  }
154 };
155 
156 extern NuvieEngine *g_engine;
157 
158 } // End of namespace Nuvie
159 } // End of namespace Ultima
160 
161 #endif
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave) override
Definition: str.h:59
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
EngineFeature
Definition: engine.h:258
Definition: error.h:81
Definition: configuration.h:61
Definition: save_game.h:43
SoundManager * getSoundManager() const
Definition: nuvie.h:151
uint getRandomNumber(uint maxVal)
Definition: nuvie.h:100
Definition: nuvie.h:43
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: random.h:44
Definition: path.h:52
uint getRandomNumber(uint max)
Definition: atari-screen.h:58
Definition: events.h:184
Definition: detection.h:65
Engine * g_engine
Definition: screen.h:41
Definition: detection.h:27
Definition: ustr.h:57
Definition: string.h:30
bool hasFeature(EngineFeature f) const override
Definition: sound_manager.h:62
void syncSoundSettings() override
bool isDataRequired(Common::Path &folder, int &majorVersion, int &minorVersion)
Definition: script.h:102
Common::Error loadGameState(int slot) override
Common::Error run() override
Definition: system.h:163
Definition: engine.h:144
Definition: game.h:73
bool quickSave(int saveSlot, bool isLoad)