Package-level declarations

Overview

Lobby interface for browsing, joining, and managing multiplayer games.

Components

  • LobbyMenu — Main lobby composable

  • LobbyViewModel — State management for lobby operations

  • lobbyViews/ — Sub-components for displaying game lists and details

Responsibilities

  • Displaying available games

  • Allowing players to join existing games

  • Managing game lobby state

  • Refreshing game lists from storage

Types

Link copied to clipboard
data class LobbyLoadedState(val gameState: GameState, val name: String)

Represents a game loaded from storage in the lobby.

Link copied to clipboard

Enumeration of possible lobby screen states.

Link copied to clipboard
data class LobbyUiState(val gameStates: List<LobbyLoadedState> = emptyList(), val lobbyState: LobbyState = LobbyState.NONE, val selectedGame: LobbyLoadedState? = null, val canRefresh: Boolean = false, val screenState: ScreenState = ScreenState( error = null, isLoading = false )) : UiState

UI state for the lobby screen displaying available games.

Link copied to clipboard
class LobbyViewModel(val appState: AppStateImpl, val scope: CoroutineScope, val pickGame: (Game) -> Unit, val globalError: ReversiException? = null, val setGlobalError: (Exception?, ErrorType?) -> Unit) : ViewModel<LobbyUiState>

View model for the lobby screen managing game list, polling, and user interactions. Handles loading available games, polling for updates, and game selection.

Properties

Link copied to clipboard
private const val PAGE_TRANSITION_DURATION_MS: Int = 500
Link copied to clipboard
private const val POLL_INTERVAL_MS: Long = 1000
Link copied to clipboard
private const val UI_DELAY_SHORT_MS: Long = 100

Functions

Link copied to clipboard
@Composable
fun ReversiScope.LobbyMenu(viewModel: LobbyViewModel, onLeave: () -> Unit)

Lobby menu screen for browsing and joining saved multiplayer games. Displays available games in a carousel and handles game selection and joining.