mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-19 15:04:05 +09:00
wire branching traversal itself works, but fetches wrong signal status
This commit is contained in:
@@ -71,9 +71,9 @@ open class IngameInstance(val batch: SpriteBatch) : Screen {
|
||||
val actorContainerInactive = SortedArrayList<Actor>(ACTORCONTAINER_INITIAL_SIZE)
|
||||
|
||||
// FIXME queues will not work; input processing (blocks will queue) and queue consuming cannot be synchronised
|
||||
protected val terrainChangeQueue = ArrayList<BlockChangeQueueItem>()
|
||||
protected val wallChangeQueue = ArrayList<BlockChangeQueueItem>()
|
||||
protected val wireChangeQueue = ArrayList<BlockChangeQueueItem>() // if 'old' is set and 'new' is blank, it's a wire cutter
|
||||
//protected val terrainChangeQueue = ArrayList<BlockChangeQueueItem>()
|
||||
//protected val wallChangeQueue = ArrayList<BlockChangeQueueItem>()
|
||||
//protected val wireChangeQueue = ArrayList<BlockChangeQueueItem>() // if 'old' is set and 'new' is blank, it's a wire cutter
|
||||
|
||||
override fun hide() {
|
||||
}
|
||||
@@ -153,15 +153,14 @@ open class IngameInstance(val batch: SpriteBatch) : Screen {
|
||||
* Queueing schema is used to make sure things are synchronised.
|
||||
*/
|
||||
open fun queueTerrainChangedEvent(old: ItemID, new: ItemID, x: Int, y: Int) {
|
||||
printdbg(this, "Terrain change enqueued: ${BlockChangeQueueItem(old, new, x, y)}")
|
||||
printdbg(this, terrainChangeQueue)
|
||||
//printdbg(this, terrainChangeQueue)
|
||||
}
|
||||
|
||||
/**
|
||||
* Wall version of terrainChanged() event
|
||||
*/
|
||||
open fun queueWallChangedEvent(old: ItemID, new: ItemID, x: Int, y: Int) {
|
||||
wallChangeQueue.add(BlockChangeQueueItem(old, new, x, y))
|
||||
//wallChangeQueue.add(BlockChangeQueueItem(old, new, x, y))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -171,7 +170,7 @@ open class IngameInstance(val batch: SpriteBatch) : Screen {
|
||||
* @param new current settings of conduits in bit set format.
|
||||
*/
|
||||
open fun queueWireChangedEvent(wire: ItemID, isRemoval: Boolean, x: Int, y: Int) {
|
||||
wireChangeQueue.add(BlockChangeQueueItem(if (isRemoval) wire else "", if (isRemoval) "" else wire, x, y))
|
||||
//wireChangeQueue.add(BlockChangeQueueItem(if (isRemoval) wire else "", if (isRemoval) "" else wire, x, y))
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user