本文整理汇总了Python中pysollib.stack.SS_FoundationStack.acceptsCards方法的典型用法代码示例。如果您正苦于以下问题:Python SS_FoundationStack.acceptsCards方法的具体用法?Python SS_FoundationStack.acceptsCards怎么用?Python SS_FoundationStack.acceptsCards使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pysollib.stack.SS_FoundationStack
的用法示例。
在下文中一共展示了SS_FoundationStack.acceptsCards方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: acceptsCards
# 需要导入模块: from pysollib.stack import SS_FoundationStack [as 别名]
# 或者: from pysollib.stack.SS_FoundationStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if cards is None:
# special hack for _getDropStack() below
return SS_FoundationStack.acceptsCards(
self, from_stack, from_stack.cards)
#
if not SS_FoundationStack.acceptsCards(self, from_stack, cards):
return False
# We only accept cards from a Reserve. Other cards will get
# delivered by _handlePairMove.
return from_stack in self.game.s.reserves
示例2: acceptsCards
# 需要导入模块: from pysollib.stack import SS_FoundationStack [as 别名]
# 或者: from pysollib.stack.SS_FoundationStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not SS_FoundationStack.acceptsCards(self, from_stack, cards):
return False
if self.cards:
# check suit
return self.cards[-1].suit == cards[0].suit
return True
示例3: acceptsCards
# 需要导入模块: from pysollib.stack import SS_FoundationStack [as 别名]
# 或者: from pysollib.stack.SS_FoundationStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not SS_FoundationStack.acceptsCards(self, from_stack, cards):
return False
if from_stack in self.game.s.rows:
if len(self.game.s.talon.cards) == 0:
return True
return self.game.num_dealled <= 0
return True
示例4: acceptsCards
# 需要导入模块: from pysollib.stack import SS_FoundationStack [as 别名]
# 或者: from pysollib.stack.SS_FoundationStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not SS_FoundationStack.acceptsCards(self, from_stack, cards):
return False
if not self.cards:
for s in self.game.s.foundations:
if s.cards:
return cards[0].rank == s.cards[0].rank
return True
示例5: acceptsCards
# 需要导入模块: from pysollib.stack import SS_FoundationStack [as 别名]
# 或者: from pysollib.stack.SS_FoundationStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if self.game.getState() == 0:
if len(cards) != 1 or not cards[0].face_up:
return False
if cards[0].suit != self.cap.base_suit:
return False
return from_stack in self.game.s.rows
return SS_FoundationStack.acceptsCards(self, from_stack, cards)
示例6: acceptsCards
# 需要导入模块: from pysollib.stack import SS_FoundationStack [as 别名]
# 或者: from pysollib.stack.SS_FoundationStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not SS_FoundationStack.acceptsCards(self, from_stack, cards):
return False
if self.cards:
# check the color
if cards[0].color != self.cards[-1].color:
return False
return True
示例7: acceptsCards
# 需要导入模块: from pysollib.stack import SS_FoundationStack [as 别名]
# 或者: from pysollib.stack.SS_FoundationStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not SS_FoundationStack.acceptsCards(self, from_stack, cards):
return False
if from_stack in self.game.s.reserves:
return True
for r in self.game.s.reserves:
if not r.cards:
return True
return False
示例8: acceptsCards
# 需要导入模块: from pysollib.stack import SS_FoundationStack [as 别名]
# 或者: from pysollib.stack.SS_FoundationStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not SS_FoundationStack.acceptsCards(self, from_stack, cards):
return False
# this stack accepts only a card from a rowstack with an empty
# left neighbour
if from_stack not in self.game.s.rows:
return False
if from_stack.id % 10 == 0:
return False
return len(self.game.s.rows[from_stack.id - 1].cards) == 0
示例9: acceptsCards
# 需要导入模块: from pysollib.stack import SS_FoundationStack [as 别名]
# 或者: from pysollib.stack.SS_FoundationStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not SS_FoundationStack.acceptsCards(self, from_stack, cards):
return False
if self.game.s.talon.round == 1:
if (self.cap.base_rank == KING and
from_stack in self.game.s.rows[6:10:]):
return False
if (self.cap.base_rank == ACE and
from_stack in self.game.s.rows[:4]):
return False
return True
示例10: acceptsCards
# 需要导入模块: from pysollib.stack import SS_FoundationStack [as 别名]
# 或者: from pysollib.stack.SS_FoundationStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not SS_FoundationStack.acceptsCards(self, from_stack, cards):
return False
# we only accept cards if there are no cards in the talon
return len(self.game.s.talon.cards) == 0
示例11: acceptsCards
# 需要导入模块: from pysollib.stack import SS_FoundationStack [as 别名]
# 或者: from pysollib.stack.SS_FoundationStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not SS_FoundationStack.acceptsCards(self, from_stack, cards):
return False
if self.game.s.waste.cards or self.game.s.talon.cards:
return False
return True
示例12: acceptsCards
# 需要导入模块: from pysollib.stack import SS_FoundationStack [as 别名]
# 或者: from pysollib.stack.SS_FoundationStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not SS_FoundationStack.acceptsCards(self, from_stack, cards):
return False
index = list(self.game.s.foundations).index(self)
index %= 8
return len(self.game.s.foundations[index].cards) > 0
示例13: acceptsCards
# 需要导入模块: from pysollib.stack import SS_FoundationStack [as 别名]
# 或者: from pysollib.stack.SS_FoundationStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not SS_FoundationStack.acceptsCards(self, from_stack, cards):
return 0
return cards[-1].rank < len(self.game.s.foundations[4].cards)
示例14: acceptsCards
# 需要导入模块: from pysollib.stack import SS_FoundationStack [as 别名]
# 或者: from pysollib.stack.SS_FoundationStack import acceptsCards [as 别名]
def acceptsCards(self, from_stack, cards):
if not SS_FoundationStack.acceptsCards(self, from_stack, cards):
return False
if from_stack in self.game.s.rows[:8]:
return True
return False