diff options
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 */ | ||