From 6a11eedc3df00c88bdf5fcb004f2afd4fa3dc49f Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Thu, 22 Sep 2022 09:18:28 -0400 Subject: Rename bridge_engine names for consistency --- webapp/src/components/game.rs | 10 +++++----- webapp/src/components/trick_in_play.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'webapp/src/components') diff --git a/webapp/src/components/game.rs b/webapp/src/components/game.rs index accdd33..91b3022 100644 --- a/webapp/src/components/game.rs +++ b/webapp/src/components/game.rs @@ -1,4 +1,4 @@ -use crate::bridge_engine::{self, Contract, Player, PlayingDeal, PlayingDealResult}; +use crate::bridge_engine::{self, Contract, Player, DealInPlay, DealInPlayResult}; use crate::card; use crate::card::Deal; use crate::card::Suit; @@ -20,7 +20,7 @@ enum GameState { _bidding: bridge_engine::Bidding, }, Play { - playing_deal: PlayingDeal, + playing_deal: DealInPlay, contract: Contract, bidding: bridge_engine::Bidding, }, @@ -72,12 +72,12 @@ pub fn game() -> Html { info!("Card clicked: {}", card); match playing_deal.play(card) { Err(err) => error!("Could not play card: {:?}", err), - Ok(PlayingDealResult::InProgress(playing_deal)) => state.set(GameState::Play { + Ok(DealInPlayResult::InProgress(playing_deal)) => state.set(GameState::Play { playing_deal, contract, bidding, }), - Ok(PlayingDealResult::PlayFinished(tricks)) => todo!(), + Ok(DealInPlayResult::PlayFinished(tricks)) => todo!(), }; } }) @@ -92,7 +92,7 @@ pub fn game() -> Html { Callback::from(move |(contract, bidding)| { state.set(match contract { Some(contract) => GameState::Play { - playing_deal: PlayingDeal::new(dealer, deal.clone()), + playing_deal: DealInPlay::new(dealer, deal.clone()), contract, bidding, }, diff --git a/webapp/src/components/trick_in_play.rs b/webapp/src/components/trick_in_play.rs index 086a422..c034d20 100644 --- a/webapp/src/components/trick_in_play.rs +++ b/webapp/src/components/trick_in_play.rs @@ -1,5 +1,5 @@ use yew::prelude::*; -use crate::bridge_engine::PlayTurn; +use crate::bridge_engine::TurnInPlay; use crate::components::Card; #[function_component(TrickInPlay)] @@ -19,5 +19,5 @@ html! { #[derive(PartialEq, Properties, Clone)] pub struct TrickInPlayProps { - pub in_progress: PlayTurn, + pub in_progress: TurnInPlay, } -- cgit v1.2.3