summary refs log tree commit diff stats
path: root/src/systems/realizing.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/systems/realizing.h')
-rw-r--r--src/systems/realizing.h66
1 files changed, 53 insertions, 13 deletions
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 @@
2#define REALIZING_H_6853748C 2#define REALIZING_H_6853748C
3 3
4#include <string> 4#include <string>
5#include <map>
5#include "system.h" 6#include "system.h"
7#include "vector.h"
6 8
7class RealizingSystem : public System { 9class RealizingSystem : public System {
8public: 10public:
9 11
10 RealizingSystem(Game& game) : System(game)
11 {
12 }
13
14 /** 12 /**
15 * Creates the singleton realizable entity and initializes it with the 13 * Constructs the realizing system.
16 * provided world definition and map object prototype definition. 14 *
15 * Note that this must be constructed after the following system:
16 * - Mapping
17 * - Animating
18 * - Pondering
19 * - Scripting
17 */ 20 */
18 id_type initSingleton( 21 RealizingSystem(
22 Game& game,
19 std::string worldFile, 23 std::string worldFile,
20 std::string prototypeFile); 24 std::string prototypeFile);
21 25
22 /** 26 id_type getActiveMap() const
23 * Helper method that returns the entity ID of the (assumed) singleton entity 27 {
24 * with a RealizableComponent. Throws an exception if the number of realizable 28 return activeMap_;
25 * entities is not exactly one. 29 }
26 */ 30
27 id_type getSingleton() const; 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 }
28 55
29 /** 56 /**
30 * Loads the given map. 57 * Loads the given map.
@@ -41,6 +68,19 @@ public:
41 */ 68 */
42 void leaveActiveMap(id_type entity); 69 void leaveActiveMap(id_type entity);
43 70
71private:
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_;
44}; 84};
45 85
46#endif /* end of include guard: REALIZING_H_6853748C */ 86#endif /* end of include guard: REALIZING_H_6853748C */