diff options
| author | Elizabeth Hunt <me@liz.coffee> | 2025-10-26 17:25:13 -0700 |
|---|---|---|
| committer | Elizabeth Hunt <me@liz.coffee> | 2025-10-26 17:25:13 -0700 |
| commit | 395aa7d1c312e495517701be11c21425d9a5838e (patch) | |
| tree | 4ad184b082838c56149cc1d1efe191cfd3d0679b /composeApp/src/commonMain/kotlin/coffee/liz/ecs/System.kt | |
| parent | 64f825465de9fa30c4dfe2707067efdb96110db8 (diff) | |
| download | abstraction-engine-kt-395aa7d1c312e495517701be11c21425d9a5838e.tar.gz abstraction-engine-kt-395aa7d1c312e495517701be11c21425d9a5838e.zip | |
Checkpoint
Diffstat (limited to 'composeApp/src/commonMain/kotlin/coffee/liz/ecs/System.kt')
| -rw-r--r-- | composeApp/src/commonMain/kotlin/coffee/liz/ecs/System.kt | 17 |
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) } |
