diff --git a/src/commonMain/kotlin/com/github/quillraven/fleks/world.kt b/src/commonMain/kotlin/com/github/quillraven/fleks/world.kt index fca025d..2a2c4ee 100644 --- a/src/commonMain/kotlin/com/github/quillraven/fleks/world.kt +++ b/src/commonMain/kotlin/com/github/quillraven/fleks/world.kt @@ -6,7 +6,6 @@ import kotlinx.serialization.Contextual import kotlinx.serialization.Serializable import kotlin.native.concurrent.ThreadLocal import kotlin.time.Duration -import kotlin.time.DurationUnit /** * Snapshot for an [entity][Entity] that contains its [components][Component] and [tags][EntityTag]. @@ -455,7 +454,7 @@ class World internal constructor( * using the given [duration]. The duration is converted to seconds. */ fun update(duration: Duration) { - update(duration.toLong(DurationUnit.NANOSECONDS) * 0.000000001f) + update(duration.inWholeNanoseconds * 0.000000001f) } /** diff --git a/src/commonTest/kotlin/com/github/quillraven/fleks/WorldTest.kt b/src/commonTest/kotlin/com/github/quillraven/fleks/WorldTest.kt index c42c2f2..be7175b 100644 --- a/src/commonTest/kotlin/com/github/quillraven/fleks/WorldTest.kt +++ b/src/commonTest/kotlin/com/github/quillraven/fleks/WorldTest.kt @@ -332,7 +332,7 @@ internal class WorldTest { } w.system().enabled = false - w.update(1.milliseconds) + w.update(1.seconds) assertEquals(1f, w.deltaTime) assertEquals(1, w.system().numCalls)