diff options
author | Olivier Gayot <olivier.gayot@sigexec.com> | 2020-05-15 00:37:30 +0200 |
---|---|---|
committer | Olivier Gayot <olivier.gayot@sigexec.com> | 2020-05-15 02:47:20 +0200 |
commit | 1d59a8683fa5847ccdd40b65c7bfdce5073b6a25 (patch) | |
tree | 3062c935aba0f3beaec98ebf81a1f388c7d54c24 /swiftstory/Game.py | |
parent | d01091afabaeb2665fa8773ccd37cc437230c9eb (diff) |
Don't use getters and setters because it's Python
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
Diffstat (limited to 'swiftstory/Game.py')
-rw-r--r-- | swiftstory/Game.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/swiftstory/Game.py b/swiftstory/Game.py index 9885182..ee1fd86 100644 --- a/swiftstory/Game.py +++ b/swiftstory/Game.py @@ -42,8 +42,8 @@ class Game: for card in cards: player.receive_card(card) - client.set_player(player) - client.set_game(self) + client.player = player + client.game = self self.players.append(player) @@ -86,7 +86,7 @@ class Game: if self.judge is player: return error('You\'re the judge, you silly') - elif player.get_has_played(): + elif player.has_played: return error('You already played, you dumb ass') try: @@ -94,7 +94,7 @@ class Game: except IndexError: return error('Invalid card id') - player.set_has_played() + player.has_played = True self.board.play_card(player, card) @@ -147,7 +147,7 @@ class Game: # reset the state of the players for p in self.players: - if p.get_has_played(): + 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] @@ -161,7 +161,7 @@ class Game: }, }, }) - p.set_has_played(False) + p.has_played = False self.board.recycle_black_card() self.judge = None @@ -228,7 +228,7 @@ class Game: }, }, }) - p.set_has_played(False) + p.has_played = False self.board.played_cards = [] self.state = self.WAITING_NEW_JUDGE |