Skip to content

Commit

Permalink
Fix duration Test (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
RefuX authored Aug 31, 2024
1 parent 3c0ece2 commit 8052826
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/commonMain/kotlin/com/github/quillraven/fleks/world.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down Expand Up @@ -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)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ internal class WorldTest {
}
w.system<WorldTestIteratingSystem>().enabled = false

w.update(1.milliseconds)
w.update(1.seconds)

assertEquals(1f, w.deltaTime)
assertEquals(1, w.system<WorldTestIntervalSystem>().numCalls)
Expand Down

0 comments on commit 8052826

Please sign in to comment.