diff options
Diffstat (limited to 'swiftstory/Game.py')
-rw-r--r-- | swiftstory/Game.py | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/swiftstory/Game.py b/swiftstory/Game.py index 9fc5f17..1282c0e 100644 --- a/swiftstory/Game.py +++ b/swiftstory/Game.py @@ -12,11 +12,8 @@ class Game: WAITING_DESIGNATION = 2, def __init__(self, white_desc, black_desc): - self.white_desc = white_desc - self.black_desc = black_desc - - white_pick = [i for i in enumerate(self.white_desc)] - black_pick = [i for i in enumerate(self.black_desc)] + white_pick = [i for i in enumerate(white_desc)] + black_pick = [i for i in enumerate(black_desc)] self.state = self.WAITING_NEW_JUDGE @@ -155,15 +152,13 @@ class Game: for p in self.players: if p.has_played: idx = p.receive_card(self.board.pick_white_card()) - card_idx = p.cards[idx] - card_desc = self.white_desc[card_idx] await p.send_notification({ 'op': 'received_card', 'content': { 'card': { - 'id': idx, - 'desc': card_desc, + 'id': p.cards[idx][0], + 'desc': p.cards[idx][1], }, }, }) @@ -206,16 +201,14 @@ class Game: await p.send_notification({'op': 'judge_needed'}) for card, p in self.board.played_cards: - idx = p.receive_card(card) - card_idx = p.cards[idx] - card_desc = self.white_desc[card_idx] + p.receive_card(card) await p.send_notification({ 'op': 'received_card', 'content': { 'card': { - 'id': idx, - 'desc': card_desc, + 'id': card[0], + 'desc': card[1], }, }, }) |