summaryrefslogtreecommitdiff
path: root/protocol/src/simple_bots.rs
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2022-12-30 09:29:12 -0500
committerKjetil Orbekk <kj@orbekk.com>2022-12-30 09:29:12 -0500
commit83ffcc667999879197508aba0d1f910ca7cb000b (patch)
treef4eb596e5cbd6957f50a642b4e85160db0448969 /protocol/src/simple_bots.rs
parent6b1f611e4ae1c719acd7d0d8dd5716dd0d52b255 (diff)
Populate result after a board is played
Diffstat (limited to 'protocol/src/simple_bots.rs')
-rw-r--r--protocol/src/simple_bots.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/protocol/src/simple_bots.rs b/protocol/src/simple_bots.rs
index ed1cd14..45d1a5b 100644
--- a/protocol/src/simple_bots.rs
+++ b/protocol/src/simple_bots.rs
@@ -46,13 +46,13 @@ impl PlayingBot for RandomPlayingBot {
#[cfg(test)]
mod tests {
use std::str::FromStr;
+ use crate::move_result::MoveResult;
use super::*;
use crate::{
bridge_engine::{
Bidding, BiddingState, BiddingStatePlayerView, Contract,
- ContractLevel, ContractModifier, Deal, PlayState, PlayStateResult,
- Player, Raise,
+ ContractLevel, ContractModifier, Deal, PlayState, Player, Raise,
},
card::Suit,
};
@@ -75,8 +75,8 @@ mod tests {
info!("South state: {south_state:#?}");
let play_state = match play_state.play(card1).unwrap() {
- PlayStateResult::InProgress(p) => p,
- PlayStateResult::PlayFinished(_) => {
+ MoveResult::Current(p) => p,
+ MoveResult::Next(_) => {
panic!("game should not be over")
}
};
@@ -92,8 +92,8 @@ mod tests {
assert_eq!(card1.suit(), card2.suit());
let _play_state = match play_state.play(card2).unwrap() {
- PlayStateResult::InProgress(p) => p,
- PlayStateResult::PlayFinished(_) => {
+ MoveResult::Current(p) => p,
+ MoveResult::Next(_) => {
panic!("game should not be over")
}
};
@@ -159,8 +159,8 @@ mod tests {
async fn play_until_completion() {
crate::tests::test_setup();
let bot = RandomPlayingBot {};
- let mut result = PlayStateResult::InProgress(example_play_state());
- while let PlayStateResult::InProgress(play_state) = result {
+ let mut result = MoveResult::Current(example_play_state());
+ while let MoveResult::Current(play_state) = result {
info!("Play state: {play_state:#?}");
let player_state = PlayStatePlayerView::from_play_state(
&play_state,