ReversiScope

class ReversiScope(val appState: AppStateImpl)

Receiver scope class providing composition helper functions and access to app state. Used as a receiver for composable lambdas to provide themed UI components.

Constructors

Link copied to clipboard
constructor(appState: AppStateImpl)

Properties

Link copied to clipboard

The current application state.

Functions

Link copied to clipboard
@Composable
fun ReversiScope.AboutPage(viewModel: AboutPageViewModel, modifier: Modifier = Modifier, onLeave: () -> Unit)

Simple about page presenting project and authorship information.

Link copied to clipboard
Link copied to clipboard
@Composable
fun ReversiScope.AppearanceSection(theme: AppTheme, appTheme: AppTheme, onClick: (AppTheme) -> Unit)
Link copied to clipboard
@Composable
private fun ReversiScope.ApplyButton(onClick: () -> Unit)
Link copied to clipboard
@Composable
fun ReversiScope.AudioSection(currentVol: Float, onVolumeChange: (Float) -> Unit)
Link copied to clipboard
@Composable
fun ReversiScope.cellView(coordinate: Coordinate, piece: Piece?, freeze: Boolean = false, modifier: Modifier = Modifier, radiusModifier: Float = 1.0f, alphaModifier: Float = 1.0f, onClick: (coordinate: Coordinate) -> Unit)
Link copied to clipboard
@Composable
fun ReversiScope.ConfirmationPopUp(title: String, message: String, onConfirmText: String = "Confirm", onDismissText: String = "Cancel", onConfirm: () -> Unit? = null, onDismiss: () -> Unit? = null, modifier: Modifier = Modifier)

Modal popup for confirming user actions.

Link copied to clipboard
@Composable
fun ReversiScope.CoreConfigSection(coreConfig: CoreConfig, onConfigChange: (CoreConfig) -> Unit)
Link copied to clipboard
@Composable
fun ReversiScope.CriticalMessageDialog(error: ReversiException?, modifier: Modifier = Modifier, setError: (Exception?, ErrorType?) -> Unit)
Link copied to clipboard
@Composable
fun ReversiScope.DrawBoard(target: Boolean, gameState: GameState, modifier: Modifier = Modifier, freeze: Boolean = false, getAvailablePlays: () -> List<Coordinate>, onCellClick: (coordinate: Coordinate) -> Unit)

Composable rendering the interactive Reversi game board. Displays the grid, pieces, and available moves (if target mode is enabled). Handles user clicks for piece placement with click blocking during animations.

Link copied to clipboard
@Composable
fun ReversiScope.DrawPlayerInfo(player: Player)
Link copied to clipboard
@Composable
fun ReversiScope.Empty(buttonRefresh: @Composable () -> Unit = {})

Composable displaying an empty state for the lobby when no saved games are available. Shows a game icon and prompts the user to create a new game.

Link copied to clipboard
@Composable
fun ReversiScope.ErrorMessage(error: ReversiException?, modifier: Modifier = Modifier, setError: (Exception?, ErrorType?) -> Unit)

Composable that displays an error message based on the error type.

Link copied to clipboard
@Composable
fun ReversiScope.ErrorMessageDialog(error: ReversiException?, modifier: Modifier = Modifier, setError: (Exception?, ErrorType?) -> Unit)
Link copied to clipboard
@Composable
fun ReversiScope.GameCard(game: LobbyLoadedState, enabled: Boolean, cardData: CardStatus, modifier: Modifier = Modifier, onClick: () -> Unit)
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.

Link copied to clipboard
@Composable
fun ReversiScope.GameSection(playerName: String?, onValueChange: (String) -> Unit)
Link copied to clipboard

Retrieves the current application state.

Link copied to clipboard

Retrieves the current application theme.

Link copied to clipboard
@Composable
fun ReversiScope.Grid(target: Boolean, gameState: GameState, modifier: Modifier = Modifier, freeze: Boolean = false, getAvailablePlays: () -> List<Coordinate>, onCellClick: (coordinate: Coordinate) -> Unit)

