ScummVM API documentation
saveload.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 MTROPOLIS_SAVELOAD_H
23#define MTROPOLIS_SAVELOAD_H
24
25#include "mtropolis/core.h"
26
27namespace Common {
28
29class ReadStream;
30class WriteStream;
31
32} // End of namespace Common
33
34namespace Graphics {
35
36struct Surface;
37
38} // End of namespace Graphics
39
40namespace MTropolis {
41
42class Modifier;
43class Runtime;
44class RuntimeObject;
45
46struct ISaveWriter : public IInterfaceBase {
47 virtual bool writeSave(Common::WriteStream *stream) = 0;
48};
49
50struct ISaveReader : public IInterfaceBase {
51 virtual bool readSave(Common::ReadStream *stream, uint32 saveFileVersion) = 0;
52};
53
55 virtual bool promptSave(ISaveWriter *writer, const Graphics::Surface *screenshotOverride) = 0;
56 virtual bool namedSave(ISaveWriter *writer, const Graphics::Surface *screenshotOverride, const Common::String &fileName) = 0;
57};
58
60 virtual bool promptLoad(ISaveReader *reader) = 0;
61 virtual bool namedLoad(ISaveReader *reader, const Common::String &fileName) = 0;
62};
63
65 virtual bool autoSave(ISaveWriter *writer) = 0;
66};
67
69public:
70 CompoundVarSaver(Runtime *runtime, RuntimeObject *object);
71
72 bool writeSave(Common::WriteStream *stream) override;
73
74private:
75 Runtime *_runtime;
76 RuntimeObject *_object;
77};
78
80public:
81 virtual ~SaveLoadHooks();
82
83 virtual void onLoad(Runtime *runtime, Modifier *saveLoadModifier, Modifier *varModifier);
84 virtual void onSave(Runtime *runtime, Modifier *saveLoadModifier, Modifier *varModifier);
85};
86
88public:
90
91 virtual bool canSaveNow(Runtime *runtime);
92 virtual Common::SharedPtr<ISaveWriter> createSaveWriter(Runtime *runtime);
93};
94
95} // End of namespace MTropolis
96
97#endif /* MTROPOLIS_SAVELOAD_H */
Definition: stream.h:385
Definition: ptr.h:159
Definition: str.h:59
Definition: stream.h:77
Definition: saveload.h:68
Definition: runtime.h:3035
Definition: runtime.h:1575
Definition: runtime.h:2052
Definition: saveload.h:79
Definition: saveload.h:87
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: actions.h:25
Definition: surface.h:67
Definition: saveload.h:64
Definition: core.h:33
Definition: saveload.h:59
Definition: saveload.h:50
Definition: saveload.h:54
Definition: saveload.h:46