aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/game.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mads/game.h')
-rw-r--r--engines/mads/game.h112
1 files changed, 110 insertions, 2 deletions
diff --git a/engines/mads/game.h b/engines/mads/game.h
index bb15a8e35b..9dd7ca0ace 100644
--- a/engines/mads/game.h
+++ b/engines/mads/game.h
@@ -24,28 +24,136 @@
#define MADS_GAME_H
#include "common/scummsys.h"
+#include "mads/scene.h"
namespace MADS {
class MADSEngine;
+enum {
+ PLAYER_INVENTORY = 2
+};
+
+enum Difficulty {
+ DIFFICULTY_HARD = 1, DIFFICULTY_MEDIUM = 2, DIFFICULTY_EASY = 3
+};
+
+enum DialogId {
+ DIALOG_NONE = 0, DIALOG_GAME_MENU = 1, DIALOG_SAVE = 2, DIALOG_RESTORE = 3,
+ DIALOG_OPTIONS = 4, DIALOG_DIFFICULTY = 5, DIALOG_ERROR = 6
+};
+
+class InventoryObject {
+public:
+ int _descId;
+ int _roomNumber;
+ int _article;
+ int _vocabCount;
+ struct {
+ int _actionFlags1;
+ int _actionFlags2;
+ int _vocabId;
+ } _vocabList[3];
+ char _mutilateString[10]; // ???
+ const byte *_objFolder; // ???
+
+ /**
+ * Loads the data for a given object
+ */
+ void load(Common::SeekableReadStream &f);
+};
+
+class Player {
+public:
+ int _direction;
+ int _newDirection;
+public:
+ Player();
+};
+
+class SectionHandler {
+protected:
+ MADSEngine *_vm;
+public:
+ SectionHandler(MADSEngine *vm): _vm(vm) {}
+
+ virtual void loadSection() = 0;
+ virtual void sectionPtr2() = 0;
+ virtual void sectionPtr3() = 0;
+};
+
class Game {
+private:
+ /**
+ * Main game loop
+ */
+ void gameLoop();
protected:
MADSEngine *_vm;
MSurface *_surface;
+ Difficulty _difficultyLevel;
+ Common::Array<uint16> _globalFlags;
+ Common::Array<InventoryObject> _objects;
+ Common::Array<int> _inventoryList;
+ Player _player;
+ Scene _scene;
+ int _saveSlot;
+ int _statusFlag;
+ DialogId _pendingDialog;
+
+ SectionHandler *_sectionHandler;
+ /**
+ * Constructor
+ */
Game(MADSEngine *vm);
/**
- * Perform any copy protection check
+ * Loads the game's object list
+ */
+ void loadObjects();
+
+ /**
+ * Set the associated data? pointer with an inventory object
*/
- virtual bool checkCopyProtection() = 0;
+ void setObjectData(int objIndex, int id, const byte *p);
+
+ /**
+ * Sets the room number
+ */
+ void setObjectRoom(int objectId, int roomNumber);
/**
* Initialises the current section number of the game
*/
void initSection(int sectionNumber);
+ void loadResourceSequence(const Common::String prefix, int v);
+
+ //@{
+ /** @name Virtual Method list */
+
+ /**
+ * Perform any copy protection check
+ */
+ virtual int checkCopyProtection() = 0;
+
+ /**
+ * Initialises global variables for a new game
+ */
+ virtual void initialiseGlobals() = 0;
+
+ /**
+ * Show a game dialog
+ */
+ virtual void showDialog() = 0;
+
+ /**
+ * Set up the section handler specific to each section
+ */
+ virtual void setSectionHandler() = 0;
+ //@}
+
public:
static Game *init(MADSEngine *vm);
public: