summaryrefslogtreecommitdiff
path: root/ecs/src/phase.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2024-12-09 14:05:33 +0100
committerHampusM <hampus@hampusmat.com>2024-12-09 14:05:33 +0100
commitdcc40c9205e5f4cf484523f97eb12a561d7b2b22 (patch)
tree2908b6ca3b2fa390a45b383b91edf7a72c42ef4b /ecs/src/phase.rs
parent158e36bf6bfcbc2ed0ffc670788ed8c0abd3f282 (diff)
refactor(ecs): use phases for system ordering
Diffstat (limited to 'ecs/src/phase.rs')
-rw-r--r--ecs/src/phase.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/ecs/src/phase.rs b/ecs/src/phase.rs
new file mode 100644
index 0000000..b8660f2
--- /dev/null
+++ b/ecs/src/phase.rs
@@ -0,0 +1,15 @@
+use ecs_macros::Component;
+
+use crate::relationship::{ChildOf, Relationship};
+use crate::static_entity;
+
+#[derive(Debug, Default, Clone, Copy, Component)]
+pub struct Phase;
+
+static_entity!(pub START, (Phase,));
+
+static_entity!(pub PRE_UPDATE, (Phase,));
+
+static_entity!(pub UPDATE, (Phase, <Relationship<ChildOf, Phase>>::new(*PRE_UPDATE)));
+
+static_entity!(pub PRESENT, (Phase, <Relationship<ChildOf, Phase>>::new(*UPDATE)));