mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-10 05:41:51 +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? {
|
||||
return wiringGraph[blockAddr]?.get(itemID)?.con
|
||||
return wiringGraph[blockAddr]?.get(itemID)?.connections
|
||||
}
|
||||
|
||||
fun getWireEmitStateOf(x: Int, y: Int, itemID: ItemID): Vector2? {
|
||||
@@ -389,7 +389,7 @@ open class GameWorld : Disposable {
|
||||
if (wiringGraph[blockAddr]!![itemID] == null)
|
||||
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) {
|
||||
@@ -647,7 +647,7 @@ open class GameWorld : Disposable {
|
||||
* These values must be updated by none other than [WorldSimulator]()
|
||||
*/
|
||||
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 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.gamecontroller.KeyToggler
|
||||
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.gameactors.ActorHumanoid
|
||||
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
|
||||
world.getAllWiresFrom(point.x, point.y)?.filter { WireCodex[it].accepts == wireType }?.forEach { wire ->
|
||||
world.getAllWiringGraph(point.x, point.y)?.get(wire)?.let { node ->
|
||||
val connexion = node.con.toInt()
|
||||
when (wireConToStatus[connexion]) {
|
||||
val cnx = node.connections.toInt()
|
||||
when (wireConToStatus[cnx]) {
|
||||
WireConStatus.THRU -> {
|
||||
// TODO
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user