From 046ee24a341468e9b3ea2983a731dbce18b52ac6 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 13 May 2018 11:00:02 -0400 Subject: Integrated RealizableComponent into RealizingSystem --- src/systems/realizing.h | 66 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 13 deletions(-) (limited to 'src/systems/realizing.h') diff --git a/src/systems/realizing.h b/src/systems/realizing.h index 595c58f..ab5a150 100644 --- a/src/systems/realizing.h +++ b/src/systems/realizing.h @@ -2,29 +2,56 @@ #define REALIZING_H_6853748C #include +#include #include "system.h" +#include "vector.h" class RealizingSystem : public System { public: - RealizingSystem(Game& game) : System(game) - { - } - /** - * Creates the singleton realizable entity and initializes it with the - * provided world definition and map object prototype definition. + * Constructs the realizing system. + * + * Note that this must be constructed after the following system: + * - Mapping + * - Animating + * - Pondering + * - Scripting */ - id_type initSingleton( + RealizingSystem( + Game& game, std::string worldFile, std::string prototypeFile); - /** - * Helper method that returns the entity ID of the (assumed) singleton entity - * with a RealizableComponent. Throws an exception if the number of realizable - * entities is not exactly one. - */ - id_type getSingleton() const; + id_type getActiveMap() const + { + return activeMap_; + } + + int getStartingMapId() const + { + return startingMapId_; + } + + vec2i getStartingPos() const + { + return startingPos_; + } + + id_type getEntityByMapId(size_t mapId) const + { + return entityByMapId_.at(mapId); + } + + id_type getActivePlayer() const + { + return activePlayer_; + } + + void setActivePlayer(id_type entity) + { + activePlayer_ = entity; + } /** * Loads the given map. @@ -41,6 +68,19 @@ public: */ void leaveActiveMap(id_type entity); +private: + + void deactivateMap(); + + void activateMap(id_type mapEntity); + + std::string worldFile_; + std::string prototypeFile_; + int startingMapId_; + vec2i startingPos_; + std::map entityByMapId_; + id_type activeMap_; + id_type activePlayer_; }; #endif /* end of include guard: REALIZING_H_6853748C */ -- cgit 1.4.1