Ejemplo n.º 1
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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 13
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
Ejemplo n.º 14
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
Ejemplo n.º 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)
Ejemplo n.º 16
0
 def acceptsCards(self, from_stack, cards):
     return (ReserveStack.acceptsCards(self, from_stack, cards) and
             self.game.s.talon.cards)
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 19
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)
Ejemplo n.º 20
0
 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)
Ejemplo n.º 21
0
 def acceptsCards(self, from_stack, cards):
     return (ReserveStack.acceptsCards(self, from_stack, cards)
             and self.game.s.talon.cards)
Ejemplo n.º 22
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     return len(self.cards) == 0
Ejemplo n.º 23
0
 def acceptsCards(self, from_stack, cards):
     if not ReserveStack.acceptsCards(self, from_stack, cards):
         return False
     return len(self.cards) == 0
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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)