示例#1
0
文件: fan.py 项目: shlomif/PySolFC
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     if from_stack not in self.game.s.rows:
         return False
     if self.game.draw_done or not from_stack._canDrawCard():
         return False
     return True
示例#2
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     # must be neighbours
     if not self.game.isNeighbour(from_stack, self):
         return False
     # must be able to move our card to the foundations or reserves
     return self._getDropStack() is not None
示例#3
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     # must be neighbours
     if not self.game.isNeighbour(from_stack, self):
         return False
     # must be able to move our card to the foundations or reserves
     return self._getDropStack() is not None
示例#4
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     if from_stack not in self.game.s.rows:
         return False
     if self.game.draw_done or not from_stack._canDrawCard():
         return False
     return True
示例#5
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     c = cards[0]
     if c.rank not in self.ACCEPTED_CARDS:
         return False
     for s in self.game.s.reserves:
         if s.cards and s.cards[0].rank == c.rank:
             return False
     return True
示例#6
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     c = cards[0]
     if c.rank not in self.ACCEPTED_CARDS:
         return False
     for s in self.game.s.reserves:
         if s.cards and s.cards[0].rank == c.rank:
             return False
     return True
示例#7
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     r_ranks = []
     for r in self.game.s.reserves:
         if r.cards:
             r_ranks.append(r.cards[0].rank)
     if not r_ranks:
         return True
     r_ranks.append(cards[0].rank)
     r_ranks.sort()
     if len(r_ranks) == 2:
         return r_ranks[1]-r_ranks[0] in (1, 12)
     for i in range(3):
         j, k = (i+1) % 3, (i+2) % 3
         if ((r_ranks[i]+1) % 13 == r_ranks[j] and
                 (r_ranks[j]+1) % 13 == r_ranks[k]):
             return True
     return False
示例#8
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     r_ranks = []
     for r in self.game.s.reserves:
         if r.cards:
             r_ranks.append(r.cards[0].rank)
     if not r_ranks:
         return True
     r_ranks.append(cards[0].rank)
     r_ranks.sort()
     if len(r_ranks) == 2:
         return r_ranks[1]-r_ranks[0] in (1, 12)
     for i in range(3):
         j, k = (i+1) % 3, (i+2) % 3
         if ((r_ranks[i]+1) % 13 == r_ranks[j] and
                 (r_ranks[j]+1) % 13 == r_ranks[k]):
             return True
     return False
示例#9
0
 def acceptsCards(self, from_stack, cards):
     #         if from_stack.id >= 8:
     #             # from_stack must be a Napoleon_RowStack
     #             return False
     return ReserveStack.acceptsCards(self, from_stack, cards)
 def acceptsCards(self, from_stack, cards):
     if from_stack is self.game.s.braid or from_stack in self.game.s.rows:
         return 0
     return ReserveStack.acceptsCards(self, from_stack, cards)
示例#11
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return 0
     # Only take Wizards
     return cards[0].suit == 4
示例#12
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     return from_stack is self.game.s.talon
示例#13
0
文件: pegged.py 项目: jimsize/PySolFC
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return 0
     return self._getMiddleStack(from_stack) is not None
示例#14
0
文件: zodiac.py 项目: shlomif/PySolFC
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     if from_stack in self.game.s.rows:
         return False
     return True
示例#15
0
 def acceptsCards(self, from_stack, cards):
     if (from_stack is self.game.s.braidstrong
             or from_stack is self.game.s.braidweak
             or from_stack in self.game.s.rows):
         return 0
     return ReserveStack.acceptsCards(self, from_stack, cards)
示例#16
0
文件: mughal.py 项目: jimsize/PySolFC
 def acceptsCards(self, from_stack, cards):
     return (ReserveStack.acceptsCards(self, from_stack, cards) and
             self.game.s.talon.cards)
示例#17
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return 0
     return self._getMiddleStack(from_stack) is not None
示例#18
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     # must be neighbours
     return self.game.isNeighbour(from_stack, self)
示例#19
0
文件: mughal.py 项目: jimsize/PySolFC
 def acceptsCards(self, from_stack, cards):
     if (from_stack is self.game.s.braidstrong or
             from_stack is self.game.s.braidweak or
             from_stack in self.game.s.rows):
         return 0
     return ReserveStack.acceptsCards(self, from_stack, cards)
示例#20
0
文件: braid.py 项目: shlomif/PySolFC
 def acceptsCards(self, from_stack, cards):
     if from_stack is self.game.s.braid or from_stack in self.game.s.rows:
         return False
     return ReserveStack.acceptsCards(self, from_stack, cards)
示例#21
0
 def acceptsCards(self, from_stack, cards):
     return (ReserveStack.acceptsCards(self, from_stack, cards)
             and self.game.s.talon.cards)
示例#22
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     return len(self.cards) == 0
示例#23
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     return len(self.cards) == 0
示例#24
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     if from_stack in self.game.s.rows:
         return False
     return True
示例#25
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     # this stack accepts one card from the Waste pile
     return from_stack is self.game.s.waste
示例#26
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     # must be neighbours
     return self.game.isNeighbour(from_stack, self)
示例#27
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     return from_stack is self.game.s.talon
示例#28
0
 def acceptsCards(self, from_stack, cards):
     #         if from_stack.id >= 8:
     #             # from_stack must be a Napoleon_RowStack
     #             return False
     return ReserveStack.acceptsCards(self, from_stack, cards)