summaryrefslogtreecommitdiff
path: root/protocol/src/simple_bots.rs
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2023-01-07 16:23:56 -0500
committerKjetil Orbekk <kj@orbekk.com>2023-01-07 16:23:56 -0500
commit1f52e2e448b464e95530cab9e1b7d9177ada3279 (patch)
tree9290facc77bfb77b078e973e325f2e3d62216464 /protocol/src/simple_bots.rs
parent0f7dacea15d6e22123c3290c52515a772fc7ee92 (diff)
Add dealer and vulnerability to the Deal struct
Diffstat (limited to 'protocol/src/simple_bots.rs')
-rw-r--r--protocol/src/simple_bots.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/protocol/src/simple_bots.rs b/protocol/src/simple_bots.rs
index 3df50fb..ce2fdec 100644
--- a/protocol/src/simple_bots.rs
+++ b/protocol/src/simple_bots.rs
@@ -50,7 +50,7 @@ mod tests {
bridge_engine::SUIT_DISPLAY_ORDER,
card::RankOrder,
contract::{Contract, ContractLevel, ContractModifier, LevelAndSuit},
- core::{Deal, Player},
+ core::{Deal, Player, Vulnerability},
move_result::MoveResult,
};
use std::str::FromStr;
@@ -115,6 +115,8 @@ mod tests {
fn example_deal() -> Deal {
Deal {
+ dealer: Player::North,
+ vulnerability: Vulnerability::None,
west: mkcards("♠Q ♠9 ♠5 ♠2 ♥K ♥J ♥4 ♣5 ♣4 ♣2 ♦10 ♦5 ♦3"),
north: mkcards("♠A ♠8 ♠7 ♠6 ♥A ♥9 ♥5 ♥3 ♣9 ♣3 ♦Q ♦J ♦9"),
east: mkcards("♠K ♠3 ♥Q ♥10 ♥8 ♥7 ♣K ♣Q ♣J ♣10 ♣6 ♦A ♦4"),
@@ -134,7 +136,7 @@ mod tests {
modifier: ContractModifier::Doubled,
};
let bidding = Bidding {
- dealer: random(),
+ dealer: deal.dealer,
bids: vec![Bid::Raise(raise1c), Bid::Pass, Bid::Pass, Bid::Pass],
};
PlayState::new(deal, contract, bidding)
@@ -143,11 +145,11 @@ mod tests {
#[tokio::test]
async fn always_passing_bot_passes() {
crate::tests::test_setup();
- let dealer = random();
+ let deal: Deal = random();
+ let dealer = deal.dealer;
let player_position = random();
let bidding_state = BiddingState {
- dealer,
- deal: random(),
+ deal,
bidding: Bidding::new(dealer),
};
let player_view = BiddingStatePlayerView::from_bidding_state(