mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 12:21:52 +09:00
no multithreading for actor update
Former-commit-id: aa575fabff183802cd326b24d5788bd44adbad95 Former-commit-id: a0d2b650aa5d3f19717049b17284eb76c694b24b
This commit is contained in:
@@ -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++
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user