def __init__(self, victoryPoints, coasts, earnings, photo): self.__imagePath = photo self.__victoryPoints = int(victoryPoints) self.__coasts = pocket.Pocket() self.__earnings = pocket.Pocket() self.__image = None self.__smal_image = None for i in coasts: self.__coasts.push(coin.Coin(i['name'], int(i['count']))) for i in earnings: self.__earnings.push(coin.Coin(i['name'], int(i['count'])))
def test_get_all_coins(self): testing_object = pocket.Pocket() mook = MookCoin('aa', 1) testing_object.push(mook) self.assertEqual(testing_object.get_all_coins(), [mook]) mook2 = MookCoin('bb', 2) testing_object.push(mook2) self.assertEqual(testing_object.get_all_coins(), [mook, mook2])
def __init__(self, name): self.__name = name self.__victory_points = 0 self.__lords = [] self.__pocket = pocket.Pocket() self.__cards = {} for i in ['diamond', 'emerald', 'sapphire', 'onyx', 'ruby', 'gold']: self.__pocket.push(coin.Coin(i, 0)) self.__cards[i] = []
def __init__(self): self.__decks = {} self.__cards = [[]] self.__coins = pocket.Pocket() self.__coins.push(coin.Coin('gold', GOLD_COINS_START_COUNT)) for i in ['diamond', 'emerald', 'sapphire', 'onyx', 'ruby']: self.__coins.push(coin.Coin(i, DESOR_COINS_START_COUNT)) self.__lords = lord_deck.LordsDeck("cards/LordsList.json") for i in [['low', 'cards/LowCrystalList.json'], ['medium', 'cards/MediumCrystalList.json'], ['high', 'cards/HighCrystalList.json']]: self.__decks[i[0]] = card_deck.CrystalCardDeck(i[1]) self.__decks['lords'] = lord_deck.LordsDeck('cards/LordsList.json') for i in range(4): self.__cards[0].append(self.__lords.getNext()) for i in [['high', 1], ['medium', 2], ['low', 3]]: self.__cards.append([]) for j in range(4): self.__cards[i[1]].append(self.__decks[i[0]].getNext())
def test_get_count(self): testing_object = pocket.Pocket() self.assertEqual(testing_object.coins_count(), 0) for i in range(4): testing_object.push(MookCoin('aa', 2)) self.assertEqual(testing_object.coins_count(), 4)
def test_constructor(self): testing_object = pocket.Pocket() self.assertEqual(testing_object.get_all_coins(), [])