ref: a4d42896f5a3c0087b0fd129e8a304cdc5585637
app/src/main/java/xyz/apiote/bimba/czwek/units/Time.kt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
package xyz.apiote.bimba.czwek.units interface TimeUnit data class Second(val secs: Long) { constructor(t: Tim) : this(t.tims.toLong() * 25 / 144) } data class Millisecond(val millis: Long) { constructor(t: Tim) : this(t.tims.toLong() * 25 * 1000 / 144) constructor(s: Second) : this(s.secs * 1000) } data class Tim(val tims: Int) { constructor(s: Second) : this((s.secs * 144 / 25).toInt()) constructor(m: Millisecond) : this((m.millis * 144 / 25 / 1000).toInt()) } |