summaryrefslogtreecommitdiff
path: root/protocol/src/bot.rs
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2022-12-22 08:31:35 -0500
committerKjetil Orbekk <kj@orbekk.com>2022-12-22 08:31:35 -0500
commit42f6ef6d44e893b47e5e2a49496b5dd2122df232 (patch)
treedff2f84bbc41295b27deb2397071cb16bb742058 /protocol/src/bot.rs
parent10ecb9e30568bf20287b053a620252d7a80dbd6b (diff)
Add a simple bot that plays random (legal) cards
- Leads random cards - Follows suit if possible
Diffstat (limited to 'protocol/src/bot.rs')
-rw-r--r--protocol/src/bot.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/protocol/src/bot.rs b/protocol/src/bot.rs
index cc676df..250731e 100644
--- a/protocol/src/bot.rs
+++ b/protocol/src/bot.rs
@@ -1,6 +1,6 @@
use async_trait::async_trait;
-use crate::{bridge_engine::{BiddingStatePlayerView, Bid}, card::Card};
+use crate::{bridge_engine::{BiddingStatePlayerView, Bid, PlayStatePlayerView}, card::Card};
#[async_trait]
pub trait BiddingBot {
@@ -9,7 +9,7 @@ pub trait BiddingBot {
#[async_trait]
pub trait PlayingBot {
- async fn play(&self) -> Card {
- todo!()
- }
+ // TODO: May need a PlayStateBotView here to expose past cards played,
+ // to avoid the need for stateful bots.
+ async fn play(&self, play_state: &PlayStatePlayerView) -> Card;
}