Package-level declarations

Types

Link copied to clipboard
data class AppState(val gameSession: GameSession, val pagesState: PagesState, val audioThemeState: AudioThemeState, val serviceC: GameServiceImpl = gameSession.game.service) : AppStateImpl

Represents the overall state of the Reversi application.

Link copied to clipboard
interface AppStateImpl

Interface defining the contract for application state implementations. Provides read-only access to game session data, page navigation state, audio/theme settings, and game services.

Link copied to clipboard
data class AudioThemeState(val audioPool: AudioPool, val theme: AppTheme)

Holds audio and theme configuration for the application.

Link copied to clipboard
data class GameSession(val game: Game, val playerName: String?)

Represents the current game session with game state and player identity.

Link copied to clipboard
data class PagesState(val page: Page, val backPage: Page, val globalError: ReversiException?)

Holds the current page navigation state and any global errors.

Link copied to clipboard
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.

Functions

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

Retrieves the current application state.

Link copied to clipboard

Retrieves the AudioPool from the current AppState.

Link copied to clipboard

Retrieves the current application theme.

Link copied to clipboard
fun Color.invert(): Color
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
Link copied to clipboard
fun <T : UiState> MutableState<T>.setError(error: Exception?, type: ErrorType = ErrorType.CRITICAL)

Updates the error state for any UiState implementation.

Link copied to clipboard
fun MutableState<GameSession>.setGame(game: Game)

Sets the game state.

Link copied to clipboard
fun MutableState<PagesState>.setGlobalError(error: Exception?, type: ErrorType? = ErrorType.CRITICAL)
Link copied to clipboard
fun <T : UiState> MutableState<T>.setLoading(isLoading: Boolean)

Updates the loading state for any UiState implementation.

Link copied to clipboard
fun MutableState<PagesState>.setPage(page: Page, backPage: Page? = null)

Updates the current page in the application state. The backPage is auto-calculated if not provided. If there is a global error != null or INFO, the page will not be changed. IF the global error is of type INFO, it will be cleared.

Link copied to clipboard
fun MutableState<GameSession>.setPlayerName(name: String?)

Sets the player name in the game session.

Link copied to clipboard
fun MutableState<AudioThemeState>.setTheme(theme: AppTheme)

Sets the application theme in the audio theme state.

Link copied to clipboard