mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-15 13:04:05 +09:00
seemingly working #41
This commit is contained in:
@@ -565,9 +565,9 @@ open class TerrarumIngame(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
|
||||
|
||||
// synchronised Ingame Input Updater
|
||||
// will also queue up the block/wall/wire placed events
|
||||
ingameController.update(delta)
|
||||
|
||||
|
||||
if (!paused) {
|
||||
|
||||
//hypothetical_input_capturing_function_if_you_finally_decided_to_forgo_gdx_input_processor_and_implement_your_own_to_synchronise_everything()
|
||||
@@ -615,12 +615,12 @@ open class TerrarumIngame(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
|
||||
}
|
||||
|
||||
/*if (!paused) {
|
||||
if (!paused) {
|
||||
// completely consume block change queues because why not
|
||||
terrainChangeQueue.clear()
|
||||
wallChangeQueue.clear()
|
||||
wireChangeQueue.clear()
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
////////////////////////
|
||||
@@ -859,13 +859,26 @@ open class TerrarumIngame(batch: SpriteBatch) : IngameInstance(batch) {
|
||||
}
|
||||
}
|
||||
|
||||
/*if (it is CuedByTerrainChange) {
|
||||
printdbg(this, "actor is CuedByTerrainChange: ${terrainChangeQueue}")
|
||||
if (it is CuedByTerrainChange) {
|
||||
terrainChangeQueue.forEach { cue ->
|
||||
printdbg(this, "Ingame actors terrainChangeCue: ${cue}")
|
||||
it.updateForWorldChange(cue)
|
||||
it.updateForTerrainChange(cue)
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
if (it is CuedByWallChange) {
|
||||
wallChangeQueue.forEach { cue ->
|
||||
printdbg(this, "Ingame actors wallChangeCue: ${cue}")
|
||||
it.updateForWallChange(cue)
|
||||
}
|
||||
}
|
||||
|
||||
if (it is CuedByWireChange) {
|
||||
wireChangeQueue.forEach { cue ->
|
||||
printdbg(this, "Ingame actors wireChangeCue: ${cue}")
|
||||
it.updateForWireChange(cue)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
actorNowPlaying?.update(delta)
|
||||
|
||||
@@ -65,6 +65,10 @@ open class FixtureBase(
|
||||
}
|
||||
}
|
||||
|
||||
override fun updateForTerrainChange(cue: IngameInstance.BlockChangeQueueItem) {
|
||||
// TODO check for despawn code here
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds this instance of the fixture to the world
|
||||
*
|
||||
@@ -187,9 +191,18 @@ interface CuedByTerrainChange {
|
||||
*
|
||||
* E.g. if a fixture block that is inside of BlockBox is missing, destroy and drop self.
|
||||
*/
|
||||
//fun updateForWorldChange(cue: IngameInstance.BlockChangeQueueItem)
|
||||
fun updateForTerrainChange(cue: IngameInstance.BlockChangeQueueItem)
|
||||
}
|
||||
|
||||
interface CuedByWallChange {
|
||||
fun updateForWallChange(cue: IngameInstance.BlockChangeQueueItem)
|
||||
}
|
||||
|
||||
interface CuedByWireChange {
|
||||
fun updateForWireChange(cue: IngameInstance.BlockChangeQueueItem)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Standard 32-bit binary flags.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user