Esempio n. 1
0
 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
Esempio n. 2
0
 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
Esempio n. 3
0
 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
Esempio n. 4
0
 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
Esempio n. 5
0
 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
Esempio n. 6
0
 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
Esempio n. 7
0
 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
Esempio n. 8
0
 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
Esempio n. 9
0
 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)
Esempio n. 10
0
 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
Esempio n. 11
0
 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
Esempio n. 12
0
 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)
Esempio n. 13
0
 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
Esempio n. 14
0
 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
Esempio n. 15
0
 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
Esempio n. 16
0
 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
Esempio n. 17
0
 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
Esempio n. 18
0
 def acceptsCards(self, from_stack, cards):
     if not SS_FoundationStack.acceptsCards(self, from_stack, cards):
         return False
     if not self.cards:
         return True
     if self.game.s.talon.cards:
         if from_stack in self.game.s.rows[4:]:
             i = list(self.game.s.foundations).index(self)
             j = list(self.game.s.rows).index(from_stack)
             return i == j - 4
     return True
Esempio n. 19
0
 def acceptsCards(self, from_stack, cards):
     if not SS_FoundationStack.acceptsCards(self, from_stack, cards):
         return False
     if not self.cards:
         return True
     if self.game.s.talon.cards:
         if from_stack in self.game.s.rows[4:]:
             i = list(self.game.s.foundations).index(self)
             j = list(self.game.s.rows).index(from_stack)
             return i == j-4
     return True
Esempio n. 20
0
 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)
 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
Esempio n. 22
0
 def acceptsCards(self, from_stack, cards):
     if self.game.getState() == 0:
         if cards[0].suit != self.cap.base_suit:
             return False
         return True
     return SS_FoundationStack.acceptsCards(self, from_stack, cards)
Esempio n. 23
0
 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
Esempio n. 24
0
 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
Esempio n. 25
0
 def acceptsCards(self, from_stack, cards):
     if self.game.getState() == 0:
         if cards[0].suit != self.cap.base_suit:
             return False
         return True
     return SS_FoundationStack.acceptsCards(self, from_stack, cards)
Esempio n. 26
0
 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
Esempio n. 27
0
 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
Esempio n. 28
0
 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)
Esempio n. 29
0
 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
Esempio n. 30
0
 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
Esempio n. 31
0
 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