Some refactoring, sorting out a few bugs and fix rules

This commit is contained in:
Jannes Höke
2016-03-07 23:50:39 +01:00
parent 14c4f0732b
commit 7c100bc5ba
4 changed files with 158 additions and 83 deletions

View File

@ -85,6 +85,9 @@ class Player(object):
self.bluffing = bool(len(playable) - 1)
if len(self.cards) == 1 and self.cards[0].special == c.DRAW_FOUR:
return list()
return playable
def card_playable(self, card, playable):
@ -97,7 +100,6 @@ class Player(object):
is_playable = False
if last.value == c.DRAW_TWO and not \
(card.value == c.DRAW_TWO or
card.special == c.DRAW_FOUR or
not self.game.draw_counter):
self.logger.debug("Player has to draw and can't counter")
is_playable = False