Make world have executor
This commit is contained in:
parent
8d8d4029a7
commit
d0216b997e
@ -14,6 +14,7 @@ import ru.dbotthepony.kbox2d.dynamics.B2World
|
||||
import ru.dbotthepony.kbox2d.dynamics.contact.AbstractContact
|
||||
import ru.dbotthepony.kstarbound.Starbound
|
||||
import ru.dbotthepony.kstarbound.math.*
|
||||
import ru.dbotthepony.kstarbound.util.ManualExecutorService
|
||||
import ru.dbotthepony.kstarbound.world.api.ICellAccess
|
||||
import ru.dbotthepony.kstarbound.world.api.IChunkCell
|
||||
import ru.dbotthepony.kstarbound.world.api.TileView
|
||||
@ -56,6 +57,7 @@ abstract class World<This : World<This, ChunkType>, ChunkType : Chunk<This, Chun
|
||||
|
||||
val background = TileView.Background(this)
|
||||
val foreground = TileView.Foreground(this)
|
||||
val executor = ManualExecutorService()
|
||||
|
||||
final override fun randomLongFor(x: Int, y: Int) = super.randomLongFor(x, y) xor seed
|
||||
|
||||
@ -323,6 +325,8 @@ abstract class World<This : World<This, ChunkType>, ChunkType : Chunk<This, Chun
|
||||
|
||||
fun think() {
|
||||
try {
|
||||
executor.executeQueuedTasks()
|
||||
|
||||
for (chunk in dirtyPhysicsChunks)
|
||||
chunk.bakeCollisions()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user