summaryrefslogtreecommitdiff
path: root/composeApp/src/commonTest/kotlin
diff options
context:
space:
mode:
authorElizabeth Hunt <me@liz.coffee>2025-10-26 17:25:13 -0700
committerElizabeth Hunt <me@liz.coffee>2025-10-26 17:25:13 -0700
commit395aa7d1c312e495517701be11c21425d9a5838e (patch)
tree4ad184b082838c56149cc1d1efe191cfd3d0679b /composeApp/src/commonTest/kotlin
parent64f825465de9fa30c4dfe2707067efdb96110db8 (diff)
downloadabstraction-engine-kt-395aa7d1c312e495517701be11c21425d9a5838e.tar.gz
abstraction-engine-kt-395aa7d1c312e495517701be11c21425d9a5838e.zip
Checkpoint
Diffstat (limited to 'composeApp/src/commonTest/kotlin')
-rw-r--r--composeApp/src/commonTest/kotlin/coffee/liz/ecs/DAGWorldTest.kt2
-rw-r--r--composeApp/src/commonTest/kotlin/coffee/liz/ecs/animation/AnimationSystemTest.kt20
2 files changed, 11 insertions, 11 deletions
diff --git a/composeApp/src/commonTest/kotlin/coffee/liz/ecs/DAGWorldTest.kt b/composeApp/src/commonTest/kotlin/coffee/liz/ecs/DAGWorldTest.kt
index 737e386..bdf7e99 100644
--- a/composeApp/src/commonTest/kotlin/coffee/liz/ecs/DAGWorldTest.kt
+++ b/composeApp/src/commonTest/kotlin/coffee/liz/ecs/DAGWorldTest.kt
@@ -34,7 +34,7 @@ class DAGWorldTest {
val entity = world.createEntity()
entity.add(Position(10f, 20f))
- world.destroyEntity(entity)
+ world.removeEntity(entity)
val results = world.query<Position>()
assertFalse(results.contains(entity))
diff --git a/composeApp/src/commonTest/kotlin/coffee/liz/ecs/animation/AnimationSystemTest.kt b/composeApp/src/commonTest/kotlin/coffee/liz/ecs/animation/AnimationSystemTest.kt
index bb7298e..588e245 100644
--- a/composeApp/src/commonTest/kotlin/coffee/liz/ecs/animation/AnimationSystemTest.kt
+++ b/composeApp/src/commonTest/kotlin/coffee/liz/ecs/animation/AnimationSystemTest.kt
@@ -23,7 +23,7 @@ class AnimationSystemTest {
clips = mapOf(
AnimationName("idle") to AnimationClip(
frameNames = listOf(FrameName("idle_0"), FrameName("idle_1")),
- frameDuration = 0.1f,
+ frameTicks = 0.1f,
loopMode = LoopMode.LOOP
),
AnimationName("walk") to AnimationClip(
@@ -32,7 +32,7 @@ class AnimationSystemTest {
FrameName("walk_1"),
FrameName("walk_2")
),
- frameDuration = 0.15f,
+ frameTicks = 0.15f,
loopMode = LoopMode.LOOP
)
),
@@ -49,17 +49,17 @@ class AnimationSystemTest {
entity.add(animator)
assertEquals(0, animator.frameIndex)
- assertEquals(0f, animator.elapsed)
+ assertEquals(0f, animator.elapsedTicks)
// Update with less than frame duration - should not advance
world.update(0.05f)
assertEquals(0, animator.frameIndex)
- assertEquals(0.05f, animator.elapsed)
+ assertEquals(0.05f, animator.elapsedTicks)
// Update to exceed frame duration - should advance to frame 1
world.update(0.06f)
assertEquals(1, animator.frameIndex)
- assertTrue(animator.elapsed < 0.1f)
+ assertTrue(animator.elapsedTicks < 0.1f)
}
@Test
@@ -87,7 +87,7 @@ class AnimationSystemTest {
clips = mapOf(
AnimationName("once") to AnimationClip(
frameNames = listOf(FrameName("idle_0"), FrameName("idle_1")),
- frameDuration = 0.1f,
+ frameTicks = 0.1f,
loopMode = LoopMode.ONCE
)
),
@@ -122,7 +122,7 @@ class AnimationSystemTest {
FrameName("walk_1"),
FrameName("walk_2")
),
- frameDuration = 0.1f,
+ frameTicks = 0.1f,
loopMode = LoopMode.PING_PONG
)
),
@@ -164,13 +164,13 @@ class AnimationSystemTest {
// Manually advance
animator.frameIndex = 1
- animator.elapsed = 0.05f
+ animator.elapsedTicks = 0.05f
// Switch to walk animation
animator.play(AnimationName("walk"))
assertEquals(AnimationName("walk"), animator.currentClip)
assertEquals(0, animator.frameIndex)
- assertEquals(0f, animator.elapsed)
+ assertEquals(0f, animator.elapsedTicks)
assertEquals(1, animator.direction)
assertTrue(animator.playing)
}
@@ -222,7 +222,7 @@ class AnimationSystemTest {
// Large delta time should advance multiple frames
world.update(0.25f) // Should advance 2 frames and have 0.05s remainder
assertEquals(0, animator.frameIndex) // Wrapped back to 0 (LOOP mode)
- assertTrue(animator.elapsed >= 0.04f && animator.elapsed <= 0.06f)
+ assertTrue(animator.elapsedTicks >= 0.04f && animator.elapsedTicks <= 0.06f)
}
@Test