From 9eaab29afedf9eceee50f882b64cb39a14e616a2 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 25 Feb 2014 19:52:35 -0500 Subject: MADS: Starting to refactor some Scene array fields as separate classes --- engines/mads/game.h | 83 +++-------------------------------------------------- 1 file changed, 4 insertions(+), 79 deletions(-) (limited to 'engines/mads/game.h') diff --git a/engines/mads/game.h b/engines/mads/game.h index fbac20ce1f..4797908b1a 100644 --- a/engines/mads/game.h +++ b/engines/mads/game.h @@ -25,6 +25,7 @@ #include "common/scummsys.h" #include "mads/scene.h" +#include "mads/game_data.h" namespace MADS { @@ -38,56 +39,6 @@ enum Difficulty { DIFFICULTY_HARD = 1, DIFFICULTY_MEDIUM = 2, DIFFICULTY_EASY = 3 }; -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; - bool _spritesLoaded; - int _spriteListStart; - int _numSprites; - bool _stepEnabled; - bool _spritesChanged; - bool _visible; -public: - Player(); - - void loadSprites(const Common::String &prefix) { - warning("TODO: Player::loadSprites"); - } -}; - -class SectionHandler { -protected: - MADSEngine *_vm; -public: - SectionHandler(MADSEngine *vm): _vm(vm) {} - virtual ~SectionHandler() {} - - virtual void preLoadSection() = 0; - virtual void sectionPtr2() = 0; - virtual void postLoadSection() = 0; -}; - class Game { private: /** @@ -99,26 +50,15 @@ private: * Inner game loop for executing gameplay within a game section */ void sectionLoop(); - - /** - * Returns true if a given Scene Id exists in the listed of previously visited scenes. - */ - bool visitedScenesExists(int sceneId); - - /** - * Adds a scene Id to the list of previously visited scenes, if it doesn't already exist - */ - void addVisitedScene(int sceneId); protected: MADSEngine *_vm; MSurface *_surface; Difficulty _difficultyLevel; Player _player; - Scene _scene; int _saveSlot; int _statusFlag; SectionHandler *_sectionHandler; - Common::Array _visitedScenes; + VisitedScenes _visitedScenes; byte *_quotes; int _v1; int _v2; @@ -134,21 +74,6 @@ protected: */ Game(MADSEngine *vm); - /** - * Loads the game's object list - */ - void loadObjects(); - - /** - * Set the associated data? pointer with an inventory object - */ - 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 */ @@ -182,8 +107,8 @@ public: int _priorSectionNumber; int _currentSectionNumber; Common::Array _globalFlags; - Common::Array _objects; - Common::Array _inventoryList; + InventoryObjects _objects; + Scene _scene; public: virtual ~Game(); -- cgit v1.2.3