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 Game;
37 class SaveGame;
38 class Screen;
39 class Script;
40 class SoundManager;
41 
43 private:
44  Common::RandomSource _randomSource;
45  Configuration *_config;
46  Screen *_screen;
47  Script *_script;
48  Game *_game;
49  SaveGame *_savegame;
50 
51  SoundManager *_soundManager;
53 protected:
54  const UltimaGameDescription *_gameDescription;
55 private:
56  void initConfig();
57  void assignGameConfigValues(uint8 game_type);
58  bool checkGameDir(uint8 game_type);
59  bool checkDataDir();
60 
61  bool playIntro();
62 protected:
63  bool initialize();
64 
68  bool isDataRequired(Common::Path &folder, int &majorVersion, int &minorVersion);
69 public:
70  const Std::string c_empty_string;
71 public:
72  NuvieEngine(OSystem *syst, const Ultima::UltimaGameDescription *gameDesc);
73  ~NuvieEngine() override;
74 
78  GameId getGameId() const;
79 
84  bool isEnhanced() const;
85 
89  Common::Error run() override;
90 
94  bool hasFeature(EngineFeature f) const override;
95 
99  uint getRandomNumber(uint maxVal) { return _randomSource.getRandomNumber(maxVal); }
100 
104  void syncSoundSettings() override;
105 
109  bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
110 
114  bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
115 
121  Common::Error loadGameState(int slot) override;
122 
130  Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave) override;
131 
135  bool journeyOnwards();
136 
140  bool loadLatestSave();
141 
145  bool quickSave(int saveSlot, bool isLoad);
146 
151  return _soundManager;
152  }
153 };
154 
155 extern NuvieEngine *g_engine;
156 
157 } // End of namespace Nuvie
158 } // End of namespace Ultima
159 
160 #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:260
Definition: error.h:81
Definition: configuration.h:61
Definition: save_game.h:43
SoundManager * getSoundManager() const
Definition: nuvie.h:150
uint getRandomNumber(uint maxVal)
Definition: nuvie.h:99
Definition: nuvie.h:42
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: 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
Definition: events.h:139
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: events.h:124
Definition: engine.h:146
Definition: game.h:73
bool quickSave(int saveSlot, bool isLoad)