Package-level declarations

Overview

Active game screen with interactive board, move controls, and real-time game state display.

Components

  • GamePage — Main game page composable

  • GamePageView — Game board and controls view

  • GamePageViewModel — Game state management and move coordination

  • utils/ — Helper utilities for game rendering and interactions

Responsibilities

  • Rendering the interactive game board

  • Handling player move input

  • Displaying current game state (scores, turn, available moves)

  • Managing game flow (play, pass, forfeit)

  • Providing visual feedback for moves and captures

Types

Link copied to clipboard
class GamePageViewModel(val game: Game, val scope: CoroutineScope, val setGame: (Game) -> Unit, val audioPlayMove: () -> Unit, val setPage: (Page) -> Unit = {}, val globalError: ReversiException? = null, val setGlobalError: (Exception?, ErrorType?) -> Unit) : ViewModel<GameUiState>

View model for the game page managing game state, UI updates, and user interactions. Handles game move execution, state polling for multiplayer games, and sound effects.

Link copied to clipboard
data class GameUiState(val game: Game, val screenState: ScreenState = ScreenState()) : UiState

UI state for the game page.

Functions

Link copied to clipboard
@Composable
fun ReversiScope.GamePage(viewModel: GamePageViewModel, modifier: Modifier = Modifier, freeze: Boolean = false, onLeave: (Game) -> Unit)

Main game page displaying the Reversi board, player scores, and game controls. Manages game music playback and periodic game state refreshes for multiplayer games.

Link copied to clipboard
@Composable
fun ReversiScope.GamePageView(modifier: Modifier = Modifier, game: Game, freeze: Boolean, getAvailablePlays: () -> List<Coordinate>, onCellClick: (coordinate: Coordinate) -> Unit, setTargetMode: (target: Boolean) -> Unit, pass: () -> Unit)

Main game view composable displaying the board and player information side-by-side. Combines the game board on the left with player scores and controls on the right.