mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 19:14:05 +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
|
i-- // array removed 1 elem, so also decrement counter by 1
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//actorContainer[i].update(gc, delta)
|
actorContainer[i].update(gc, delta)
|
||||||
actorContainer[i].start()
|
|
||||||
}
|
}
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,14 +9,7 @@ import org.newdawn.slick.GameContainer
|
|||||||
*/
|
*/
|
||||||
abstract class Actor : Comparable<Actor>, Runnable {
|
abstract class Actor : Comparable<Actor>, Runnable {
|
||||||
|
|
||||||
abstract protected fun update(gc: GameContainer, delta_t: Int) // use start() for multithreaded env
|
abstract fun update(gc: GameContainer, delta_t: Int)
|
||||||
|
|
||||||
protected var thread: Thread? = null
|
|
||||||
|
|
||||||
fun start() {
|
|
||||||
thread = Thread(this, "ID: $referenceID")
|
|
||||||
thread!!.run()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Valid RefID is equal to or greater than 32768.
|
* Valid RefID is equal to or greater than 32768.
|
||||||
|
|||||||
Reference in New Issue
Block a user