From 150f0275833a4e0b7800aef6339f89a91125b269 Mon Sep 17 00:00:00 2001 From: Daniel Ledda Date: Tue, 23 Jun 2020 23:55:38 +0200 Subject: [PATCH] idk --- src/Game.py | 4 ++-- src/HumanDecisionInterface.py | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Game.py b/src/Game.py index be74c74..82b4d2a 100644 --- a/src/Game.py +++ b/src/Game.py @@ -99,7 +99,7 @@ class Game: def play_round(self) -> None: self.renderer.render_message("Round {} start!".format(self.round_count)) self.deal_cards() - self.determine_game_type() + self.decide_on_game() self.update_trump_ranking() for i in range(len(self.deck) // Game.PLAYER_COUNT): self.trick_count += 1 @@ -112,7 +112,7 @@ class Game: self.renderer.render_message("{}: {} points.".format(player.get_name(), score)) self.renderer.render_message("Round end!") - def determine_game_type(self) -> None: + def decide_on_game(self) -> None: player_choosing = self.current_player_index player = None for i in range(len(self.players)): diff --git a/src/HumanDecisionInterface.py b/src/HumanDecisionInterface.py index 19d9014..5d30e16 100644 --- a/src/HumanDecisionInterface.py +++ b/src/HumanDecisionInterface.py @@ -47,7 +47,8 @@ class HumanDecisionInterface(DecisionMaker): try: print("Choose a game to play: ") print(", ".join( - ["Pass (1)"] + ["{} ({})".format(round_type.name, i + 1) for i, round_type in enumerate(round_types) + ["Pass (1)"] + ["{} ({})".format(round_type.name, i + 1) + for i, round_type in enumerate(round_types) if round_type is not None])) attempt = int(input(" -> ")) type_choice = round_types[attempt - 1] @@ -62,7 +63,10 @@ class HumanDecisionInterface(DecisionMaker): suit_choice = None while suit_choice is None: try: - suit_types = [suit for suit in Card.Suit] if type_choice != RoundType.Sauspiel else sauspiel_choices + if type_choice == RoundType.Sauspiel: + suit_types = sauspiel_choices + else: + suit_types = [suit for suit in Card.Suit] print("Choose a suit to play with: ") print(", ".join(["{} ({})".format(suit.name, i + 1) for i, suit in enumerate(suit_types)])) attempt = int(input(" -> "))