summaryrefslogtreecommitdiffstats
path: root/src/client/view.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/client/view.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/client/view.rs b/src/client/view.rs
index 77efec6..903403c 100644
--- a/src/client/view.rs
+++ b/src/client/view.rs
@@ -241,9 +241,26 @@ impl CrashView {
241 } 241 }
242} 242}
243 243
244/// The lobby: who is logged in, the balance, and what can be played.
245#[derive(Debug, Clone, PartialEq, Eq)]
246pub struct LobbyView {
247 pub connected: bool,
248 pub user: Option<String>,
249 pub balance: Option<i64>,
250 pub games: Vec<(String, String)>,
251}
252
253/// The play log, already parsed.
254#[derive(Debug, Clone, PartialEq)]
255pub struct HistoryView {
256 pub records: Vec<crate::history::PlayRecord>,
257}
258
244/// Everything a frontend can draw. 259/// Everything a frontend can draw.
245#[derive(Debug, Clone, PartialEq)] 260#[derive(Debug, Clone, PartialEq)]
246pub enum View { 261pub enum View {
262 Lobby(LobbyView),
263 History(HistoryView),
247 Slots(SlotsView), 264 Slots(SlotsView),
248 Roulette(RouletteView), 265 Roulette(RouletteView),
249 Blackjack(BlackjackView), 266 Blackjack(BlackjackView),
@@ -253,6 +270,10 @@ pub enum View {
253/// Semantic input. Frontends turn keys and clicks into these. 270/// Semantic input. Frontends turn keys and clicks into these.
254#[derive(Debug, Clone, PartialEq, Eq)] 271#[derive(Debug, Clone, PartialEq, Eq)]
255pub enum Command { 272pub enum Command {
273 Play { game: String, bet: Option<u64> },
274 History { limit: u32 },
275 ShowLobby,
276 Logout,
256 SetBet(u64), 277 SetBet(u64),
257 AdjustBet(i64), 278 AdjustBet(i64),
258 Leave, 279 Leave,