Add 'loss' to game outcomes in case nothing else has been found
This commit is contained in:
parent
38cd891b5b
commit
d238c3b67e
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue