diff options
author | Kjetil Orbekk <kj@orbekk.com> | 2022-12-22 19:15:54 -0500 |
---|---|---|
committer | Kjetil Orbekk <kj@orbekk.com> | 2022-12-22 19:15:54 -0500 |
commit | 93faa3894907508933a43173d829b15fd32cbc44 (patch) | |
tree | 60be90199b26c3c91ddb6a8d75a756aed5d25cc2 | |
parent | 58aa2e4764f90528270ae5b9a61de576260e5483 (diff) |
Add server code to send the player view of a playing game
-rw-r--r-- | protocol/src/bridge_engine.rs | 7 | ||||
-rw-r--r-- | 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! { <p>{"Loading table"}</p> }, }; html! { <> - <>{ format!("This is table {}", props.table.id) }</p> + <p>{ format!("This is table {}", props.table.id) }</p> <button onclick={leave_table}> { "Leave table" } </button> |