Exemplo n.º 1
0
 def test_init_five_victory_point_cards(self):
     deck = DevelopmentCardDeck()
     road_building_cards = [
         card for card in deck.cards
         if isinstance(card, VictoryPointDevelopmentCard)
     ]
     assert len(road_building_cards) == 5
Exemplo n.º 2
0
 def test_init_two_road_building_cards(self):
     deck = DevelopmentCardDeck()
     road_building_cards = [
         card for card in deck.cards
         if isinstance(card, RoadBuildingDevelopmentCard)
     ]
     assert len(road_building_cards) == 2
Exemplo n.º 3
0
 def test_init_two_year_of_plenty_cards(self):
     deck = DevelopmentCardDeck()
     year_of_plenty_cards = [
         card for card in deck.cards
         if isinstance(card, YearOfPlentyDevelopmentCard)
     ]
     assert len(year_of_plenty_cards) == 2
Exemplo n.º 4
0
 def test_init_two_monopoloy_cards(self):
     deck = DevelopmentCardDeck()
     monopoly_cards = [
         card for card in deck.cards
         if isinstance(card, MonopolyDevelopmentCard)
     ]
     assert len(monopoly_cards) == 2
Exemplo n.º 5
0
 def test_init_fourteen_knight_cards(self):
     deck = DevelopmentCardDeck()
     knight_cards = [
         card for card in deck.cards
         if isinstance(card, KnightDevelopmentCard)
     ]
     assert len(knight_cards) == 14
Exemplo n.º 6
0
    def __init__(self, players=[]):
        # There should be 19 of each resource type.
        self.resource_card_deck = ResourceCardDeck()

        # Shuffle the development card deck.
        self.development_card_deck = DevelopmentCardDeck()

        # Create the board.
        self.board = Board()

        self.players = players.copy()
        random.shuffle(self.players)

        self.current_player_turn = self.players[0]

        self.dice_rolled = False

        self.player_pieces = {}
        self.bonus_victory_points = {}
        self.player_hand = {}
        for player in self.players:
            # Each player gets 15 roads, 5 settlements, and 4 cities.
            self.player_pieces[player] = {"roads": 15, "settlements": 5, "cities": 4}

            # Bonus victory points
            self.bonus_victory_points[player] = {
                "victory_point_development_cards": 0,
                "longest_road": False,
                "largest_army": False,
            }

            self.player_hand[player] = PlayerHand(player=player)
Exemplo n.º 7
0
 def test_init_list_of_development_cards(self):
     deck = DevelopmentCardDeck()
     assert hasattr(deck, "cards")
Exemplo n.º 8
0
 def test_draw_card_from_deck(self):
     deck = DevelopmentCardDeck()
     previous_count = len(deck.cards)
     deck.draw()
     new_count = len(deck.cards)
     assert previous_count == new_count + 1