crafting recipe loader wip

This commit is contained in:
minjaesong
2022-06-25 03:28:02 +09:00
parent 828a485395
commit 4569546bdd
11 changed files with 162 additions and 23 deletions

View File

@@ -120,7 +120,7 @@ object Common {
override fun read(json: Json, jsonData: JsonValue, type: Class<*>?): HashArray<*> {
val hashMap = HashArray<Any>()
JsonFetcher.forEach(jsonData) { key, obj ->
JsonFetcher.forEachSiblings(jsonData) { key, obj ->
hashMap[key.toLong()] = json.readValue(null, obj)
}
return hashMap
@@ -138,7 +138,7 @@ object Common {
override fun read(json: Json, jsonData: JsonValue, type: Class<*>?): HashedWirings {
val hashMap = HashedWirings()
JsonFetcher.forEach(jsonData) { key, obj ->
JsonFetcher.forEachSiblings(jsonData) { key, obj ->
hashMap[key.toLong()] = json.readValue(GameWorld.WiringNode::class.java, obj)
}
return hashMap
@@ -156,7 +156,7 @@ object Common {
override fun read(json: Json, jsonData: JsonValue, type: Class<*>?): HashedWiringGraph {
val hashMap = HashedWiringGraph()
JsonFetcher.forEach(jsonData) { key, obj ->
JsonFetcher.forEachSiblings(jsonData) { key, obj ->
hashMap[key.toLong()] = json.readValue(WiringGraphMap::class.java, obj)
}
return hashMap
@@ -174,7 +174,7 @@ object Common {
override fun read(json: Json, jsonData: JsonValue, type: Class<*>?): WiringGraphMap {
val hashMap = WiringGraphMap()
JsonFetcher.forEach(jsonData) { key, obj ->
JsonFetcher.forEachSiblings(jsonData) { key, obj ->
hashMap[key] = json.readValue(GameWorld.WiringSimCell::class.java, obj)
}
return hashMap

View File

@@ -31,7 +31,7 @@ object WriteConfig {
override fun read(json: Json, jsonData: JsonValue, type: Class<*>?): KVHashMap {
val map = KVHashMap()
JsonFetcher.forEach(jsonData) { key, obj ->
JsonFetcher.forEachSiblings(jsonData) { key, obj ->
map[key] = json.readValue(null, obj)
}
return map