no multithreading for actor update

Former-commit-id: aa575fabff183802cd326b24d5788bd44adbad95
Former-commit-id: a0d2b650aa5d3f19717049b17284eb76c694b24b
This commit is contained in:
Song Minjae
2016-05-01 11:35:00 +09:00
parent 64f9799c67
commit 05b374bfa7
2 changed files with 2 additions and 10 deletions

View File

@@ -349,8 +349,7 @@ constructor() : BasicGameState() {
i-- // array removed 1 elem, so also decrement counter by 1
}
else {
//actorContainer[i].update(gc, delta)
actorContainer[i].start()
actorContainer[i].update(gc, delta)
}
i++
}

View File

@@ -9,14 +9,7 @@ import org.newdawn.slick.GameContainer
*/
abstract class Actor : Comparable<Actor>, Runnable {
abstract protected fun update(gc: GameContainer, delta_t: Int) // use start() for multithreaded env
protected var thread: Thread? = null
fun start() {
thread = Thread(this, "ID: $referenceID")
thread!!.run()
}
abstract fun update(gc: GameContainer, delta_t: Int)
/**
* Valid RefID is equal to or greater than 32768.