Skip to content

Commit e8a5faf

Browse files
committed
Round types split to Phase and Player
1 parent 0b8814d commit e8a5faf

7 files changed

Lines changed: 483 additions & 278 deletions

File tree

composeApp/src/commonMain/kotlin/net/solvetheriddle/roundtimer/App.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,15 @@ fun App() {
5959
formatTime = viewModel::formatTime,
6060
activeGameId = state.activeGameId,
6161
games = state.games,
62-
selectedCategory = state.selectedType,
63-
customCategories = state.customTypes,
62+
selectedPhase = state.selectedPhase,
63+
selectedPlayer = state.selectedPlayer,
64+
customPhases = state.customTypes,
6465
playerCategories = state.playerTypes,
65-
onCategorySelect = viewModel::selectCategory,
66-
onAddCustomCategory = viewModel::addCustomCategory,
67-
onRemoveCustomCategory = viewModel::removeCustomCategory,
68-
onRenameCustomCategory = viewModel::renameCustomCategory,
66+
onPhaseSelect = viewModel::selectPhase,
67+
onPlayerSelect = viewModel::selectPlayer,
68+
onAddCustomPhase = viewModel::addCustomCategory,
69+
onRemoveCustomPhase = viewModel::removeCustomCategory,
70+
onRenameCustomPhase = viewModel::renameCustomCategory,
6971
onAddPlayerCategory = viewModel::addPlayerCategory,
7072
onRemovePlayerCategory = viewModel::removePlayerCategory,
7173
onRenamePlayerCategory = viewModel::renamePlayerCategory,

composeApp/src/commonMain/kotlin/net/solvetheriddle/roundtimer/model/Round.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@ data class Round(
99
val overtime: Int, // Overtime seconds (0 if none)
1010
val timestamp: Long, // When round was completed (epoch millis)
1111
val gameId: String, // ID of the game this round belongs to
12-
val category: String = "Everyone" // Category of the round
12+
val category: String = "Everyone", // Deprecated: kept for backward compatibility
13+
val phase: String = "Setup", // New: Phase of the round
14+
val player: String = "Everyone" // New: Player of the round
1315
)

composeApp/src/commonMain/kotlin/net/solvetheriddle/roundtimer/model/TimerState.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ data class TimerState(
1111
val games: List<Game> = emptyList(),
1212
val activeGameId: String? = null,
1313
val settings: SettingsState = SettingsState(),
14-
val selectedType: String = "Preparation",
14+
val selectedType: String = "Preparation", // Deprecated
15+
val selectedPhase: String = "Setup", // New
16+
val selectedPlayer: String = "Everyone", // New
1517
val customTypes: List<String> = emptyList(),
1618
val playerTypes: List<String> = emptyList()
1719
) {

0 commit comments

Comments
 (0)