class TableDataViewModel: ViewModel()
Variables
Values that are altered on the CreateTableScreen() and used on the GameTableScreen() in the playing of the game
private val _startingChips = mutableIntStateOf(1000)
val startingChips: State<Int> = _startingChips
private val _bigBlind = mutableIntStateOf(10)
val bigBlind: State<Int> = _bigBlind
private val _smallBlind = mutableIntStateOf(5)
val smallBlind: State<Int> = _smallBlindTableDataViewModel Variables
| Variable | Data Type | Description | Validation |
|---|---|---|---|
players | Players | Manages players: List<Player> with helper functions to perform mass operations on all players or operations on individual players using a playerID. | This is immutable and therefore will never change, although there are variables held within this object that are mutable. |
tableConfig | TableConfig | Manages TableConfig.startingChips, TableConfig.bigBlind and TableConfig.smallBlind with helper functions. | This is immutable and therefore will never change, although there are variables held within this object that are mutable. |
currentTableBet | Int | Stores the current bet that all players must match. This variable observes the state of Players.highestBet, mirroring its current value. | This variable cannot be reassigned and only changes if Players.highestBet changes. |
tablePots | TablePots | Manages a TablePots.mainPot and TablePots.sidePots with helper functions, and calculates the TablePots.currentPot. | This is immutable and therefore will never change, although there are variables held within this object that are mutable. |
_bettingRound | MutableState<BettingRound> | Available only within TableConfig, stores the current betting round (e.g. Flop, River, Turn). | The only changes that can occur to this variable are managed by validated helper functions within the TableDataViewModel, to ensure that only the correct data type is given. |
bettingRound | State<BettingRound> | Mirrors the state of _bettingRound, but in an immutable form. | This variable cannot be reassigned and only changes when _bettingRound changes, which can only be changed by functions within the TableDataViewModel. |