mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 12:04:06 +09:00
some variable renaming
This commit is contained in:
@@ -354,7 +354,7 @@ open class GameWorld : Disposable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun getWireGraphUnsafe(blockAddr: BlockAddress, itemID: ItemID): Byte? {
|
fun getWireGraphUnsafe(blockAddr: BlockAddress, itemID: ItemID): Byte? {
|
||||||
return wiringGraph[blockAddr]?.get(itemID)?.con
|
return wiringGraph[blockAddr]?.get(itemID)?.connections
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getWireEmitStateOf(x: Int, y: Int, itemID: ItemID): Vector2? {
|
fun getWireEmitStateOf(x: Int, y: Int, itemID: ItemID): Vector2? {
|
||||||
@@ -389,7 +389,7 @@ open class GameWorld : Disposable {
|
|||||||
if (wiringGraph[blockAddr]!![itemID] == null)
|
if (wiringGraph[blockAddr]!![itemID] == null)
|
||||||
wiringGraph[blockAddr]!![itemID] = WiringSimCell(byte)
|
wiringGraph[blockAddr]!![itemID] = WiringSimCell(byte)
|
||||||
|
|
||||||
wiringGraph[blockAddr]!![itemID]!!.con = byte
|
wiringGraph[blockAddr]!![itemID]!!.connections = byte
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setWireEmitStateOf(x: Int, y: Int, itemID: ItemID, vector: Vector2) {
|
fun setWireEmitStateOf(x: Int, y: Int, itemID: ItemID, vector: Vector2) {
|
||||||
@@ -647,7 +647,7 @@ open class GameWorld : Disposable {
|
|||||||
* These values must be updated by none other than [WorldSimulator]()
|
* These values must be updated by none other than [WorldSimulator]()
|
||||||
*/
|
*/
|
||||||
data class WiringSimCell(
|
data class WiringSimCell(
|
||||||
var con: Byte = 0, // connections
|
var connections: Byte = 0, // connections
|
||||||
var emitState: Vector2 = Vector2(0.0, 0.0), // i'm emitting this much power
|
var emitState: Vector2 = Vector2(0.0, 0.0), // i'm emitting this much power
|
||||||
var recvStates: ArrayList<WireRecvState> = ArrayList() // how far away are the power sources
|
var recvStates: ArrayList<WireRecvState> = ArrayList() // how far away are the power sources
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import net.torvald.terrarum.blockproperties.WireCodex
|
|||||||
import net.torvald.terrarum.gameactors.ActorWithBody
|
import net.torvald.terrarum.gameactors.ActorWithBody
|
||||||
import net.torvald.terrarum.gamecontroller.KeyToggler
|
import net.torvald.terrarum.gamecontroller.KeyToggler
|
||||||
import net.torvald.terrarum.gameitem.ItemID
|
import net.torvald.terrarum.gameitem.ItemID
|
||||||
import net.torvald.terrarum.itemproperties.ItemCodex
|
|
||||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame.Companion.inUpdateRange
|
import net.torvald.terrarum.modulebasegame.TerrarumIngame.Companion.inUpdateRange
|
||||||
import net.torvald.terrarum.modulebasegame.gameactors.ActorHumanoid
|
import net.torvald.terrarum.modulebasegame.gameactors.ActorHumanoid
|
||||||
import net.torvald.terrarum.modulebasegame.gameactors.BlockBoxIndex
|
import net.torvald.terrarum.modulebasegame.gameactors.BlockBoxIndex
|
||||||
@@ -487,8 +486,8 @@ object WorldSimulator {
|
|||||||
// get all wires that matches 'accepts' (such as Red/Green/Blue wire) and propagate signal for each of them
|
// get all wires that matches 'accepts' (such as Red/Green/Blue wire) and propagate signal for each of them
|
||||||
world.getAllWiresFrom(point.x, point.y)?.filter { WireCodex[it].accepts == wireType }?.forEach { wire ->
|
world.getAllWiresFrom(point.x, point.y)?.filter { WireCodex[it].accepts == wireType }?.forEach { wire ->
|
||||||
world.getAllWiringGraph(point.x, point.y)?.get(wire)?.let { node ->
|
world.getAllWiringGraph(point.x, point.y)?.get(wire)?.let { node ->
|
||||||
val connexion = node.con.toInt()
|
val cnx = node.connections.toInt()
|
||||||
when (wireConToStatus[connexion]) {
|
when (wireConToStatus[cnx]) {
|
||||||
WireConStatus.THRU -> {
|
WireConStatus.THRU -> {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user