diff options
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/automatable.h | 25 | ||||
-rw-r--r-- | src/components/playable.h | 3 | ||||
-rw-r--r-- | src/components/ponderable.h | 3 | ||||
-rw-r--r-- | src/components/prototypable.h | 22 | ||||
-rw-r--r-- | src/components/realizable.h | 3 | ||||
-rw-r--r-- | src/components/runnable.h | 15 |
6 files changed, 42 insertions, 29 deletions
diff --git a/src/components/automatable.h b/src/components/automatable.h deleted file mode 100644 index d30340a..0000000 --- a/src/components/automatable.h +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | #ifndef AUTOMATABLE_H_3D519131 | ||
2 | #define AUTOMATABLE_H_3D519131 | ||
3 | |||
4 | #include "component.h" | ||
5 | #include <sol.hpp> | ||
6 | #include <memory> | ||
7 | |||
8 | class AutomatableComponent : public Component { | ||
9 | public: | ||
10 | |||
11 | std::unique_ptr<sol::thread> runner; | ||
12 | std::unique_ptr<sol::coroutine> behavior; | ||
13 | |||
14 | sol::environment origBehavior; | ||
15 | |||
16 | /** | ||
17 | * If this flag is disabled, the entity will be ignored by the automating | ||
18 | * system. | ||
19 | * | ||
20 | * @managed_by RealizingSystem | ||
21 | */ | ||
22 | bool active = false; | ||
23 | }; | ||
24 | |||
25 | #endif /* end of include guard: AUTOMATABLE_H_3D519131 */ | ||
diff --git a/src/components/playable.h b/src/components/playable.h index b8af0f2..7404f1f 100644 --- a/src/components/playable.h +++ b/src/components/playable.h | |||
@@ -27,6 +27,9 @@ public: | |||
27 | size_t checkpointMapId; | 27 | size_t checkpointMapId; |
28 | vec2d checkpointPos; | 28 | vec2d checkpointPos; |
29 | 29 | ||
30 | bool checkpointMapObject = false; | ||
31 | size_t checkpointMapObjectIndex; | ||
32 | |||
30 | }; | 33 | }; |
31 | 34 | ||
32 | #endif /* end of include guard: PLAYABLE_H_DDC566C3 */ | 35 | #endif /* end of include guard: PLAYABLE_H_DDC566C3 */ |
diff --git a/src/components/ponderable.h b/src/components/ponderable.h index e6aa976..221d267 100644 --- a/src/components/ponderable.h +++ b/src/components/ponderable.h | |||
@@ -34,7 +34,8 @@ public: | |||
34 | platform, | 34 | platform, |
35 | adjacency, | 35 | adjacency, |
36 | warp, | 36 | warp, |
37 | danger | 37 | danger, |
38 | event | ||
38 | }; | 39 | }; |
39 | 40 | ||
40 | /** | 41 | /** |
diff --git a/src/components/prototypable.h b/src/components/prototypable.h new file mode 100644 index 0000000..4659e7c --- /dev/null +++ b/src/components/prototypable.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #ifndef PROTOTYPABLE_H_817F2205 | ||
2 | #define PROTOTYPABLE_H_817F2205 | ||
3 | |||
4 | #include "component.h" | ||
5 | #include "entity_manager.h" | ||
6 | |||
7 | class PrototypableComponent : public Component { | ||
8 | public: | ||
9 | |||
10 | using id_type = EntityManager::id_type; | ||
11 | |||
12 | size_t mapObjectIndex; | ||
13 | |||
14 | std::string prototypeId; | ||
15 | |||
16 | bool hasBehavior = false; | ||
17 | bool runningBehavior = false; | ||
18 | |||
19 | id_type behaviorScript; | ||
20 | }; | ||
21 | |||
22 | #endif /* end of include guard: PROTOTYPABLE_H_817F2205 */ | ||
diff --git a/src/components/realizable.h b/src/components/realizable.h index bc834a2..b749aeb 100644 --- a/src/components/realizable.h +++ b/src/components/realizable.h | |||
@@ -4,7 +4,6 @@ | |||
4 | #include "component.h" | 4 | #include "component.h" |
5 | #include <set> | 5 | #include <set> |
6 | #include <map> | 6 | #include <map> |
7 | #include <sol.hpp> | ||
8 | #include "entity_manager.h" | 7 | #include "entity_manager.h" |
9 | #include "vector.h" | 8 | #include "vector.h" |
10 | 9 | ||
@@ -70,8 +69,6 @@ public: | |||
70 | * The entity ID of the currently active player. | 69 | * The entity ID of the currently active player. |
71 | */ | 70 | */ |
72 | id_type activePlayer; | 71 | id_type activePlayer; |
73 | |||
74 | sol::state scriptEngine; | ||
75 | }; | 72 | }; |
76 | 73 | ||
77 | #endif /* end of include guard: REALIZABLE_H_36D8D71E */ | 74 | #endif /* end of include guard: REALIZABLE_H_36D8D71E */ |
diff --git a/src/components/runnable.h b/src/components/runnable.h new file mode 100644 index 0000000..1b994fb --- /dev/null +++ b/src/components/runnable.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef AUTOMATABLE_H_3D519131 | ||
2 | #define AUTOMATABLE_H_3D519131 | ||
3 | |||
4 | #include "component.h" | ||
5 | #include <sol.hpp> | ||
6 | #include <memory> | ||
7 | |||
8 | class RunnableComponent : public Component { | ||
9 | public: | ||
10 | |||
11 | std::unique_ptr<sol::thread> runner; | ||
12 | std::unique_ptr<sol::coroutine> callable; | ||
13 | }; | ||
14 | |||
15 | #endif /* end of include guard: AUTOMATABLE_H_3D519131 */ | ||