diff options
Diffstat (limited to 'src/components/realizable.h')
-rw-r--r-- | src/components/realizable.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/components/realizable.h b/src/components/realizable.h new file mode 100644 index 0000000..f6a7eb4 --- /dev/null +++ b/src/components/realizable.h | |||
@@ -0,0 +1,67 @@ | |||
1 | #ifndef REALIZABLE_H_36D8D71E | ||
2 | #define REALIZABLE_H_36D8D71E | ||
3 | |||
4 | #include "component.h" | ||
5 | #include <set> | ||
6 | #include <map> | ||
7 | #include "entity_manager.h" | ||
8 | |||
9 | class RealizableComponent : public Component { | ||
10 | public: | ||
11 | |||
12 | using id_type = EntityManager::id_type; | ||
13 | |||
14 | /** | ||
15 | * Path to the XML file containing the world definition. | ||
16 | * | ||
17 | * @managed_by RealizingSystem | ||
18 | */ | ||
19 | std::string worldFile; | ||
20 | |||
21 | /** | ||
22 | * Starting map and player location for a new game. | ||
23 | * | ||
24 | * @managed_by RealizingSystem | ||
25 | */ | ||
26 | int startingMapId; | ||
27 | int startingX; | ||
28 | int startingY; | ||
29 | |||
30 | /** | ||
31 | * The set of map entities loaded by this entity. It is only intended for | ||
32 | * there to be one realizable entity, so this should contain all loaded maps. | ||
33 | * The realizable entity has ownership of the loaded maps. | ||
34 | * | ||
35 | * @managed_by RealizingSystem | ||
36 | */ | ||
37 | std::set<id_type> maps; | ||
38 | |||
39 | /** | ||
40 | * A lookup table that translates a map ID to the entity representing that | ||
41 | * loaded map. | ||
42 | * | ||
43 | * @managed_by RealizingSystem | ||
44 | */ | ||
45 | std::map<size_t, id_type> entityByMapId; | ||
46 | |||
47 | /** | ||
48 | * The entity ID of the currently active map. | ||
49 | * | ||
50 | * @managed_by RealizingSystem | ||
51 | */ | ||
52 | id_type activeMap; | ||
53 | |||
54 | /** | ||
55 | * Whether or not a map has been activated yet. | ||
56 | * | ||
57 | * @managed_by RealizingSystem | ||
58 | */ | ||
59 | bool hasActiveMap = false; | ||
60 | |||
61 | /** | ||
62 | * The entity ID of the currently active player. | ||
63 | */ | ||
64 | id_type activePlayer; | ||
65 | }; | ||
66 | |||
67 | #endif /* end of include guard: REALIZABLE_H_36D8D71E */ | ||