summaryrefslogtreecommitdiff
path: root/composeApp/src/commonMain/kotlin/coffee/liz/ecs/System.kt
diff options
context:
space:
mode:
Diffstat (limited to 'composeApp/src/commonMain/kotlin/coffee/liz/ecs/System.kt')
-rw-r--r--composeApp/src/commonMain/kotlin/coffee/liz/ecs/System.kt22
1 files changed, 22 insertions, 0 deletions
diff --git a/composeApp/src/commonMain/kotlin/coffee/liz/ecs/System.kt b/composeApp/src/commonMain/kotlin/coffee/liz/ecs/System.kt
new file mode 100644
index 0000000..0f8ef2a
--- /dev/null
+++ b/composeApp/src/commonMain/kotlin/coffee/liz/ecs/System.kt
@@ -0,0 +1,22 @@
+package coffee.liz.ecs
+
+import kotlin.reflect.KClass
+
+/**
+ * Systems contain the logic that operates on entities with specific components.
+ */
+interface System {
+ /**
+ * Systems that must run before this system in the update loop.
+ * Used to construct a dependency DAG.
+ */
+ val dependencies: Set<KClass<out System>>
+ get() = emptySet()
+
+ /**
+ * Update this system. Called once per frame.
+ * @param world The world containing entities and systems
+ * @param deltaTime Time elapsed since last update in seconds
+ */
+ fun update(world: World, deltaTime: Float)
+}