Пример #1
0
 def _selectGuildCards(self):
     """Randomly select a number of guild cards base on number of players, and put them into Age III card list."""
     all_guild_cards = utils.getCardsOfType(self._all_cards, card_lib.GuildCard)
     random.shuffle(all_guild_cards)
     num_guild_cards_to_select = utils.getNumGuildCards(self.getNumPlayers())
     selected_guild_cards = all_guild_cards[:num_guild_cards_to_select]
     self._age3_cards.extend(selected_guild_cards)
Пример #2
0
 def testGetCardsOfType(self):
   input_cards = self._makeTestCards()
   output_cards = utils.getCardsOfType(input_cards, card.CivilCard)
   self.assertEqual(1, len(output_cards))
   self.assertEqual(output_cards[0], input_cards[1])
Пример #3
0
 def assetFilter(self, player):
   return utils.getCardsOfType(player.cards, self.card_type)
Пример #4
0
 def testGetCardsOfTypeNoMatch(self):
   input_cards = self._makeTestCards()
   output_cards = utils.getCardsOfType(input_cards, card.ScienceCard)
   self.assertEqual([], output_cards)