コード例 #1
0
 def testDistributeOneCardsFromDeckTo3Stacks(self):
   stacks = [cards.StackOfCards(), cards.StackOfCards(), cards.StackOfCards()]
   cards.distributeCards(self.deck, stacks, 1)
   self.assertEquals(2, self.deck.height())
   self.assertEquals(1, stacks[0].height())
   self.assertEquals(1, stacks[1].height())
   self.assertEquals(1, stacks[2].height())
コード例 #2
0
 def distributeCardsToAllPlayers(self, amount):
     cards.distributeCards(self.deck, self.playersCards.values(), amount)
コード例 #3
0
 def execute(self, round):
   round.deck.shuffle()
   round.distributeCardsToAllPlayers(11)
   cards.distributeCards(round.deck, round.deads, 11)
コード例 #4
0
 def testDistributeThreeCardsFromDeckTo2Stacks(self):
   stacks = [cards.StackOfCards(), cards.StackOfCards()]
   cards.distributeCards(self.deck, stacks, 3)
   self.assertEquals(0, self.deck.height())
   self.assertEquals(3, stacks[0].height())
   self.assertEquals(2, stacks[1].height())