2018-02-15 21:05:56 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
2021-12-26 17:47:58 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2018-02-15 21:05:56 +00:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2021-12-26 17:47:58 +00:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2018-02-15 21:05:56 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-03-08 20:25:55 +00:00
|
|
|
#ifndef MUTATIONOFJB_GAME_H
|
|
|
|
#define MUTATIONOFJB_GAME_H
|
|
|
|
|
2018-07-08 15:06:41 +00:00
|
|
|
#include "mutationofjb/assets.h"
|
2018-09-06 17:38:16 +00:00
|
|
|
#include "mutationofjb/gamescreen.h"
|
2018-07-08 15:06:41 +00:00
|
|
|
#include "mutationofjb/tasks/taskmanager.h"
|
2018-02-15 21:05:56 +00:00
|
|
|
|
2018-10-28 12:08:41 +00:00
|
|
|
#include "common/language.h"
|
2018-07-21 18:29:11 +00:00
|
|
|
#include "common/ptr.h"
|
|
|
|
#include "common/random.h"
|
|
|
|
#include "common/scummsys.h"
|
|
|
|
|
2018-03-22 19:56:42 +00:00
|
|
|
namespace Common {
|
|
|
|
class String;
|
|
|
|
}
|
|
|
|
|
2018-02-22 22:47:16 +00:00
|
|
|
namespace MutationOfJB {
|
2018-02-15 21:05:56 +00:00
|
|
|
|
2018-03-22 19:56:42 +00:00
|
|
|
class Command;
|
2018-03-20 17:58:45 +00:00
|
|
|
class MutationOfJBEngine;
|
|
|
|
class Script;
|
|
|
|
class Room;
|
2018-07-21 18:29:11 +00:00
|
|
|
class SayTask;
|
2018-08-19 13:38:12 +00:00
|
|
|
struct GameData;
|
|
|
|
struct Door;
|
|
|
|
struct Static;
|
|
|
|
struct Bitmap;
|
2018-02-15 21:05:56 +00:00
|
|
|
|
2018-03-20 17:58:45 +00:00
|
|
|
class Game {
|
2018-02-22 22:47:16 +00:00
|
|
|
public:
|
2018-03-22 19:56:42 +00:00
|
|
|
Game(MutationOfJBEngine *vm);
|
2018-10-28 12:08:41 +00:00
|
|
|
MutationOfJBEngine &getEngine();
|
|
|
|
|
2018-07-14 19:42:57 +00:00
|
|
|
Common::RandomSource &getRandomSource();
|
2018-03-20 17:58:45 +00:00
|
|
|
GameData &getGameData();
|
2018-04-02 12:03:40 +00:00
|
|
|
Room &getRoom();
|
2018-03-20 17:58:45 +00:00
|
|
|
Script *getGlobalScript() const;
|
|
|
|
Script *getLocalScript() const;
|
2018-02-22 22:47:16 +00:00
|
|
|
|
2018-03-20 17:58:45 +00:00
|
|
|
void changeScene(uint8 sceneId, bool partB);
|
2018-10-30 17:56:37 +00:00
|
|
|
Script *changeSceneDelayScript(uint8 sceneId, bool partB, bool runDelayedScriptStartup = false);
|
2018-02-15 21:05:56 +00:00
|
|
|
|
2018-03-25 00:04:44 +00:00
|
|
|
bool startActionSection(ActionInfo::Action action, const Common::String &entity1Name, const Common::String &entity2Name = Common::String());
|
|
|
|
|
2018-04-02 12:03:40 +00:00
|
|
|
bool isCurrentSceneMap() const;
|
|
|
|
|
2018-03-24 00:43:33 +00:00
|
|
|
void update();
|
2018-03-22 19:56:42 +00:00
|
|
|
|
2018-09-06 17:38:16 +00:00
|
|
|
GameScreen &getGameScreen();
|
2018-04-04 18:39:08 +00:00
|
|
|
|
2018-06-20 21:25:34 +00:00
|
|
|
static uint8 colorFromString(const char *colorStr);
|
|
|
|
|
2018-07-14 19:42:57 +00:00
|
|
|
TaskManager &getTaskManager();
|
2018-07-08 15:06:41 +00:00
|
|
|
Assets &getAssets();
|
|
|
|
|
2018-07-14 22:18:54 +00:00
|
|
|
Graphics::Screen &getScreen();
|
|
|
|
|
2018-07-21 18:29:11 +00:00
|
|
|
TaskPtr getActiveSayTask() const;
|
|
|
|
void setActiveSayTask(const TaskPtr &sayTask);
|
|
|
|
|
2018-08-30 21:38:41 +00:00
|
|
|
bool loadSaveAllowed() const;
|
|
|
|
|
2018-10-28 12:08:41 +00:00
|
|
|
Common::Language getLanguage() const;
|
|
|
|
|
2018-10-30 17:56:37 +00:00
|
|
|
void switchToPartB();
|
|
|
|
|
2018-02-22 22:47:16 +00:00
|
|
|
private:
|
2018-03-20 17:58:45 +00:00
|
|
|
bool loadGameData(bool partB);
|
2018-03-24 00:43:33 +00:00
|
|
|
void runActiveCommand();
|
|
|
|
void startCommand(Command *cmd);
|
2018-03-24 14:43:50 +00:00
|
|
|
Script *changeSceneLoadScript(uint8 sceneId, bool partB);
|
2018-03-20 17:58:45 +00:00
|
|
|
|
|
|
|
MutationOfJBEngine *_vm;
|
2018-07-14 19:42:57 +00:00
|
|
|
Common::RandomSource _randomSource;
|
2018-02-15 21:05:56 +00:00
|
|
|
|
2018-03-20 17:58:45 +00:00
|
|
|
GameData *_gameData;
|
|
|
|
Script *_globalScript;
|
|
|
|
Script *_localScript;
|
2018-03-24 14:43:50 +00:00
|
|
|
Script *_delayedLocalScript;
|
2018-10-30 17:56:37 +00:00
|
|
|
bool _runDelayedScriptStartup;
|
2018-03-20 17:58:45 +00:00
|
|
|
Room *_room;
|
2018-09-06 17:38:16 +00:00
|
|
|
GameScreen _gui;
|
2018-03-24 00:43:33 +00:00
|
|
|
|
|
|
|
ScriptExecutionContext _scriptExecCtx;
|
2018-04-14 21:04:20 +00:00
|
|
|
|
2018-07-08 15:06:41 +00:00
|
|
|
TaskManager _taskManager;
|
|
|
|
Assets _assets;
|
2018-07-21 18:29:11 +00:00
|
|
|
TaskPtr _activeSayTask;
|
2018-02-15 21:05:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
2018-03-08 20:25:55 +00:00
|
|
|
|
|
|
|
#endif
|