本文整理汇总了Python中pirates.piratesbase.PLocalizer.getPlayingCardName方法的典型用法代码示例。如果您正苦于以下问题:Python PLocalizer.getPlayingCardName方法的具体用法?Python PLocalizer.getPlayingCardName怎么用?Python PLocalizer.getPlayingCardName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pirates.piratesbase.PLocalizer
的用法示例。
在下文中一共展示了PLocalizer.getPlayingCardName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getCardName
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import getPlayingCardName [as 别名]
def getCardName(value):
if value == Unknown:
return PLocalizer.PlayingCardUnknown
else:
rank = value % 13
suit = value / 13
return PLocalizer.getPlayingCardName(suit, rank)
示例2: cardRankSelection
# 需要导入模块: from pirates.piratesbase import PLocalizer [as 别名]
# 或者: from pirates.piratesbase.PLocalizer import getPlayingCardName [as 别名]
def cardRankSelection(self, rank):
self.rank = rank
card_id = self.suit * 13 + self.rank
self.hideButtonArray(self.suitButtonArray)
self.hideButtonArray(self.rankButtonArray)
self.cancelButton.hide()
self.table.card_id = card_id
suit = card_id / 13
rank = card_id % 13
card = -1
hand = self.table.getLocalAvatarHand()
if hand:
if self.cardSwapIndex == PlayingCardGlobals.Cheat1:
if len(hand) >= 1:
card = hand[0]
if self.cardSwapIndex == PlayingCardGlobals.Cheat2:
if len(hand) >= 2:
card = hand[1]
if self.cardSwapIndex == PlayingCardGlobals.Cheat7:
if len(hand) >= 7:
card = hand[6]
if card >= 0 and card < 52:
original_suit = card / 13
original_rank = card % 13
string = PLocalizer.PokerSwapConfirmMessage % (PLocalizer.getPlayingCardName(original_suit, original_rank), PLocalizer.getPlayingCardName(suit, rank))
self.swapDialog = PDialog.PDialog(text = string, style = OTPDialog.YesNo, giveMouse = False, command = self.swapCallback)
self.table.setDialogBin(self.swapDialog)
position = self.swapDialog.getPos()
position.setZ(position[2] + 0.34999999999999998)
self.swapDialog.setPos(position)