hanabi.py: support adding arbitrary clues for nicer replays

This commit is contained in:
Maximilian Keßler 2023-05-06 22:03:23 +02:00
parent 9fe456f0f9
commit 87524addd6
Signed by: max
GPG key ID: BCC5A619923C0BA5

View file

@ -188,7 +188,11 @@ class GameState():
def make_action(self, action):
match action.type:
case ActionType.ColorClue | ActionType.RankClue:
self.clue()
assert(self.clues > 0)
self.actions.append(action)
self.clues -= 1
self.__make_turn()
# TODO: could check that the clue specified is in fact legal
case ActionType.Play:
self.play(action.target)
case ActionType.Discard: