mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-15 21:14:04 +09:00
completely abolishing GSON; new save format impl wip
This commit is contained in:
@@ -275,37 +275,31 @@ internal object WeatherMixer : RNGConsumer {
|
||||
|
||||
val JSON = JsonFetcher(path)
|
||||
|
||||
val skyboxInJson = JSON.get("skyboxGradColourMap").asJsonPrimitive
|
||||
val extraImagesPath = JSON.getAsJsonArray("extraImages")
|
||||
val skyboxInJson = JSON.getString("skyboxGradColourMap")
|
||||
val extraImagesPath = JSON.get("extraImages").asStringArray()
|
||||
|
||||
|
||||
|
||||
val skybox = if (skyboxInJson.isString)
|
||||
GdxColorMap(ModMgr.getGdxFile("basegame", "$pathToImage/${skyboxInJson.asString}"))
|
||||
else
|
||||
throw IllegalStateException("In weather descriptor $path -- skyboxGradColourMap seems malformed.")
|
||||
val skybox = GdxColorMap(ModMgr.getGdxFile("basegame", "$pathToImage/${skyboxInJson}"))
|
||||
|
||||
|
||||
|
||||
val extraImages = ArrayList<Texture>()
|
||||
for (i in extraImagesPath)
|
||||
extraImages.add(Texture(ModMgr.getGdxFile("basegame", "$pathToImage/${i.asString}")))
|
||||
extraImages.add(Texture(ModMgr.getGdxFile("basegame", "$pathToImage/${i}")))
|
||||
|
||||
|
||||
|
||||
val classification = JSON.get("classification").asJsonPrimitive.asString
|
||||
val classification = JSON.getString("classification")
|
||||
|
||||
|
||||
|
||||
var mixFrom: String?
|
||||
try { mixFrom = JSON.get("mixFrom").asJsonPrimitive.asString }
|
||||
catch (e: NullPointerException) { mixFrom = null }
|
||||
try { mixFrom = JSON.getString("mixFrom") }
|
||||
catch (e: IllegalArgumentException) { mixFrom = null }
|
||||
|
||||
|
||||
|
||||
var mixPercentage: Double?
|
||||
try { mixPercentage = JSON.get("mixPercentage").asJsonPrimitive.asDouble }
|
||||
catch (e: NullPointerException) { mixPercentage = null }
|
||||
try { mixPercentage = JSON.getDouble("mixPercentage") }
|
||||
catch (e: IllegalArgumentException) { mixPercentage = null }
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user