ScummVM API documentation
game.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 MUTATIONOFJB_GAME_H
23#define MUTATIONOFJB_GAME_H
24
25#include "mutationofjb/assets.h"
26#include "mutationofjb/gamescreen.h"
27#include "mutationofjb/tasks/taskmanager.h"
28
29#include "common/language.h"
30#include "common/ptr.h"
31#include "common/random.h"
32#include "common/scummsys.h"
33
34namespace Common {
35class String;
36}
37
38namespace MutationOfJB {
39
40class Command;
41class MutationOfJBEngine;
42class Script;
43class Room;
44class SayTask;
45struct GameData;
46struct Door;
47struct Static;
48struct Bitmap;
49
50class Game {
51public:
53 MutationOfJBEngine &getEngine();
54
55 Common::RandomSource &getRandomSource();
56 GameData &getGameData();
57 Room &getRoom();
58 Script *getGlobalScript() const;
59 Script *getLocalScript() const;
60
61 void changeScene(uint8 sceneId, bool partB);
62 Script *changeSceneDelayScript(uint8 sceneId, bool partB, bool runDelayedScriptStartup = false);
63
64 bool startActionSection(ActionInfo::Action action, const Common::String &entity1Name, const Common::String &entity2Name = Common::String());
65
66 bool isCurrentSceneMap() const;
67
68 void update();
69
70 GameScreen &getGameScreen();
71
72 static uint8 colorFromString(const char *colorStr);
73
74 TaskManager &getTaskManager();
75 Assets &getAssets();
76
77 Graphics::Screen &getScreen();
78
79 TaskPtr getActiveSayTask() const;
80 void setActiveSayTask(const TaskPtr &sayTask);
81
82 bool loadSaveAllowed() const;
83
84 Common::Language getLanguage() const;
85
86 void switchToPartB();
87
88private:
89 bool loadGameData(bool partB);
90 void runActiveCommand();
91 void startCommand(Command *cmd);
92 Script *changeSceneLoadScript(uint8 sceneId, bool partB);
93
95 Common::RandomSource _randomSource;
96
97 GameData *_gameData;
98 Script *_globalScript;
99 Script *_localScript;
100 Script *_delayedLocalScript;
101 bool _runDelayedScriptStartup;
102 Room *_room;
103 GameScreen _gui;
104
105 ScriptExecutionContext _scriptExecCtx;
106
107 TaskManager _taskManager;
108 Assets _assets;
109 TaskPtr _activeSayTask;
110};
111
112}
113
114#endif
Definition: random.h:44
Definition: str.h:59
Definition: screen.h:47
Definition: assets.h:34
Definition: command.h:85
Definition: game.h:50
Definition: gamescreen.h:55
Definition: mutationofjb.h:51
Definition: room.h:40
Definition: script.h:106
Definition: script.h:130
Definition: taskmanager.h:37
Language
Definition: language.h:45
Definition: algorithm.h:29
Definition: gamedata.h:443