Renders the board grid with cells, pieces, and animated indicators for valid moves. Supports animation feedback for available moves in target mode.

Link copied to clipboard
@Composable
private fun ReversiScope.HeaderBadge(statusText: String, statusColor: Color, name: String)
Link copied to clipboard
@Composable
fun ReversiScope.Loading(modifier: Modifier = Modifier)

Loading overlay composable displaying a circular progress indicator with loading message. Covers the entire screen with a semi-transparent overlay and prevents user interaction.

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.

Link copied to clipboard
@Composable
fun ReversiScope.MainMenu(viewModel: MainMenuViewModel, modifier: Modifier = Modifier, onLeave: () -> Unit, isTestMode: Boolean = false)

Main menu screen showing navigation options. Handles menu audio playback and navigation callbacks to other pages.

Link copied to clipboard
@Composable
private fun ReversiScope.MissingPlayerRow(type: PieceType)
Link copied to clipboard
@Composable
fun ReversiScope.NewGamePage(viewModel: NewGameViewModel, playerNameChange: (String) -> Unit, onLeave: () -> Unit)

New game page for creating a local game with piece selection. Allows the user to choose their piece color and start a new game.

Link copied to clipboard
@Composable
private fun ReversiScope.NewGamePageView(modifier: Modifier, onClick: (Game, Int, String?) -> Unit)

Shared UI for new game page with piece selection and game initiation. Provides input fields for game name, player name, board size, and a dropdown menu for piece selection.

Link copied to clipboard
@Composable
fun ReversiScope.PageIndicators(total: Int, current: Int)
Link copied to clipboard
@Composable
fun ReversiScope.PassButton(modifier: Modifier = Modifier, canPass: Boolean, freeze: Boolean, onClick: () -> Unit)

Button to pass the current player's turn.

Link copied to clipboard
@Composable
private fun ReversiScope.PlayerNamesInGameBadge(players: MatchPlayers)
Link copied to clipboard
@Composable
fun ReversiScope.PlayerResultColumn(player: Player, isWinner: Boolean, modifier: Modifier = Modifier)
Link copied to clipboard
@Composable
private fun ReversiScope.PlayerScoreRow(player: Player, points: Int, isTurn: Boolean, isWinner: Boolean, modifier: Modifier = Modifier)
Link copied to clipboard
@Composable
fun ReversiScope.PopupPickAPiece(pieces: List<PieceType>, onPick: (PieceType) -> Unit, onDismiss: () -> Unit = {})

Modal popup for selecting a piece color before joining a multiplayer game. Displays available pieces as interactive circular buttons with visual feedback.

Link copied to clipboard
@Composable
fun ReversiScope.PreviousPage(onBack: () -> Unit)

Back navigation button with hover animation and scaling effects. Includes smooth transitions for scale and offset when hovering.

Link copied to clipboard
@Composable
fun ReversiScope.ReversiButton(text: String, modifier: Modifier = Modifier, enabled: Boolean = true, shape: RoundedCornerShape = RoundedCornerShape(20.dp), border: BorderStroke? = null, onClick: () -> Unit)

Themed button component using the application's primary color. Supports custom shapes, borders, and disabled state styling.

Link copied to clipboard
@Composable
fun ReversiScope.ReversiCheckbox(checked: Boolean, onCheckedChange: (Boolean) -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true)

Themed checkbox component following the application's design system.

Link copied to clipboard
@Composable
fun ReversiScope.ReversiDropDownMenu(expanded: Boolean, onDismissRequest: () -> Unit, modifier: Modifier = Modifier, content: @Composable ReversiScope.() -> Unit)

Themed dropdown menu with application color scheme. Provides a container for dropdown menu items with consistent styling.

