mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
world portal gui wip
This commit is contained in:
@@ -3,6 +3,7 @@ package net.torvald.terrarum.utils
|
||||
import com.badlogic.gdx.utils.JsonReader
|
||||
import com.badlogic.gdx.utils.JsonValue
|
||||
import net.torvald.terrarum.App.printdbg
|
||||
import java.io.Reader
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2016-02-15.
|
||||
@@ -18,9 +19,7 @@ object JsonFetcher {
|
||||
|
||||
printdbg(this, "Reading JSON $jsonFilePath")
|
||||
|
||||
if (jsonString == null) {
|
||||
throw Error("[JsonFetcher] jsonString is null!")
|
||||
}
|
||||
if (jsonString == null) throw Error("[JsonFetcher] jsonString is null!")
|
||||
|
||||
return JsonReader().parse(jsonString.toString())
|
||||
}
|
||||
@@ -32,13 +31,15 @@ object JsonFetcher {
|
||||
|
||||
printdbg(this, "Reading JSON ${jsonFile.path}")
|
||||
|
||||
if (jsonString == null) {
|
||||
throw Error("[JsonFetcher] jsonString is null!")
|
||||
}
|
||||
if (jsonString == null) throw Error("[JsonFetcher] jsonString is null!")
|
||||
|
||||
return JsonReader().parse(jsonString.toString())
|
||||
}
|
||||
|
||||
fun readFromJsonString(stringReader: Reader): JsonValue {
|
||||
return JsonReader().parse(stringReader.readText())
|
||||
}
|
||||
|
||||
@Throws(java.io.IOException::class)
|
||||
private fun readJsonFileAsString(path: String) {
|
||||
java.nio.file.Files.lines(java.nio.file.FileSystems.getDefault().getPath(path)).forEach(
|
||||
|
||||
Reference in New Issue
Block a user