player now created with proper born date

Former-commit-id: c77996cb7074d7c32421bb1f5a37194de0f16946
Former-commit-id: a9613ef941030ffe2b441bb19538573144b00608
This commit is contained in:
Song Minjae
2016-10-15 12:19:50 +09:00
parent c1d72c29af
commit 41b4a929d8
2 changed files with 9 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
package net.torvald.terrarum.gameactors package net.torvald.terrarum.gameactors
import net.torvald.terrarum.Terrarum
import org.newdawn.slick.SlickException import org.newdawn.slick.SlickException
import java.io.IOException import java.io.IOException
@@ -12,7 +13,7 @@ object PlayerBuilder {
@Throws(IOException::class, SlickException::class) @Throws(IOException::class, SlickException::class)
fun create(): Player { fun create(): Player {
val p: Player = Player() val p: Player = Player(Terrarum.ingame.world.time.currentTimeAsGameDate)
CreatureRawInjector.inject(p.actorValue, "CreatureHuman.json") CreatureRawInjector.inject(p.actorValue, "CreatureHuman.json")
// attach sprite // attach sprite

View File

@@ -1,5 +1,7 @@
package net.torvald.terrarum.gameworld package net.torvald.terrarum.gameworld
import net.torvald.terrarum.gameactors.GameDate
/** /**
* The World Calendar implementation of Dwarven Calendar (we're talking about DF!) * The World Calendar implementation of Dwarven Calendar (we're talking about DF!)
* *
@@ -15,6 +17,8 @@ package net.torvald.terrarum.gameworld
* Created by minjaesong on 16-01-24. * Created by minjaesong on 16-01-24.
*/ */
class WorldTime { class WorldTime {
internal var TIME_T = 0L // TODO use it! Epoch: Year 125, 1st Granite, 0h00:00
internal var seconds: Int // 0 - 59 internal var seconds: Int // 0 - 59
internal var minutes: Int // 0 - 59 internal var minutes: Int // 0 - 59
internal var hours: Int // 0 - 21 internal var hours: Int // 0 - 21
@@ -45,6 +49,9 @@ class WorldTime {
val MONTH_NAMES_SHORT = arrayOf("Opal", "Obsi", "Gran", "Slat", "Fels", "Hema", val MONTH_NAMES_SHORT = arrayOf("Opal", "Obsi", "Gran", "Slat", "Fels", "Hema",
"Mala", "Gale", "Lime", "Sand", "Timb", "Moon") "Mala", "Gale", "Lime", "Sand", "Timb", "Moon")
val currentTimeAsGameDate: GameDate
get() = GameDate(years, yearlyDays)
@Transient val REAL_SEC_IN_MILLI = 1000 @Transient val REAL_SEC_IN_MILLI = 1000
companion object { companion object {