mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-06 08:38:30 +09:00
what a stupid typo
This commit is contained in:
@@ -108,6 +108,10 @@ open class Electric : FixtureBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getWireEmissionAt(offsetX: Int, offsetY: Int): Vector2 {
|
||||||
|
return wireEmission[pointToBlockBoxIndex(offsetX, offsetY)] ?: Vector2()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns true if at least one of following condition is `true`
|
* returns true if at least one of following condition is `true`
|
||||||
* - `getWireStateAt(x, y, "digital_bit").x` is equal to or greater than `ELECTIC_THRESHOLD_HIGH`
|
* - `getWireStateAt(x, y, "digital_bit").x` is equal to or greater than `ELECTIC_THRESHOLD_HIGH`
|
||||||
@@ -130,10 +134,6 @@ open class Electric : FixtureBase {
|
|||||||
getWireStateAt(offsetX, offsetY, "digital_bit").x <= ELECTRIC_THRESHOLD_LOW ||
|
getWireStateAt(offsetX, offsetY, "digital_bit").x <= ELECTRIC_THRESHOLD_LOW ||
|
||||||
getWireEmissionAt(offsetX, offsetY).x <= ELECTRIC_THRESHOLD_LOW
|
getWireEmissionAt(offsetX, offsetY).x <= ELECTRIC_THRESHOLD_LOW
|
||||||
|
|
||||||
fun getWireEmissionAt(offsetX: Int, offsetY: Int): Vector2 {
|
|
||||||
return wireEmission[pointToBlockBoxIndex(offsetY, offsetY)] ?: Vector2()
|
|
||||||
}
|
|
||||||
|
|
||||||
private val oldSinkStatus: Array<Vector2>
|
private val oldSinkStatus: Array<Vector2>
|
||||||
private val newSinkStatus: Array<Vector2>
|
private val newSinkStatus: Array<Vector2>
|
||||||
|
|
||||||
|
|||||||
@@ -135,18 +135,8 @@ class FixtureSignalBlocker : Electric, Reorientable {
|
|||||||
val two = isSignalHigh(1, 0)
|
val two = isSignalHigh(1, 0)
|
||||||
val four = isSignalHigh(0, 1)
|
val four = isSignalHigh(0, 1)
|
||||||
val eight = isSignalHigh(1, 1)
|
val eight = isSignalHigh(1, 1)
|
||||||
// WHY READING FROM wireEmission DOES NOT WORK????
|
|
||||||
// fixme actually read from wireEmission as the gate's output has propagation delay but current sprite "hack" does not consider it
|
|
||||||
|
|
||||||
var state = one.toInt(0) or two.toInt(1) or four.toInt(2) or eight.toInt(3)
|
val state = one.toInt(0) or two.toInt(1) or four.toInt(2) or eight.toInt(3)
|
||||||
|
|
||||||
state = state or when (orientation) {
|
|
||||||
0 -> 2
|
|
||||||
1 -> 8
|
|
||||||
2 -> 4
|
|
||||||
3 -> 1
|
|
||||||
else -> throw IllegalStateException("Orientation not in range ($orientation)")
|
|
||||||
} * output
|
|
||||||
|
|
||||||
(sprite as SheetSpriteAnimation).currentRow = state
|
(sprite as SheetSpriteAnimation).currentRow = state
|
||||||
(spriteEmissive as SheetSpriteAnimation).currentRow = state
|
(spriteEmissive as SheetSpriteAnimation).currentRow = state
|
||||||
|
|||||||
Reference in New Issue
Block a user