本文整理汇总了Python中Deck.Deck.checkSet方法的典型用法代码示例。如果您正苦于以下问题:Python Deck.checkSet方法的具体用法?Python Deck.checkSet怎么用?Python Deck.checkSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Deck.Deck
的用法示例。
在下文中一共展示了Deck.checkSet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkIfSetOnBoard
# 需要导入模块: from Deck import Deck [as 别名]
# 或者: from Deck.Deck import checkSet [as 别名]
def checkIfSetOnBoard(self, obj):
'''Called when a button is pressed, checks if there is a set.
If there is one, then refill the display cards'''
down = self.selected()
if not len(down) == 3:
return
if Deck.checkSet(self.cards[down[0]],
self.cards[down[1]],
self.cards[down[2]]):
if App.get_running_app().music.soundActivated:
# Taken from: http://www.freesound.org/people/lukechalaudio/sounds/151568/
sound = SoundLoader.load("music/" + "151568__lukechalaudio__user-interface-generic" + ".wav")
sound.loop = False
sound.play()
# We send the selection in case the player unselects a card before
# self.foundCorrect is found
self.stopRotation()
Clock.schedule_once(lambda arg: self.foundCorrect(down=down), 2)
else: # The cards were not a set
self.unselectAll()