From 395aa7d1c312e495517701be11c21425d9a5838e Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sun, 26 Oct 2025 17:25:13 -0700 Subject: Checkpoint --- .../src/commonMain/kotlin/coffee/liz/ecs/System.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'composeApp/src/commonMain/kotlin/coffee/liz/ecs/System.kt') 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 { /** * Systems that must run before this system in the update loop. - * Used to construct a dependency DAG. */ - val dependencies: Set> + val dependencies: Set>> 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, state: Outside, deltaTime: Duration) } -- cgit v1.2.3-70-g09d2