From 96eaa6555ae44e30b3784576a6ecd0941523691f Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Thu, 23 Dec 2021 15:47:13 +0100 Subject: Add required annotations to make sure mypy succeeds Signed-off-by: Olivier Gayot --- swiftstory/game.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'swiftstory/game.py') diff --git a/swiftstory/game.py b/swiftstory/game.py index cda3ddd..20ac726 100644 --- a/swiftstory/game.py +++ b/swiftstory/game.py @@ -1,4 +1,5 @@ import random +from typing import Optional from swiftstory.exception import WrongAction, JoinError from swiftstory.player import Player @@ -19,7 +20,7 @@ class Game: self.players = [] - self.judge = None + self.judge: Optional[Player] = None self.board = Board() self.board.white_pick = white_pick @@ -101,6 +102,8 @@ class Game: self.board.play_card(player, card) + if self.judge is None: + raise ValueError("There is no judge") self.judge.register_notification({'op': 'card_played'}) return success({'card_id': card_id}) -- cgit v1.2.3