Bimba.git

ref: 0ae2a8256ae07d540e8e24148d64e56481e0d7de

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())
}