本文整理汇总了Python中pysollib.stack.AC_RowStack.acceptsCards方法的典型用法代码示例。如果您正苦于以下问题:Python AC_RowStack.acceptsCards方法的具体用法?Python AC_RowStack.acceptsCards怎么用?Python AC_RowStack.acceptsCards使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pysollib.stack.AC_RowStack
的用法示例。
在下文中一共展示了AC_RowStack.acceptsCards方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: acceptsCards
# 需要导入模块: from pysollib.stack import AC_RowStack [as 别名]
# 或者: from pysollib.stack.AC_RowStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not AC_RowStack.acceptsCards(self, from_stack, cards):
return False
if not self.cards:
return (from_stack is self.game.s.talon or
from_stack in self.game.s.reserves)
return True
示例2: acceptsCards
# 需要导入模块: from pysollib.stack import AC_RowStack [as 别名]
# 或者: from pysollib.stack.AC_RowStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not AC_RowStack.acceptsCards(self, from_stack, cards):
return False
if (from_stack in self.game.s.reserves or
from_stack in self.game.s.foundations):
return False
return True
示例3: acceptsCards
# 需要导入模块: from pysollib.stack import AC_RowStack [as 别名]
# 或者: from pysollib.stack.AC_RowStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not self.basicAcceptsCards(from_stack, cards):
return 0
stackcards = self.cards
if stackcards:
if (stackcards[-1].suit == 4 or cards[0].suit == 4):
return stackcards[-1].rank == cards[0].rank + 1
return AC_RowStack.acceptsCards(self, from_stack, cards)
示例4: acceptsCards
# 需要导入模块: from pysollib.stack import AC_RowStack [as 别名]
# 或者: from pysollib.stack.AC_RowStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not AC_RowStack.acceptsCards(self, from_stack, cards):
return False
if not self.cards and from_stack is self.game.s.waste:
for stack in self.game.s.reserves:
if stack.cards:
return False
return True
if from_stack in self.game.s.rows and \
len(cards) != len(from_stack.cards):
return False
return True
示例5: acceptsCards
# 需要导入模块: from pysollib.stack import AC_RowStack [as 别名]
# 或者: from pysollib.stack.AC_RowStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if self.game.getState() == 0:
return False
if from_stack in self.game.s.reserves:
return False
return AC_RowStack.acceptsCards(self, from_stack, cards)
示例6: acceptsCards
# 需要导入模块: from pysollib.stack import AC_RowStack [as 别名]
# 或者: from pysollib.stack.AC_RowStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not AC_RowStack.acceptsCards(self, from_stack, cards):
return False
# Note that this reserve stack accepts sequences if both
# the reserve stack and the Talon are empty.
return len(self.cards) == 0 and len(self.game.s.talon.cards) == 0
示例7: acceptsCards
# 需要导入模块: from pysollib.stack import AC_RowStack [as 别名]
# 或者: from pysollib.stack.AC_RowStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if self.cards and not self.cards[-1].face_up:
return True
return AC_RowStack.acceptsCards(self, from_stack, cards)
示例8: acceptsCards
# 需要导入模块: from pysollib.stack import AC_RowStack [as 别名]
# 或者: from pysollib.stack.AC_RowStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not AC_RowStack.acceptsCards(self, from_stack, cards):
return False
if from_stack in self.game.s.reserves:
return False
return True
示例9: acceptsCards
# 需要导入模块: from pysollib.stack import AC_RowStack [as 别名]
# 或者: from pysollib.stack.AC_RowStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not AC_RowStack.acceptsCards(self, from_stack, cards):
return False
return BritishConstitution_RowStackMethods.acceptsCards(
self, from_stack, cards)