feat: set blind bet by run hands

This commit is contained in:
qianrui.mmmy
2026-05-13 14:29:21 +08:00
parent e22586aa2f
commit 09c42e9fa3
5 changed files with 188 additions and 7 deletions
+21 -2
View File
@@ -62,10 +62,29 @@ class GameManager:
with self._lock:
return [game.to_dict() for game in self._games.values()]
def run_hands(self, game_id: str, count: int = 1, until_one_left: bool = False) -> list[dict[str, object]]:
def run_hands(
self,
game_id: str,
count: int = 1,
until_one_left: bool = False,
small_blind: int | None = None,
big_blind: int | None = None,
) -> list[dict[str, object]]:
"""Run ``count`` hands, optionally raising the blinds first.
``small_blind`` / ``big_blind`` are forwarded to the engine so the
blinds can change between batches. Leaving them as ``None`` keeps
the previously configured level, which preserves the original
no-argument behaviour.
"""
game = self.get_game(game_id)
with self._lock:
return [
summary.to_dict()
for summary in game.run_hands(count, until_one_left=until_one_left)
for summary in game.run_hands(
count,
until_one_left=until_one_left,
small_blind=small_blind,
big_blind=big_blind,
)
]