new WorldTime based on TIME_T

This commit is contained in:
Song Minjae
2017-04-05 02:52:00 +09:00
parent 1057e7d442
commit 207c90d35e
10 changed files with 304 additions and 648 deletions

View File

@@ -11,10 +11,10 @@ internal object SetTime : ConsoleCommand {
if (args.size == 2) {
val timeToSet = WorldTime.parseTime(args[1])
Terrarum.ingame!!.world.time.setTime(timeToSet)
Terrarum.ingame!!.world.time.setTimeOfToday(timeToSet)
Echo("Set time to ${Terrarum.ingame!!.world.time.elapsedSeconds} " +
"(${Terrarum.ingame!!.world.time.hours}h${formatMin(Terrarum.ingame!!.world.time.minutes)})")
Echo("Set time to ${Terrarum.ingame!!.world.time.todaySeconds} " +
"(${Terrarum.ingame!!.world.time.hours}h${formatMin(Terrarum.ingame!!.world.time.minutes)})")
}
else {
printUsage()

View File

@@ -11,10 +11,7 @@ internal object SetTimeDelta : ConsoleCommand {
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())
Terrarum.ingame!!.world.time.timeDelta = args[1].toInt()
if (Terrarum.ingame!!.world.time.timeDelta == 0)
Echo("時間よ止まれ!ザ・ワルド!!")
else