Physics stuff Float -> Double

Former-commit-id: 54ccee75769691aa6aaa2416767bd15270f63347
Former-commit-id: 61e892434f48adf11e3ca49b60928a930fd5cde9
This commit is contained in:
Song Minjae
2016-05-01 00:23:36 +09:00
parent fba0b80d24
commit c9f5fde3be
26 changed files with 225 additions and 291 deletions

View File

@@ -47,17 +47,6 @@ open class KVHashMap {
return get(key) as Int?
}
fun getAsFloat(key: String): Float? {
val value = get(key)
if (value is Int)
return value.toFloat()
else if (value is JsonPrimitive)
return value.asFloat
return value as Float?
}
fun getAsDouble(key: String): Double? {
val value = get(key)
@@ -66,7 +55,14 @@ open class KVHashMap {
else if (value is JsonPrimitive)
return value.asDouble
return value as Double?
try {
return value as Double?
}
catch (e: ClassCastException) {
System.err.println("[KVHashMap] ClassCastException for key '$key'")
e.printStackTrace(System.err)
}
return null
}
fun getAsString(key: String): String? {