completely abolishing GSON; new save format impl wip

This commit is contained in:
minjaesong
2021-08-23 16:55:51 +09:00
parent df1ebdf93d
commit e15d5c9b05
58 changed files with 421 additions and 2101 deletions

View File

@@ -1,8 +1,12 @@
package net.torvald.terrarum.gamecontroller
import com.badlogic.gdx.utils.JsonValue
import net.torvald.terrarum.utils.JsonFetcher
import java.util.*
/**
* Created by minjaesong on 2016-07-28.
*/
@@ -16,17 +20,18 @@ object KeyLayout {
init {
layouts = HashMap<String, KeyLayoutClass>()
val json = JsonFetcher("./res/keylayout.json")
json.entrySet().forEach { it ->
val map = net.torvald.terrarum.utils.JsonFetcher("./res/keylayout.json")
JsonFetcher.forEach(map) { name, entry ->
layouts.put(
it.key,
name,
KeyLayoutClass(
it.value.asJsonObject.get("layout").asString,
it.value.asJsonObject.get("name").asString,
it.value.asJsonObject.get("capslock").asString
entry.getString("layout"),
entry.getString("name"),
entry.getString("capslock")
)
)
}
}
}