reading material from the module; pixaxes use it

But "dynamic item" created from the pickaxe class is not right
This commit is contained in:
minjaesong
2019-03-10 23:38:11 +09:00
parent 2570b13ad4
commit 80c29f871c
15 changed files with 249 additions and 135 deletions

View File

@@ -139,45 +139,45 @@ object BlockCodex {
print("${intVal(record, "id")}")
println("\t" + prop.nameKey)
}
private fun str16ToInt(rec: CSVRecord, s: String): Int {
var ret = 0
try {
ret = rec.get(s).toLong(16).toInt()
}
catch (e: NumberFormatException) {
}
catch (e1: IllegalStateException) {
}
return ret
}
private fun intVal(rec: CSVRecord, s: String): Int {
var ret = -1
try {
ret = rec.get(s).toInt()
}
catch (e: NumberFormatException) {
}
catch (e1: IllegalStateException) {
}
return ret
}
private fun floatVal(rec: CSVRecord, s: String): Float {
var ret = -1f
try {
ret = rec.get(s).toFloat()
}
catch (e: NumberFormatException) {
}
catch (e1: IllegalStateException) {
}
return ret
}
private fun boolVal(rec: CSVRecord, s: String) = intVal(rec, s) != 0
}
fun str16ToInt(rec: CSVRecord, s: String): Int {
var ret = 0
try {
ret = rec.get(s).toLong(16).toInt()
}
catch (e: NumberFormatException) {
}
catch (e1: IllegalStateException) {
}
return ret
}
fun intVal(rec: CSVRecord, s: String): Int {
var ret = -1
try {
ret = rec.get(s).toInt()
}
catch (e: NumberFormatException) {
}
catch (e1: IllegalStateException) {
}
return ret
}
fun floatVal(rec: CSVRecord, s: String): Float {
var ret = -1f
try {
ret = rec.get(s).toFloat()
}
catch (e: NumberFormatException) {
}
catch (e1: IllegalStateException) {
}
return ret
}
fun boolVal(rec: CSVRecord, s: String) = intVal(rec, s) != 0