Round - input valdation fix
This commit is contained in:
@@ -96,8 +96,10 @@ class Series():
|
||||
class Round():
|
||||
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.')
|
||||
if round_number not in [i for i in range(8)]:
|
||||
raise BridzikException('Neplatne cislo kola.')
|
||||
if first_player not in [0, 1, 2, 3]:
|
||||
raise BridzikException('Cislo hraca musi byt 0, 1, 2 alebo 3.')
|
||||
self.round_number = round_number
|
||||
self.first_player = first_player
|
||||
self.deal_starting_cards(cards, shuffler)
|
||||
|
||||
Reference in New Issue
Block a user