From 42f6ef6d44e893b47e5e2a49496b5dd2122df232 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Thu, 22 Dec 2022 08:31:35 -0500 Subject: Add a simple bot that plays random (legal) cards - Leads random cards - Follows suit if possible --- protocol/src/bot.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'protocol/src/bot.rs') 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; } -- cgit v1.2.3