diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-05-17 15:55:37 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-17 15:55:37 -0400 |
| commit | 90aadf3844386824140a20d7fbb847bc16009a94 (patch) | |
| tree | 6f83fce90e71abb22b1a8f3e09c79963b2a34d5d /src/systems/realizing.h | |
| parent | bc63fa57ced1c7329f7fdcfd168eaf7e290158bc (diff) | |
| parent | 86f0106d0523825549f1e74b835688c78a10cf6c (diff) | |
| download | therapy-90aadf3844386824140a20d7fbb847bc16009a94.tar.gz therapy-90aadf3844386824140a20d7fbb847bc16009a94.tar.bz2 therapy-90aadf3844386824140a20d7fbb847bc16009a94.zip | |
Merge pull request #7 from hatkirby/es-rewrite
The ECS rewrite exceeds the original branch in functionality, so it is time to merge it in.
Diffstat (limited to 'src/systems/realizing.h')
| -rw-r--r-- | src/systems/realizing.h | 86 |
1 files changed, 86 insertions, 0 deletions
| diff --git a/src/systems/realizing.h b/src/systems/realizing.h new file mode 100644 index 0000000..ab5a150 --- /dev/null +++ b/src/systems/realizing.h | |||
| @@ -0,0 +1,86 @@ | |||
| 1 | #ifndef REALIZING_H_6853748C | ||
| 2 | #define REALIZING_H_6853748C | ||
| 3 | |||
| 4 | #include <string> | ||
| 5 | #include <map> | ||
| 6 | #include "system.h" | ||
| 7 | #include "vector.h" | ||
| 8 | |||
| 9 | class RealizingSystem : public System { | ||
| 10 | public: | ||
| 11 | |||
| 12 | /** | ||
| 13 | * Constructs the realizing system. | ||
| 14 | * | ||
| 15 | * Note that this must be constructed after the following system: | ||
| 16 | * - Mapping | ||
| 17 | * - Animating | ||
| 18 | * - Pondering | ||
| 19 | * - Scripting | ||
| 20 | */ | ||
| 21 | RealizingSystem( | ||
| 22 | Game& game, | ||
| 23 | std::string worldFile, | ||
| 24 | std::string prototypeFile); | ||
| 25 | |||
| 26 | id_type getActiveMap() const | ||
| 27 | { | ||
| 28 | return activeMap_; | ||
| 29 | } | ||
| 30 | |||
| 31 | int getStartingMapId() const | ||
| 32 | { | ||
| 33 | return startingMapId_; | ||
| 34 | } | ||
| 35 | |||
| 36 | vec2i getStartingPos() const | ||
| 37 | { | ||
| 38 | return startingPos_; | ||
| 39 | } | ||
| 40 | |||
| 41 | id_type getEntityByMapId(size_t mapId) const | ||
| 42 | { | ||
| 43 | return entityByMapId_.at(mapId); | ||
| 44 | } | ||
| 45 | |||
| 46 | id_type getActivePlayer() const | ||
| 47 | { | ||
| 48 | return activePlayer_; | ||
| 49 | } | ||
| 50 | |||
| 51 | void setActivePlayer(id_type entity) | ||
| 52 | { | ||
| 53 | activePlayer_ = entity; | ||
| 54 | } | ||
| 55 | |||
| 56 | /** | ||
| 57 | * Loads the given map. | ||
| 58 | */ | ||
| 59 | void loadMap(id_type mapEntity); | ||
| 60 | |||
| 61 | /** | ||
| 62 | * Treats the given entity as part of the active map. | ||
| 63 | */ | ||
| 64 | void enterActiveMap(id_type entity); | ||
| 65 | |||
| 66 | /** | ||
| 67 | * Stops treating the given entity as part of the active map. | ||
| 68 | */ | ||
| 69 | void leaveActiveMap(id_type entity); | ||
| 70 | |||
| 71 | private: | ||
| 72 | |||
| 73 | void deactivateMap(); | ||
| 74 | |||
| 75 | void activateMap(id_type mapEntity); | ||
| 76 | |||
| 77 | std::string worldFile_; | ||
| 78 | std::string prototypeFile_; | ||
| 79 | int startingMapId_; | ||
| 80 | vec2i startingPos_; | ||
| 81 | std::map<size_t, id_type> entityByMapId_; | ||
| 82 | id_type activeMap_; | ||
| 83 | id_type activePlayer_; | ||
| 84 | }; | ||
| 85 | |||
| 86 | #endif /* end of include guard: REALIZING_H_6853748C */ | ||
