當前位置: 首頁>>代碼示例>>Python>>正文


Python BasicRowStack.acceptsCards方法代碼示例

本文整理匯總了Python中pysollib.stack.BasicRowStack.acceptsCards方法的典型用法代碼示例。如果您正苦於以下問題:Python BasicRowStack.acceptsCards方法的具體用法?Python BasicRowStack.acceptsCards怎麽用?Python BasicRowStack.acceptsCards使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pysollib.stack.BasicRowStack的用法示例。


在下文中一共展示了BasicRowStack.acceptsCards方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: acceptsCards

# 需要導入模塊: from pysollib.stack import BasicRowStack [as 別名]
# 或者: from pysollib.stack.BasicRowStack import acceptsCards [as 別名]
 def acceptsCards(self, from_stack, cards):
     if not BasicRowStack.acceptsCards(self, from_stack, cards):
         return False
     if from_stack is self.game.s.talon or \
             from_stack in self.game.s.reserves:
         return True
     return False
開發者ID:shlomif,項目名稱:PySolFC,代碼行數:9,代碼來源:numerica.py

示例2: acceptsCards

# 需要導入模塊: from pysollib.stack import BasicRowStack [as 別名]
# 或者: from pysollib.stack.BasicRowStack import acceptsCards [as 別名]
 def acceptsCards(self, from_stack, cards):
     if not BasicRowStack.acceptsCards(self, from_stack, cards):
         return False
     # check
     if self.cards or self.game.s.talon.cards:
         return False
     return True
開發者ID:shlomif,項目名稱:PySolFC,代碼行數:9,代碼來源:picturegallery.py

示例3: acceptsCards

# 需要導入模塊: from pysollib.stack import BasicRowStack [as 別名]
# 或者: from pysollib.stack.BasicRowStack import acceptsCards [as 別名]
 def acceptsCards(self, from_stack, cards):
     if not BasicRowStack.acceptsCards(self, from_stack, cards):
         return False
     if self.id % self.game.RSTEP == 0:
         return cards[0].rank == self.game.RBASE
     left = self.game.s.rows[self.id - 1]
     return left.cards and left.cards[-1].rank + 1 == cards[0].rank
開發者ID:jimsize,項目名稱:PySolFC,代碼行數:9,代碼來源:montana.py

示例4: acceptsCards

# 需要導入模塊: from pysollib.stack import BasicRowStack [as 別名]
# 或者: from pysollib.stack.BasicRowStack import acceptsCards [as 別名]
 def acceptsCards(self, from_stack, cards):
     if not BasicRowStack.acceptsCards(self, from_stack, cards):
         return False
     if not self.cards:
         return True
     c1, c2 = self.cards[-1], cards[0]
     if c1.rank == c2.rank+1:
         return True
     return c1.rank == c2.rank
開發者ID:shlomif,項目名稱:PySolFC,代碼行數:11,代碼來源:curdsandwhey.py

示例5: acceptsCards

# 需要導入模塊: from pysollib.stack import BasicRowStack [as 別名]
# 或者: from pysollib.stack.BasicRowStack import acceptsCards [as 別名]
 def acceptsCards(self, from_stack, cards):
     if not BasicRowStack.acceptsCards(self, from_stack, cards):
         return False
     if self.cards:
         # check the rank - an ACE equals a Six
         rank = self.cards[-1].rank
         if rank == ACE:
             rank = 5
         if (rank + self.cap.dir) % self.cap.mod != cards[0].rank:
             return False
     return True
開發者ID:jimsize,項目名稱:PySolFC,代碼行數:13,代碼來源:gypsy.py

示例6: acceptsCards

# 需要導入模塊: from pysollib.stack import BasicRowStack [as 別名]
# 或者: from pysollib.stack.BasicRowStack import acceptsCards [as 別名]
 def acceptsCards(self, from_stack, cards):
     if not BasicRowStack.acceptsCards(self, from_stack, cards):
         return False
     if self.id % 10 != 0:
         # left neighbour
         s = self.game.s.rows[self.id - 1]
         if s.cards and s.cards[-1].suit == cards[0].suit \
                 and (s.cards[-1].rank + 1) % 13 == cards[0].rank:
             return True
     if self.id % 10 != 10 - 1:
         # right neighbour
         s = self.game.s.rows[self.id + 1]
         if s.cards and s.cards[-1].suit == cards[0].suit \
                 and (s.cards[-1].rank - 1) % 13 == cards[0].rank:
             return True
     return False
開發者ID:shlomif,項目名稱:PySolFC,代碼行數:18,代碼來源:siebenbisas.py

示例7: acceptsCards

# 需要導入模塊: from pysollib.stack import BasicRowStack [as 別名]
# 或者: from pysollib.stack.BasicRowStack import acceptsCards [as 別名]
 def acceptsCards(self, from_stack, cards):
     if not BasicRowStack.acceptsCards(self, from_stack, cards):
         return False
     # this stack accepts any one card from the Waste pile
     return from_stack is self.game.s.waste
開發者ID:jimsize,項目名稱:PySolFC,代碼行數:7,代碼來源:camelot.py

示例8: acceptsCards

# 需要導入模塊: from pysollib.stack import BasicRowStack [as 別名]
# 或者: from pysollib.stack.BasicRowStack import acceptsCards [as 別名]
 def acceptsCards(self, from_stack, cards):
     if not BasicRowStack.acceptsCards(self, from_stack, cards):
         return 0
     # check
     return not (self.cards or self.game.s.talon.cards)
開發者ID:jimsize,項目名稱:PySolFC,代碼行數:7,代碼來源:mughal.py

示例9: acceptsCards

# 需要導入模塊: from pysollib.stack import BasicRowStack [as 別名]
# 或者: from pysollib.stack.BasicRowStack import acceptsCards [as 別名]
 def acceptsCards(self, from_stack, cards):
     if not BasicRowStack.acceptsCards(self, from_stack, cards):
         return False
     return len(self.cards) == 0
開發者ID:shlomif,項目名稱:PySolFC,代碼行數:6,代碼來源:royalcotillion.py

示例10: acceptsCards

# 需要導入模塊: from pysollib.stack import BasicRowStack [as 別名]
# 或者: from pysollib.stack.BasicRowStack import acceptsCards [as 別名]
 def acceptsCards(self, from_stack, cards):
     if not BasicRowStack.acceptsCards(self, from_stack, cards):
         return 0
     if not self.cards:
         return 1
     return self.cards[-1].rank > cards[0].rank
開發者ID:shlomif,項目名稱:PySolFC,代碼行數:8,代碼來源:hanoi.py

示例11: acceptsCards

# 需要導入模塊: from pysollib.stack import BasicRowStack [as 別名]
# 或者: from pysollib.stack.BasicRowStack import acceptsCards [as 別名]
 def acceptsCards(self, from_stack, cards):
     if not BasicRowStack.acceptsCards(self, from_stack, cards):
         return False
     # this stack accepts any one card from the Talon
     return from_stack is self.game.s.talon and len(cards) == 1
開發者ID:jimsize,項目名稱:PySolFC,代碼行數:7,代碼來源:auldlangsyne.py


注:本文中的pysollib.stack.BasicRowStack.acceptsCards方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。