summaryrefslogtreecommitdiff
path: root/server/src/play.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/play.rs')
-rw-r--r--server/src/play.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/server/src/play.rs b/server/src/play.rs
index 9ea2f42..17d5819 100644
--- a/server/src/play.rs
+++ b/server/src/play.rs
@@ -114,6 +114,13 @@ impl<J: Journal> Table<J> {
Ok(game)
}
+ async fn bid(&mut self, bid: Bid) -> Result<(), BridgeError> {
+ let game = self.game.clone().bid(bid)?;
+ self.journal.append(self.journal.next(), json!(game)).await?;
+ self.game = game;
+ Ok(())
+ }
+
pub async fn replay(mut journal: J) -> Result<Self, BridgeError> {
let games = journal.replay(0).await?;
if games.is_empty() {