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.kt17
1 files changed, 9 insertions, 8 deletions
diff --git a/composeApp/src/commonMain/kotlin/coffee/liz/ecs/System.kt b/composeApp/src/commonMain/kotlin/coffee/liz/ecs/System.kt
index 0f8ef2a..e763c9c 100644
--- a/composeApp/src/commonMain/kotlin/coffee/liz/ecs/System.kt
+++ b/composeApp/src/commonMain/kotlin/coffee/liz/ecs/System.kt
@@ -1,22 +1,23 @@
package coffee.liz.ecs
import kotlin.reflect.KClass
+import kotlin.time.Duration
/**
- * Systems contain the logic that operates on entities with specific components.
+ * System is a component that updates the world state.
+ * @param Outside is the state of the stuff outside the world (input, etc.).
*/
-interface System {
+interface System<Outside> {
/**
* Systems that must run before this system in the update loop.
- * Used to construct a dependency DAG.
*/
- val dependencies: Set<KClass<out System>>
+ 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
+ * Integrate this system over [deltaTime].
+ * @param world [World]
+ * @param deltaTime [Duration] since last update
*/
- fun update(world: World, deltaTime: Float)
+ fun update(world: World<Outside>, state: Outside, deltaTime: Duration)
}