setting up the inventory using builder (during init) requires ingame.player to be nullable, lateinit won't work

This commit is contained in:
Song Minjae
2017-04-11 23:07:29 +09:00
parent 1301121aa9
commit 037e84d6e2
21 changed files with 132 additions and 103 deletions

View File

@@ -19,7 +19,7 @@ import javax.swing.*
*/
class ActorValueTracker constructor() : JFrame() {
constructor(actor: Actor) : this() {
constructor(actor: Actor?) : this() {
setTrackingActor(actor)
}
@@ -146,8 +146,8 @@ class ActorValueTracker constructor() : JFrame() {
this.isVisible = true
}
fun setTrackingActor(actor: Actor) {
this.actorValue = actor.actorValue
fun setTrackingActor(actor: Actor?) {
this.actorValue = actor?.actorValue
this.title = "AVTracker — $actor"