wire colour fade by signal strength

This commit is contained in:
minjaesong
2024-03-14 00:18:25 +09:00
parent 6abb6f84ef
commit 5b462a2559
4 changed files with 47 additions and 3 deletions

View File

@@ -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 {