stash.add_card arguments reordered

This commit is contained in:
Jakub Senderák
2020-03-27 15:17:58 +01:00
parent 38bf52c867
commit 5098a1aa9a
2 changed files with 26 additions and 26 deletions
+3 -3
View File
@@ -94,7 +94,7 @@ class Series():
pass
class Round():
def __init__(self, round_number: int, first_player: int, cards: [], shuffler = shuffle):
def __init__(self, round_number: int, first_player: int, cards: []=cards, shuffler = shuffle):
# vyrob kopku pre toto kolo a priprav prazdne objekty
if not 0 <= round_number < 8:
raise BridzikException('Round number has to be between 0 and 7.')
@@ -140,7 +140,7 @@ class Round():
raise BridzikException('Musi zahrat farbu.')
self.player_cards[player] = [c for c in self.player_cards[player] if c != card]
self.get_last_stash().add_card(card, player)
self.get_last_stash().add_card(player, card)
if self.get_last_stash().is_completed() and not self.is_completed():
self.start_new_stash()
@@ -201,7 +201,7 @@ class Stash():
self._cards = {}
self.first_player = first_player
def add_card(self, card: Card, player: int):
def add_card(self, player: int, card: Card):
if player not in [0, 1, 2, 3]:
raise BridzikException('Cislo hraca musi byt 0, 1, 2 alebo 3.')
if player in self._cards: