diff --git a/.run/Android.run.xml b/.run/Android.run.xml
new file mode 100644
index 0000000..51d4be2
--- /dev/null
+++ b/.run/Android.run.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.run/Desktop.run.xml b/.run/Desktop.run.xml
new file mode 100644
index 0000000..9784541
--- /dev/null
+++ b/.run/Desktop.run.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+ true
+ true
+ false
+ false
+
+
+
\ No newline at end of file
diff --git a/commonUI/build.gradle.kts b/commonUI/build.gradle.kts
index 79ef380..89fa7b8 100644
--- a/commonUI/build.gradle.kts
+++ b/commonUI/build.gradle.kts
@@ -26,10 +26,10 @@ kotlin {
implementation(compose.components.resources)
implementation(compose.runtime)
implementation(compose.foundation)
- implementation(compose.material3)
implementation(compose.ui)
implementation(compose.components.uiToolingPreview)
-// implementation(libs.compose.ui.text.googlefonts)
+
+ implementation(compose.material3)
implementation(libs.bundles.logging)
}
diff --git a/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/Game.kt b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/Game.kt
index 0b2178b..fe480b2 100644
--- a/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/Game.kt
+++ b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/Game.kt
@@ -110,7 +110,7 @@ class Game(
return Game(
grid = Grid(
rows = options.values
- .map { createRow>(it) }
+ .map { createRow>(it.sorted()) }
.toList()
),
clues = clues
diff --git a/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/GameCell.kt b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/GameCell.kt
index 0c5e842..3db325b 100644
--- a/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/GameCell.kt
+++ b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/GameCell.kt
@@ -19,7 +19,7 @@ class GameCell>(
selectionChangedListeners.forEach { listener -> listener(value) }
}
}
- val options: ObservableSet- > = ObservableSet(options.toMutableSet()) { before, after ->
+ val options: ObservableSet
- > = ObservableSet(options) { before, after ->
optionsChangedListeners.forEach { listener ->
listener(after)
}
@@ -40,12 +40,13 @@ class GameCell>(
}
}
-fun > GameCell?.mayBe(item: Item, mayHaveSelection: Boolean = true) =
+fun > GameCell?.mayBe(item: Item, mayHaveSelection: Boolean = true): Boolean =
this != null &&
((mayHaveSelection && selection == item) || (selection == null && options.contains(item)))
-fun > GameCell?.isA(item: Item) =
+fun > GameCell?.isA(item: Item): Boolean =
this != null && selection == item
-fun > GameCell?.hasNoSelection(): Boolean = this != null && this.selection == null
+fun > GameCell?.hasNoSelection(): Boolean =
+ this != null && this.selection == null
diff --git a/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/Grid.kt b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/Grid.kt
index 903556f..270f4ae 100644
--- a/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/Grid.kt
+++ b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/Grid.kt
@@ -45,7 +45,7 @@ fun List
>>>.toGrid() = Grid(
map { row ->
GameRow(
category = row.first().itemType.companion,
- options = row,
+ options = row.sorted(),
cells = row.map {
GameCell(
selection = null,
diff --git a/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/Item.kt b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/Item.kt
index 87ae858..ea77a4b 100644
--- a/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/Item.kt
+++ b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/Item.kt
@@ -4,7 +4,7 @@ package ch.dissem.yaep.domain
class Item>(
val itemType: C,
val symbol: String = itemType.symbols.random()
-) {
+) : Comparable- > {
constructor(itemType: C) : this(itemType, itemType.symbols.random())
override fun equals(other: Any?): Boolean {
@@ -20,4 +20,6 @@ class Item>(
override fun toString(): String {
return itemType.toString() + symbol
}
+
+ override fun compareTo(other: Item): Int = itemType.compareTo(other.itemType)
}
diff --git a/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/items.kt b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/items.kt
index 3fdcc24..9ee3157 100644
--- a/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/items.kt
+++ b/domain/src/commonMain/kotlin/ch/dissem/yaep/domain/items.kt
@@ -138,6 +138,7 @@ enum class Transportation(symbol: String) : ItemClass {
companion object : ItemClassCompanion {
override val items: List = entries
}
+
}
private val GENDERS = arrayOf("\uD83E\uDDD1", "\uD83D\uDC68", "\uD83D\uDC69")
@@ -150,13 +151,17 @@ private fun idic(symbol: String): Array = Array(GENDERS.size * SKIN_TONE
g + t + symbol
}
-sealed interface ItemClass> {
+sealed interface ItemClass>: Comparable> {
val symbols: Array
val name: String
val companion: ItemClassCompanion
+ val ordinal: Int
+
+ override fun compareTo(other: ItemClass<*>): Int = ordinal.compareTo(other.ordinal)
+
companion object {
val classes: List> = listOf(
Nationality,
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 27f483b..a674cd4 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -5,7 +5,7 @@ agp = "8.10.1"
jdk = "21"
android-compileSdk = "35"
android-minSdk = "24"
-android-targetSdk = "35"
+android-targetSdk = "36"
androidx-activityCompose = "1.10.1"
androidx-compose = "1.8.2"
compose-plugin = "1.7.0"