NewGameViewModel
class NewGameViewModel(val scope: CoroutineScope, val appState: AppStateImpl, val globalError: ReversiException? = null, val setGlobalError: (Exception?, ErrorType?) -> Unit, val createGame: (Game) -> Unit) : ViewModel<NewGameUiState>
ViewModel that builds local or remote games based on user inputs. Validates piece selection, triggers game creation, and exposes UI state/errors.
Parameters
scope
Coroutine scope for background operations.
playerName
Current player name used when creating non-local games.
globalError
Optional global error propagated into initial UI state.
setGlobalError
Callback to update global error when present.
createGame
Callback invoked with the created game instance.
Constructors
Link copied to clipboard
constructor(scope: CoroutineScope, appState: AppStateImpl, globalError: ReversiException? = null, setGlobalError: (Exception?, ErrorType?) -> Unit, createGame: (Game) -> Unit)