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 "common/str.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
33namespace Ultima {
34namespace Nuvie {
35
36class Events;
37class Game;
38class SaveGame;
39class Screen;
40class Script;
41class SoundManager;
42
43class NuvieEngine : public Engine {
44private:
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;
54protected:
55 const UltimaGameDescription *_gameDescription;
56private:
57 void initConfig();
58 void assignGameConfigValues(uint8 game_type);
59 bool checkGameDir(uint8 game_type);
60 bool checkDataDir();
61
62 bool playIntro();
63protected:
64 bool initialize();
65
69 bool isDataRequired(Common::Path &folder, int &majorVersion, int &minorVersion);
70public:
71 const Common::String c_empty_string;
72public:
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
137
142
146 bool quickSave(int saveSlot, bool isLoad);
147
152 return _soundManager;
153 }
154};
155
156extern NuvieEngine *g_engine;
157
158} // End of namespace Nuvie
159} // End of namespace Ultima
160
161#endif
Definition: error.h:81
Definition: path.h:52
Definition: random.h:44
uint getRandomNumber(uint max)
Definition: str.h:59
Definition: ustr.h:57
Definition: engine.h:149
EngineFeature
Definition: engine.h:282
Definition: system.h:166
Definition: configuration.h:60
Definition: events.h:183
Definition: game.h:72
Definition: nuvie.h:43
bool hasFeature(EngineFeature f) const override
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave) override
bool isDataRequired(Common::Path &folder, int &majorVersion, int &minorVersion)
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Common::Error loadGameState(int slot) override
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Common::Error run() override
void syncSoundSettings() override
bool quickSave(int saveSlot, bool isLoad)
uint getRandomNumber(uint maxVal)
Definition: nuvie.h:100
SoundManager * getSoundManager() const
Definition: nuvie.h:151
Definition: save_game.h:43
Definition: screen.h:41
Definition: script.h:101
Definition: sound_manager.h:62
Engine * g_engine
Definition: atari-screen.h:58
Definition: detection.h:65