mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 20:44:05 +09:00
wire colour fade by signal strength
This commit is contained in:
@@ -23,6 +23,8 @@ class WireCodex {
|
||||
|
||||
@Transient val wirePorts = HashMap<WireEmissionType, Triple<TextureRegionPack, Int, Int>>()
|
||||
|
||||
@Transient val wireDecays = HashMap<ItemID, Double>()
|
||||
|
||||
fun clear() {
|
||||
wireProps.clear()
|
||||
}
|
||||
@@ -123,6 +125,23 @@ class WireCodex {
|
||||
}
|
||||
}
|
||||
|
||||
fun wireDecaysFromModule(module: String, path: String) {
|
||||
printdbg(this, "Building wire ports table for module $module")
|
||||
try {
|
||||
registerDecays(module, path, CSVFetcher.readFromModule(module, path + "decayconsts.csv"))
|
||||
}
|
||||
catch (e: IOException) { e.printStackTrace() }
|
||||
}
|
||||
|
||||
private fun registerDecays(module: String, path: String, records: List<CSVRecord>) {
|
||||
records.forEach {
|
||||
val item = it.get("wireItemID")
|
||||
val d = it.get("const").toDouble()
|
||||
|
||||
wireDecays[item] = d
|
||||
}
|
||||
}
|
||||
|
||||
fun getAll() = wireProps.values
|
||||
|
||||
/*fun get(index: Int): WireProp {
|
||||
|
||||
Reference in New Issue
Block a user