feat: set blind bet by run hands
This commit is contained in:
+21
-2
@@ -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,
|
||||
)
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user