ScummVM API documentation
ultima4.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 ULTIMA4_H
23#define ULTIMA4_H
24
25#include "common/random.h"
26#include "engines/engine.h"
27#include "ultima/detection.h"
28
29namespace Ultima {
30namespace Ultima4 {
31
32class Armors;
33class Codex;
34class Config;
35class Context;
36class Death;
37class DialogueLoaders;
38class Items;
39class GameController;
40class MapLoaders;
41class Moongates;
42class Music;
43class ResponseParts;
44struct SaveGame;
45class Screen;
46class Shrines;
47class SoundManager;
48class Spells;
49class TileMaps;
50class TileRules;
51class TileSets;
52class Weapons;
53
54class Ultima4Engine : public Engine {
55private:
56 Common::RandomSource _randomSource;
57
58 const UltimaGameDescription *_gameDescription;
59
60 int _saveSlotToLoad;
61private:
62 void startup();
63protected:
64 // Engine APIs
65 Common::Error run() override;
66
67 bool initialize();
68
72 bool isDataRequired(Common::Path &folder, int &majorVersion, int &minorVersion);
73public:
74 Armors *_armors;
75 Codex *_codex;
76 Config *_config;
77 Context *_context;
78 Death *_death;
79 DialogueLoaders *_dialogueLoaders;
80 GameController *_game;
81 Items *_items;
82 MapLoaders *_mapLoaders;
83 Moongates *_moongates;
84 Music *_music;
85 ResponseParts *_responseParts;
86 SaveGame *_saveGame;
87 Screen *_screen;
88 Shrines *_shrines;
89 SoundManager *_soundManager;
90 Spells *_spells;
91 TileMaps *_tileMaps;
92 TileRules *_tileRules;
93 TileSets *_tileSets;
94 Weapons *_weapons;
96public:
98 ~Ultima4Engine() override;
99
103 bool hasFeature(EngineFeature f) const override;
104
109 bool isEnhanced() const;
110
114 uint getRandomNumber(uint maxVal) { return _randomSource.getRandomNumber(maxVal); }
115
119 bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override;
120
124 bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override;
125
133 Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave = false) override;
134
141
148 Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override;
149
155
159 void quitGame();
160};
161
162extern Ultima4Engine *g_ultima;
163
164} // End of namespace Ultima4
165} // End of namespace Ultima
166
167#endif
Definition: error.h:81
Definition: path.h:52
Definition: random.h:44
uint getRandomNumber(uint max)
Definition: stream.h:745
Definition: str.h:59
Definition: ustr.h:57
Definition: stream.h:77
Definition: engine.h:149
EngineFeature
Definition: engine.h:282
Definition: system.h:166
Definition: armor.h:62
Definition: codex.h:49
Definition: config.h:104
Definition: context.h:54
Definition: death.h:30
Definition: dialogueloader.h:50
Definition: game_controller.h:45
Definition: item.h:64
Definition: maploader.h:128
Definition: moongate.h:31
Definition: music.h:39
Definition: conversation.h:54
Definition: screen.h:103
Definition: shrine.h:64
Definition: sound.h:71
Definition: spell.h:105
Definition: tilemap.h:50
Definition: tileset.h:117
Definition: tileset.h:143
Definition: ultima4.h:54
Common::Error loadGameStream(Common::SeekableReadStream *stream) override
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
bool hasFeature(EngineFeature f) const override
Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave=false) override
uint getRandomNumber(uint maxVal)
Definition: ultima4.h:114
bool isDataRequired(Common::Path &folder, int &majorVersion, int &minorVersion)
Common::Error saveGameState(int slot, const Common::String &desc, bool isAutosave=false) override
Common::Error run() override
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: weapon.h:124
Definition: ios7_game_controller.h:31
Definition: atari-screen.h:58
Definition: savegame.h:270
Definition: detection.h:65