mirror of
https://github.com/kalarina-bit/Matewave.git
synced 2026-11-22 08:06:09 +00:00
Release v1.0.47
This commit is contained in:
@@ -9,8 +9,7 @@ data class Puzzle(
|
||||
val theme: String,
|
||||
val fen: String,
|
||||
val solutionUci: List<String>,
|
||||
val rating: Int,
|
||||
val themes: List<String> = emptyList()
|
||||
val rating: Int
|
||||
)
|
||||
|
||||
/** Localized name of the puzzle theme, shown as the screen title. */
|
||||
@@ -59,16 +58,13 @@ object PuzzleRepository {
|
||||
val o = arr.getJSONObject(i)
|
||||
val solutionArr = o.getJSONArray("solution")
|
||||
val solution = (0 until solutionArr.length()).map { solutionArr.getString(it) }
|
||||
val themesArr = o.optJSONArray("themes")
|
||||
val themes = themesArr?.let { t -> (0 until t.length()).map { t.getString(it) } } ?: emptyList()
|
||||
result.add(
|
||||
Puzzle(
|
||||
id = o.getInt("id"),
|
||||
theme = o.optString("theme", "tactic"),
|
||||
fen = o.getString("fen"),
|
||||
solutionUci = solution,
|
||||
rating = o.getInt("rating"),
|
||||
themes = themes
|
||||
rating = o.getInt("rating")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user