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


Python SS_FoundationStack.acceptsCards方法代码示例

本文整理汇总了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
开发者ID:jimsize,项目名称:PySolFC,代码行数:13,代码来源:montecarlo.py

示例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
开发者ID:jimsize,项目名称:PySolFC,代码行数:9,代码来源:gypsy.py

示例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
开发者ID:jimsize,项目名称:PySolFC,代码行数:10,代码来源:camelot.py

示例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
开发者ID:shlomif,项目名称:PySolFC,代码行数:10,代码来源:beleagueredcastle.py

示例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)
开发者ID:shlomif,项目名称:PySolFC,代码行数:10,代码来源:terrace.py

示例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
开发者ID:shlomif,项目名称:PySolFC,代码行数:10,代码来源:numerica.py

示例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
开发者ID:shlomif,项目名称:PySolFC,代码行数:11,代码来源:katzenschwanz.py

示例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
开发者ID:shlomif,项目名称:PySolFC,代码行数:12,代码来源:siebenbisas.py

示例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
开发者ID:shlomif,项目名称:PySolFC,代码行数:13,代码来源:sthelena.py

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

示例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
开发者ID:shlomif,项目名称:PySolFC,代码行数:8,代码来源:zodiac.py

示例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
开发者ID:shlomif,项目名称:PySolFC,代码行数:8,代码来源:sultan.py

示例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)
开发者ID:shlomif,项目名称:PySolFC,代码行数:6,代码来源:tarock.py

示例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
开发者ID:shlomif,项目名称:PySolFC,代码行数:8,代码来源:royalcotillion.py


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