AppViewModel

Constructors

Link copied to clipboard
constructor(app: Application)

Properties

Link copied to clipboard

0..1 — how hot the arcade game is running; warms the backdrop.

Link copied to clipboard

Medals and unlocks waiting to be celebrated, oldest first.

Link copied to clipboard

True while playing a locked game's single demo attempt — nothing is recorded.

Link copied to clipboard

True when the latest navigation went deeper, used to pick the transition direction.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var match: Match?
Link copied to clipboard

Bumped whenever the app loses focus; running games (Blocks) pause on it.

Link copied to clipboard

A session waiting to be picked up by the screen being opened (Blocks, Hive).

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val settings: StateFlow<Settings>
Link copied to clipboard
val stats: StateFlow<StatsData>
Link copied to clipboard

Functions

Link copied to clipboard
open fun addCloseable(closeable: AutoCloseable)
fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
fun addProfile(name: String, color: Long): Profile
Link copied to clipboard
fun back(): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun <T : Application> getApplication(): T
Link copied to clipboard
Link copied to clipboard
fun go(screen: Screen)
Link copied to clipboard
fun hostLan(me: Profile, size: Int)
Link copied to clipboard
fun hostLudo()
Link copied to clipboard
fun joinLan(me: Profile, host: LanHost)
Link copied to clipboard
fun joinLanByCode(me: Profile, code: String, alias: String? = null): Boolean

Join by a typed session code; returns false if the code doesn't decode.

Link copied to clipboard
fun joinLudo(address: String, port: Int, alias: String)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Called when the app goes to the background: pause, and save whatever is in progress.

Link copied to clipboard

Opens an unlocked arcade game straight from its celebration.

Link copied to clipboard
Link copied to clipboard

Swap the lobby for the table once a game exists.

Link copied to clipboard
open override fun play(sfx: Sfx)
Link copied to clipboard
open override fun record(result: MatchResult)
Link copied to clipboard
fun registerSaver(s: () -> SavedSession??)
Link copied to clipboard
Link copied to clipboard
fun resume()

Picks up the last unfinished game exactly where it was left.

Link copied to clipboard
open override fun send(message: LanMessage)
Link copied to clipboard

Opens a locked arcade game for its one free try. The attempt is spent immediately.

Link copied to clipboard
fun startLocal(x: Profile, o: Profile, size: Int)
Link copied to clipboard
fun startSolo(difficulty: Difficulty, size: Int)
Link copied to clipboard
fun tapSound()
Link copied to clipboard
fun updateSettings(transform: (Settings) -> Settings)