what a stupid typo

This commit is contained in:
minjaesong
2024-03-04 22:49:44 +09:00
parent caf238d6df
commit 5014381cbd
2 changed files with 5 additions and 15 deletions

View File

@@ -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`
* - `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 ||
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 newSinkStatus: Array<Vector2>

View File

@@ -135,18 +135,8 @@ class FixtureSignalBlocker : Electric, Reorientable {
val two = isSignalHigh(1, 0)
val four = isSignalHigh(0, 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)
state = state or when (orientation) {
0 -> 2
1 -> 8
2 -> 4
3 -> 1
else -> throw IllegalStateException("Orientation not in range ($orientation)")
} * output
val state = one.toInt(0) or two.toInt(1) or four.toInt(2) or eight.toInt(3)
(sprite as SheetSpriteAnimation).currentRow = state
(spriteEmissive as SheetSpriteAnimation).currentRow = state