From 93faa3894907508933a43173d829b15fd32cbc44 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Thu, 22 Dec 2022 19:15:54 -0500 Subject: Add server code to send the player view of a playing game --- protocol/src/bridge_engine.rs | 7 ++++++- webapp/src/components/table.rs | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/protocol/src/bridge_engine.rs b/protocol/src/bridge_engine.rs index bacee56..bfc2a93 100644 --- a/protocol/src/bridge_engine.rs +++ b/protocol/src/bridge_engine.rs @@ -879,7 +879,12 @@ impl GameStatePlayerView { player_position, ), ), - GameState::Play { .. } => todo!(), + GameState::Play(play_state) => GameStatePlayerView::Playing( + PlayStatePlayerView::from_play_state( + play_state, + player_position, + ), + ), } } diff --git a/webapp/src/components/table.rs b/webapp/src/components/table.rs index 794785f..78a5f91 100644 --- a/webapp/src/components/table.rs +++ b/webapp/src/components/table.rs @@ -88,13 +88,15 @@ pub fn online_table(props: &OnlineTableProps) -> Html { let center = match &*table_state { Some(GameStatePlayerView::Bidding(bidding)) => bidding_view(bidding, on_bid), - Some(GameStatePlayerView::Playing(playing)) => todo!(), + Some(GameStatePlayerView::Playing(playing)) => html! { + {"Need to implement this"} + }, None => html! {

{"Loading table"}

}, }; html! { <> - <>{ format!("This is table {}", props.table.id) }

+

{ format!("This is table {}", props.table.id) }

-- cgit v1.2.3