From d238c3b67e70d52597cfd2060da8a37244320f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler?= Date: Sat, 23 Dec 2023 02:48:35 +0100 Subject: [PATCH] Add 'loss' to game outcomes in case nothing else has been found --- src/stats.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stats.py b/src/stats.py index 45fd037..4950384 100644 --- a/src/stats.py +++ b/src/stats.py @@ -19,6 +19,7 @@ class GameOutcome(aenum.Enum): bottom_deck = 4, 'Bottom Deck' vote_to_kill = 5, 'Vote to Kill' out_of_pace = 6, 'Out of Pace' + loss = 7, 'Loss' class GameAnalysisResult: @@ -71,6 +72,8 @@ def analyze_replay(instance: hanab_game.HanabiInstance, actions: List[hanab_game outcomes.add(GameOutcome.vote_to_kill) if game.score == 5 * instance.num_suits: outcomes.add(GameOutcome.win) + if not outcomes: + outcomes.add(GameOutcome.loss) return GameAnalysisResult(outcomes, bdrs, lost_crits)