mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-14 23:56:07 +09:00
Former-commit-id: d04fc939a659fc4a6b952d64894bd28edf97bc38 Former-commit-id: 6c20526f3bdda2d9d08dc156b3b0fe271e89bffb
31 lines
865 B
Kotlin
31 lines
865 B
Kotlin
package net.torvald.terrarum.console
|
|
|
|
import net.torvald.terrarum.Terrarum
|
|
|
|
/**
|
|
* Created by minjaesong on 16-03-20.
|
|
*/
|
|
internal object SetTimeDelta : ConsoleCommand {
|
|
|
|
val HARD_LIMIT = 60
|
|
|
|
override fun execute(args: Array<String>) {
|
|
if (args.size == 2) {
|
|
if (args[1].toInt() > HARD_LIMIT)
|
|
Error.execute("Delta too large -- acceptable delta is 0-60.")
|
|
|
|
Terrarum.ingame.world.time.setTimeDelta(args[1].toInt())
|
|
if (Terrarum.ingame.world.time.timeDelta == 0)
|
|
Echo.execute("時間よ止まれ!ザ・ワルド!!")
|
|
else
|
|
Echo.execute("Set time delta to ${Terrarum.ingame.world.time.timeDelta}")
|
|
}
|
|
else {
|
|
printUsage()
|
|
}
|
|
}
|
|
|
|
override fun printUsage() {
|
|
Echo.execute("usage: settimedelta <int>")
|
|
}
|
|
} |