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