Link copied to clipboard
@Composable
fun ReversiScope.ReversiDropdownMenuItem(text: String, onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true)

Themed dropdown menu item for use within ReversiDropDownMenu. Provides consistent styling for menu options.

Link copied to clipboard
@Composable
fun ReversiScope.ReversiText(text: String, color: Color = getTheme().textColor, autoSize: TextAutoSize? = null, fontSize: TextUnit = TextUnit.Unspecified, modifier: Modifier = Modifier, fontWeight: FontWeight? = null, maxLines: Int = 1, softWrap: Boolean = false, fontStyle: FontStyle = FontStyle.Normal, textAlign: TextAlign = TextAlign.Start, overflow: TextOverflow = TextOverflow.Ellipsis)

Themed text composable following the application's color scheme. Supports auto-sizing and various text styling options.

Link copied to clipboard
@Composable
fun ReversiScope.ReversiTextField(value: String = "", onValueChange: (String) -> Unit = {}, placeholder: @Composable () -> Unit = {}, label: @Composable () -> Unit = {}, singleLine: Boolean = true, modifier: Modifier = Modifier, onDone: () -> Unit = {}, enabled: Boolean = true)

Themed text input field following the application's design system. Supports placeholder, label, and single/multi-line modes.

Link copied to clipboard
@Composable
fun ReversiScope.ScaffoldView(setError: (Exception?, ErrorType?) -> Unit, backgroundTopBar: Color = Color.Transparent, error: ReversiException?, isLoading: Boolean = false, title: String = "", loadingModifier: Modifier = Modifier, previousPageContent: @Composable ReversiScope.() -> Unit, content: @Composable ReversiScope.(paddingValues: PaddingValues) -> Unit)

Main scaffold composable providing consistent layout structure for pages. Includes top app bar with title and navigation, content area, and error handling.

Link copied to clipboard
@Composable
private fun ReversiScope.ScoreItem(type: PieceType, score: Int, pieceTestTag: String, scoreTestTag: String)
Link copied to clipboard
@Composable
private fun ReversiScope.ScorePanel(modifier: Modifier = Modifier, board: Board, scorePainelTestTag: String)
Link copied to clipboard
@Composable
fun ReversiScope.Search(search: String, onValueChange: (String) -> Unit)
Link copied to clipboard
@Composable
fun ReversiScope.SettingsPage(viewModel: SettingsViewModel, onLeave: () -> Unit)

Settings page displaying configuration options including player name, storage, audio, and theme. Provides apply action to persist changes and navigate back.

Link copied to clipboard
@Composable
fun ReversiScope.SettingsSection(title: String, modifier: Modifier = Modifier, content: @Composable ColumnScope.() -> Unit)

Section header composable for organizing settings into logical groups. Displays a title and divider line with the section content below.

Link copied to clipboard
@Composable
private fun ReversiScope.StatusBadge(text: String, color: Color, modifier: Modifier = Modifier)
Link copied to clipboard
@Composable
fun ReversiScope.TargetButton(target: Boolean, modifier: Modifier = Modifier, freeze: Boolean, onClick: () -> Unit)

Toggle button for target mode, showing available moves on the board. Displays "Target ON" or "Target OFF" based on the current state.

Link copied to clipboard
@Composable
fun ReversiScope.TextPlayersScore(state: GameState?)
Link copied to clipboard
@Composable
fun ReversiScope.ToastMessage(error: ReversiException?, modifier: Modifier = Modifier, setError: (Exception?, ErrorType?) -> Unit)

Composable that shows a toast message for errors. The message is displayed for 2 seconds before being cleared.

Link copied to clipboard
@Composable
fun ReversiScope.WarningMessage(error: ReversiException?, modifier: Modifier = Modifier, setError: (Exception?, ErrorType?) -> Unit)
Link copied to clipboard
@Composable
fun ReversiScope.WinnerPage(viewModel: WinnerPageViewModel, onLeave: () -> Unit)