mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 02:54:04 +09:00
Former-commit-id: b72d0b018c084e80cf4fef77e1b1a81101d6daea Former-commit-id: 32da6a2998826de6519a901dcff7bf058f689b2f
31 lines
863 B
Kotlin
31 lines
863 B
Kotlin
package net.torvald.terrarum.console
|
|
|
|
import net.torvald.terrarum.Terrarum
|
|
|
|
/**
|
|
* Created by minjaesong on 16-03-20.
|
|
*/
|
|
class 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>")
|
|
}
|
|
} |