ScummVM API documentation
hodjnpodj.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 HODJNPODJ_H
23#define HODJNPODJ_H
24
25#include "common/scummsys.h"
26#include "bagel/bagel.h"
27#include "bagel/hodjnpodj/metagame/bgen/bfc.h"
28
29namespace Bagel {
30namespace HodjNPodj {
31
33private:
34 //CBofSound *_backgroundMidi = nullptr;
35
36protected:
37 // Engine APIs
38 Common::Error run() override;
39
40public:
41 Common::String _gameId;
42 Metagame::CBfcMgr _bfcMgr;
43 Graphics::Surface _boardgameThumbnail;
44#ifndef RELEASE_BUILD
45 Common::Array<Common::Point> _metagameClicks;
46#endif
47
48public:
49 HodjNPodjEngine(OSystem *syst, const ADGameDescription *gameDesc);
50 ~HodjNPodjEngine() override;
51
52 Graphics::Screen *getScreen() const override;
53
57 uint32 getRandomNumber(uint maxNum) {
58 return BagelEngine::getRandomNumber(maxNum);
59 }
60 uint32 getRandomSeed() const {
61 return _randomSource.getSeed();
62 }
63
64 bool hasFeature(EngineFeature f) const override {
65 return
69 };
70
71 bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override {
72 return true;
73 }
74 bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override {
75 return true;
76 }
77 bool canSaveAutosaveCurrently() override {
78 return false;
79 }
80
86
87 Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override {
88 Common::Serializer s(nullptr, stream);
89 return syncGame(s);
90 }
92 Common::Serializer s(stream, nullptr);
93 return syncGame(s);
94 }
95};
96
97extern HodjNPodjEngine *g_engine;
98
99} // namespace HodjNPodj
100} // namespace Bagel
101
102#endif
Definition: bagel.h:35
uint32 getRandomNumber(uint maxNum=0x7fffffff)
Definition: hodjnpodj.h:32
Common::Error loadGameStream(Common::SeekableReadStream *stream) override
Definition: hodjnpodj.h:91
bool hasFeature(EngineFeature f) const override
Definition: hodjnpodj.h:64
bool canSaveAutosaveCurrently() override
Definition: hodjnpodj.h:77
Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave=false) override
Definition: hodjnpodj.h:87
Common::Error syncGame(Common::Serializer &s)
bool canSaveGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: hodjnpodj.h:74
bool canLoadGameStateCurrently(Common::U32String *msg=nullptr) override
Definition: hodjnpodj.h:71
uint32 getRandomNumber(uint maxNum)
Definition: hodjnpodj.h:57
Common::Error run() override
Definition: error.h:81
uint32 getSeed() const
Definition: random.h:64
Definition: stream.h:745
Definition: serializer.h:80
Definition: str.h:59
Definition: ustr.h:57
Definition: stream.h:77
EngineFeature
Definition: engine.h:293
@ kSupportsReturnToLauncher
Definition: engine.h:307
@ kSupportsSavingDuringRuntime
Definition: engine.h:325
@ kSupportsLoadingDuringRuntime
Definition: engine.h:316
Definition: screen.h:47
Definition: system.h:166
Engine * g_engine
Definition: advancedDetector.h:164
Definition: surface.h:67