本文整理汇总了Python中card.Card.getImage方法的典型用法代码示例。如果您正苦于以下问题:Python Card.getImage方法的具体用法?Python Card.getImage怎么用?Python Card.getImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类card.Card
的用法示例。
在下文中一共展示了Card.getImage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _hit
# 需要导入模块: from card import Card [as 别名]
# 或者: from card.Card import getImage [as 别名]
def _hit(self, cards):
card = cards.draw()
Dealer.cards.append(card)
Dealer.values.append(cards.getValue())
_print('Dealer hits.', 'magenta')
_print('Dealer gets ' + card, 'magenta')
return Card(Card.getImage(Dealer.cards[2]), 400, 10)
示例2: receiveCards
# 需要导入模块: from card import Card [as 别名]
# 或者: from card.Card import getImage [as 别名]
def receiveCards(self, player_cards):
cards = ''
for card in player_cards:
cv = card.split(':')
Player.cards.append(cv[0])
Player.values.append(int(cv[1]))
cards += Player.cards[0] + Player.cards[1]
_print('Player receives their cards:', 'magenta')
_print('{0} --> {1}'.format(cards, self.calcTotal()), '')
Player.index += 1
cardA = Card(Card.getImage(Player.cards[Player.index]), Player.position, 350)
Player.index += 1
Player.position += 90
cardB = Card(Card.getImage(Player.cards[Player.index]), Player.position, 350)
return cardA, cardB
示例3: receiveCards
# 需要导入模块: from card import Card [as 别名]
# 或者: from card.Card import getImage [as 别名]
def receiveCards():
Dealer.index += 1
cardA = Card('bc.png', Dealer.position, 10)
Dealer.index += 1
Dealer.position += 90
cardB = Card(Card.getImage(Dealer.cards[Dealer.index]), Dealer.position, 10)
print(Dealer.index)
print(Dealer.position)
return cardA, cardB
示例4: revealFirstCard
# 需要导入模块: from card import Card [as 别名]
# 或者: from card.Card import getImage [as 别名]
def revealFirstCard():
return Card(Card.getImage(Dealer.cards[0]), 225, 10)