mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 19:44:05 +09:00
Former-commit-id: 851e141fc91b170190d6027f42f59906dda0f31f Former-commit-id: 03dbb9da1788e1c50e84ae33d95f76194ad9a08d
31 lines
837 B
Kotlin
31 lines
837 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)
|
|
EchoError("Delta too large -- acceptable delta is 0-60.")
|
|
|
|
Terrarum.ingame.world.time.setTimeDelta(args[1].toInt())
|
|
if (Terrarum.ingame.world.time.timeDelta == 0)
|
|
Echo("時間よ止まれ!ザ・ワルド!!")
|
|
else
|
|
Echo("Set time delta to ${Terrarum.ingame.world.time.timeDelta}")
|
|
}
|
|
else {
|
|
printUsage()
|
|
}
|
|
}
|
|
|
|
override fun printUsage() {
|
|
Echo("usage: settimedelta <int>")
|
|
}
|
|
} |