Skip to content

Commit

Permalink
Check if new play can start in the beginning of a new trick
Browse files Browse the repository at this point in the history
  • Loading branch information
FKD13 committed Nov 11, 2020
1 parent 5cc963a commit 2e853b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions game/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ def __ge__(self, other):

def __hash__(self):
return hash(self.suit.get_color()) + hash(self.value)

def __repr__(self):
return self.name
1 change: 1 addition & 0 deletions game/president.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def _get_play_order(self) -> Iterator[Agent]:
self.agent_iterator.next()
# We found the player, but the loop will call next, so we have to call previous to neutralize this.
self.agent_iterator.previous()
continue

yield self.agent_iterator.get()
# The unfinished player comes last, add it to the last_played lis
Expand Down

0 comments on commit 2e853b2

Please sign in to comment.