controlling part of Player moved to ActorHumanoid to alleviate the potential pain on your arse when implementing any NPCs

Former-commit-id: 33f5dba5becef6d60e1413bb8085eeaa0673a345
Former-commit-id: 8c5a3ad7a9d8565908829798110ade8f294c8d44
This commit is contained in:
Song Minjae
2016-10-24 12:18:44 +09:00
parent 9e8171b5b9
commit 53c82a34d5
8 changed files with 524 additions and 480 deletions

View File

@@ -3,6 +3,7 @@ package net.torvald.terrarum
import net.torvald.imagefont.GameFontBase
import net.torvald.terrarum.audio.AudioResourceLibrary
import net.torvald.terrarum.concurrent.ThreadPool
import net.torvald.terrarum.console.ActorHumanoid
import net.torvald.terrarum.gameactors.*
import net.torvald.terrarum.console.Authenticator
import net.torvald.terrarum.console.CommandDict
@@ -59,7 +60,7 @@ constructor() : BasicGameState() {
lateinit var notifier: UIHandler
lateinit internal var playerWrapper: AnyPlayer
internal val player: HistoricalFigure // currently POSSESSED actor :)
internal val player: ActorHumanoid // currently POSSESSED actor :)
get() = playerWrapper.actor
//private var GRADIENT_IMAGE: Image? = null
@@ -251,13 +252,13 @@ constructor() : BasicGameState() {
throw IllegalArgumentException("No such actor in actorContainer: $refid")
}
playerWrapper = AnyPlayer(getActorByID(refid) as HistoricalFigure)
playerWrapper = AnyPlayer(getActorByID(refid) as ActorHumanoid)
WorldSimulator(world, player, UPDATE_DELTA)
}
private fun setAppTitle() {
Terrarum.appgc.setTitle(
"${Terrarum.NAME}" +
Terrarum.NAME +
" — F: ${Terrarum.appgc.fps} (${Terrarum.TARGET_INTERNAL_FPS})" +
" — M: ${Terrarum.memInUse}M / ${Terrarum.totalVMMem}M")
}