From 331272cca245709d857a236e00e62664e8c91c4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Wed, 9 Oct 2024 17:47:19 +0200 Subject: [PATCH] HanabGame: add option to terminate game with action --- src/hanabi/hanab_game.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hanabi/hanab_game.py b/src/hanabi/hanab_game.py index 8bf9bed..151a6c8 100644 --- a/src/hanabi/hanab_game.py +++ b/src/hanabi/hanab_game.py @@ -267,8 +267,13 @@ class GameState: case ActionType.Discard: self.discard(action.target) case ActionType.EndGame | ActionType.VoteTerminate: + self.actions.append(action) self.over = True + def terminate(self): + action = Action(ActionType.EndGame, 0, 0) + self.make_action(action) + # Forward some properties of the underlying instance @property def num_players(self):