当前位置: 首页>>代码示例>>Python>>正文


Python Card.getImage方法代码示例

本文整理汇总了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)
开发者ID:stpettersens,项目名称:21,代码行数:10,代码来源:dealer.py

示例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
开发者ID:stpettersens,项目名称:21,代码行数:23,代码来源:player.py

示例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
开发者ID:stpettersens,项目名称:21,代码行数:16,代码来源:dealer.py

示例4: revealFirstCard

# 需要导入模块: from card import Card [as 别名]
# 或者: from card.Card import getImage [as 别名]
	def revealFirstCard():
		return Card(Card.getImage(Dealer.cards[0]), 225, 10)
开发者ID:stpettersens,项目名称:21,代码行数:4,代码来源:dealer.py


注:本文中的card.Card.getImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。