def createGame(self): # create layout l, s = Layout(self), self.s # set window self.setSize(l.XM+10*l.XS, max(l.YM+2*l.YS+12*l.YOFFSET, l.YM+5*l.YS)) # create stacks x = l.XM for i in range(2): y = l.YM+l.YS for j in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=j)) y += l.YS x += l.XS x, y = l.XM+2*l.XS, l.YM for i in range(8): stack = AC_RowStack(x, y, self, max_move=1) stack.getBottomImage = stack._getReserveBottomImage stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, 0 s.rows.append(stack) x += l.XS x, y = l.XM+2*l.XS, l.YM+l.YS for i in range(8): stack = OpenStack(x, y, self, max_accept=0) stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, l.YOFFSET s.reserves.append(stack) x += l.XS s.talon = KingsdownEights_Talon(l.XM, l.YM, self, max_rounds=1) l.createText(s.talon, "se") # define stack-groups l.defaultStackGroups()
def createGame(self, max_rounds=2): l, s = Layout(self), self.s self.setSize(l.XM+8*l.XS, l.YM+4*l.YS) self.base_card = None i = 0 for x, y in ((l.XM, l.YM), (l.XM+7*l.XS, l.YM), (l.XM, l.YM+3*l.YS), (l.XM+7*l.XS, l.YM+3*l.YS), ): s.foundations.append( SS_FoundationStack(x, y, self, suit=i, mod=13)) i += 1 y = l.YM+l.YS for i in range(2): x = l.XM+l.XS for j in range(6): stack = AC_RowStack(x, y, self, max_move=1, mod=13) stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, 0 s.rows.append(stack) x += l.XS y += l.YS x, y = l.XM+3*l.XS, l.YM s.talon = WasteTalonStack(x, y, self, max_rounds=1) l.createText(s.talon, 'sw') x += l.XS s.waste = WasteStack(x, y, self) l.createText(s.waste, 'se') l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM + 8*l.XS, l.YM + 4.5*l.YS) x, y = l.XM, l.YM for i in range(8): s.foundations.append(TheRedAndTheBlack_Foundation(x, y, self, suit=i//2)) x += l.XS x, y = l.XM+2*l.XS, l.YM+l.YS for i in range(4): stack = AC_RowStack(x, y, self, max_move=1) stack.getBottomImage = stack._getReserveBottomImage stack.CARD_YOFFSET = 0 s.rows.append(stack) x += l.XS x, y = l.XM+2*l.XS, l.YM+2*l.YS for i in range(4): s.reserves.append(TheRedAndTheBlack_Reserve(x, y, self)) x += l.XS x, y = l.XM+3*l.XS, l.YM+3.5*l.YS s.talon = WasteTalonStack(x, y, self, max_rounds=1) l.createText(s.talon, "sw") x += l.XS s.waste = WasteStack(x, y, self) l.createText(s.waste, "se") # define stack-groups l.defaultStackGroups()
def moveMove(self, ncards, to_stack, frames=-1, shadow=-1): state = self.game.getState() if state > 0: AC_RowStack.moveMove( self, ncards, to_stack, frames=frames, shadow=shadow) return assert to_stack in self.game.s.foundations assert ncards == 1 assert not self.game.s.waste.cards self.game.moveMove( ncards, self, to_stack, frames=frames, shadow=shadow) for s in self.game.s.foundations: s.cap.base_rank = to_stack.cards[0].rank freerows = [s for s in self.game.s.rows if not s.cards] self.game.s.talon.dealRow(rows=freerows, sound=True) self.game.s.talon.dealCards() # deal first card to WasteStack
def createGame(self, rows=9, max_rounds=1, num_deal=1, playcards=16): l, s = Layout(self), self.s self.setSize(l.XM+8*l.XS, l.YM+3*l.YS+12*l.YOFFSET+l.TEXT_HEIGHT) x, y = l.XM, l.YM s.talon = WasteTalonStack(x, y, self, max_rounds=1) l.createText(s.talon, 's') x += l.XS s.waste = WasteStack(x, y, self) l.createText(s.waste, 's') x += 2*l.XS stack = BastilleDay_BastilleStack(x, y, self) s.reserves.append(stack) l.createText(stack, 's') x += l.XS stack = OpenStack(x, y, self) stack.CARD_XOFFSET = l.XOFFSET l.createText(stack, 's') s.reserves.append(stack) x, y = l.XM, l.YM+l.YS+l.TEXT_HEIGHT for i in range(8): s.foundations.append(SS_FoundationStack(x, y, self, suit=i % 4)) x = x + l.XS x, y = l.XM, l.YM+2*l.YS+l.TEXT_HEIGHT for i in range(8): s.rows.append(AC_RowStack(x, y, self)) x = x + l.XS l.defaultStackGroups()
def createGame(self): # create layout l, s = Layout(self), self.s # set window self.setSize(l.XM + 10.5 * l.XS, l.YM + 2 * l.YS + 20 * l.YOFFSET) # create stacks x, y = l.XM, l.YM + l.YS // 2 for i in (0, 1): stack = ReserveStack(x, y, self, max_cards=4) s.reserves.append(stack) stack.CARD_YOFFSET = l.YOFFSET l.createText(stack, 'n') x += l.XS x, y = l.XM + 2.5 * l.XS, l.YM for i in range(8): s.foundations.append(SS_FoundationStack(x, y, self, suit=i // 2)) x += l.XS x, y = l.XM + 2.5 * l.XS, l.YM + l.YS for i in range(8): s.rows.append(AC_RowStack(x, y, self)) x += l.XS x, y = l.XM, self.height - l.YS s.talon = InitialDealTalonStack(x, y, self) # define stack-groups l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM + 8 * l.XS, l.YM + 2 * l.YS + 12 * l.YOFFSET) x, y = l.XM, l.YM for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i)) s.foundations.append( SS_FoundationStack(x + 4 * l.XS, y, self, suit=i, base_rank=KING, dir=-1)) x += l.XS x, y = l.XM, l.YM + l.YS s.talon = WasteTalonStack(x, y, self, max_rounds=UNLIMITED_REDEALS, num_deal=3) l.createText(s.talon, 'ne') y += l.YS s.waste = WasteStack(x, y, self) l.createText(s.waste, 'ne') x, y = l.XM + 2 * l.XS, l.YM + l.YS for i in range(4): s.rows.append(AC_RowStack(x, y, self, base_rank=6)) x += l.XS x += l.XS stack = OpenStack(x, y, self) s.reserves.append(stack) stack.CARD_YOFFSET = l.YOFFSET l.defaultStackGroups()
def moveMove(self, ncards, to_stack, frames=-1, shadow=-1): state = self.game.getState() if state > 0: AC_RowStack.moveMove( self, ncards, to_stack, frames=frames, shadow=shadow) return assert to_stack in self.game.s.foundations assert ncards == 1 assert not self.game.s.waste.cards self.game.moveMove( ncards, self, to_stack, frames=frames, shadow=shadow) for s in self.game.s.foundations: s.cap.base_rank = to_stack.cards[0].rank freerows = [s for s in self.game.s.rows if not s.cards] self.game.s.talon.dealRow(rows=freerows, sound=True) self.game.s.talon.dealCards() # deal first card to WasteStack
def createGame(self): # create layout l, s = Layout(self), self.s # set window self.setSize(l.XM+9*l.XS, 3*l.YM+5*l.YS) # create stacks x, y = l.XM, l.YM s.talon = Cone_Talon(x, y, self) l.createText(s.talon, 's') y += l.YS+2*l.YM for i in range(4): s.reserves.append(OpenStack(x, y, self, max_accept=0)) y += l.YS x, y = l.XM+l.XS, l.YM for i in range(7): s.rows.append(AC_RowStack(x, y, self, mod=13)) x += l.XS for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i, mod=13, max_cards=26)) y += l.YS # define stack-groups l.defaultStackGroups()
def createGame(self): # create layout l, s = Layout(self), self.s # set window self.setSize(l.XM+9.5*l.XS, l.YM+3*l.YS+l.TEXT_HEIGHT+12*l.YOFFSET) # create stacks x, y = l.XM+1.5*l.XS, l.TEXT_HEIGHT for i in range(8): stack = Leprechaun_Reserve(x, y, self) s.reserves.append(stack) l.createText(stack, 'n') x += l.XS x, y = l.XM+1.5*l.XS, l.YS+l.TEXT_HEIGHT for i in range(8): s.foundations.append(SS_FoundationStack(x, y, self, suit=i//2)) x += l.XS x, y = l.XM+1.5*l.XS, 2*l.YS+l.TEXT_HEIGHT for i in range(8): s.rows.append(AC_RowStack(x, y, self)) x += l.XS s.talon = DealRowTalonStack(l.XM, l.YM, self) l.createText(s.talon, 's') # define stack-groups l.defaultStackGroups()
def createGame(self): # create layout l, s = Layout(self), self.s self.setSize(l.XM + 8 * l.XS, l.YM + 2 * l.YS + 12 * l.YOFFSET) # create stacks x, y = l.XM, self.height - l.YS s.talon = InitialDealTalonStack(x, y, self) x, y = l.XM + l.XS, l.YM for i in range(2): s.reserves.append(ReserveStack(x, y, self)) x += l.XS x += 2 * l.XS for i in range(2): s.foundations.append( AC_FoundationStack(x, y, self, suit=ANY_SUIT, max_cards=26, mod=13, max_move=0)) x += l.XS x, y = l.XM, l.YM + l.YS for i in range(8): s.rows.append(AC_RowStack(x, y, self)) x += l.XS # default l.defaultAll()
def createGame(self, rows=8, reserves=6): l, s = Layout(self), self.s w, h = l.XM + (rows + reserves + 1) * l.XS, l.YM + 3 * l.YS + 16 * l.YOFFSET self.setSize(w, h) x, y = l.XM + (rows + reserves + 1 - 8) * l.XS // 2, l.YM for i in range(8): s.foundations.append(SS_FoundationStack(x, y, self, suit=i % 4)) x += l.XS x, y = l.XM, l.YM + l.YS for i in range(reserves): stack = Headquarters_Reserve(x, y, self, max_cards=UNLIMITED_CARDS, max_accept=UNLIMITED_CARDS, max_move=UNLIMITED_CARDS) s.reserves.append(stack) stack.CARD_YOFFSET = l.YOFFSET x += l.XS x, y = l.XM + (reserves + 1) * l.XS, l.YM + l.YS for j in range(rows): s.rows.append(AC_RowStack(x, y, self, base_rank=NO_RANK)) x += l.XS x, y = w - l.XS, h - l.YS s.talon = InitialDealTalonStack(x, y, self) l.defaultStackGroups()
def acceptsCards(self, from_stack, cards): if not AC_RowStack.acceptsCards(self, from_stack, cards): return False if (from_stack in self.game.s.reserves or from_stack in self.game.s.foundations): return False return True
def acceptsCards(self, from_stack, cards): if not AC_RowStack.acceptsCards(self, from_stack, cards): return False if not self.cards: return (from_stack is self.game.s.talon or from_stack in self.game.s.reserves) return True
def createGame(self, rows=8, reserves=4, playcards=15): decks = self.gameinfo.decks l, s = Layout(self), self.s self.setSize(l.XM+rows*l.XS, l.YM+2*l.YS+playcards*l.YOFFSET) x, y = l.XM, l.YM for i in range(reserves): s.reserves.append(ReserveStack(x, y, self)) x += l.XS x = self.width - 2*l.XS s.foundations.append(FourByFour_Foundation(x, y, self, suit=ANY_SUIT, base_rank=ACE, max_cards=52*decks, max_accept=1, max_move=0)) stack = s.foundations[0] tx, ty, ta, tf = l.getTextAttr(stack, 'ne') font = self.app.getFont('canvas_default') stack.texts.misc = MfxCanvasText(self.canvas, tx, ty, anchor=ta, font=font) x, y = l.XM, l.YM+l.YS for i in range(rows): s.rows.append(AC_RowStack(x, y, self)) x += l.XS x, y = l.XM, self.height-l.YS s.talon = InitialDealTalonStack(x, y, self) l.defaultStackGroups()
def createGame(self, rows=7): # create layout l, s = Layout(self), self.s # set window self.setSize(l.XM + max(8, rows) * l.XS, l.YM + 5 * l.YS) # create stacks for i in range(8): x, y, = l.XM + i * l.XS, l.YM s.foundations.append( DieRussische_Foundation(x, y, self, i // 2, max_move=0, max_cards=8)) for i in range(rows): x, y, = l.XM + (2 * i + 8 - rows) * l.XS // 2, l.YM + l.YS s.rows.append(AC_RowStack(x, y, self)) s.talon = DieBoeseSieben_Talon(l.XM, self.height - l.YS, self, max_rounds=2) l.createText(s.talon, 'ne') l.createRoundText(s.talon, 'se') # define stack-groups l.defaultStackGroups()
def createGame(self): # create layout lay, s = Layout(self), self.s # set window w = max(8 * lay.XS, 6 * lay.XS + 8 * lay.XOFFSET) h = lay.YM + 3 * lay.YS + 12 * lay.YOFFSET self.setSize(w + lay.XM, h) # create stacks y = lay.YM for x in (lay.XM, lay.XM + w - lay.XS - 4 * lay.XOFFSET): stack = OpenStack(x, y, self, max_accept=0) stack.CARD_XOFFSET, stack.CARD_YOFFSET = lay.XOFFSET, 0 s.reserves.append(stack) x, y = lay.XM + (w - 4 * lay.XS) // 2, lay.YM for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i)) x += lay.XS x, y = lay.XM + (w - 8 * lay.XS) // 2, lay.YM + lay.YS for i in range(8): s.rows.append(AC_RowStack(x, y, self)) x += lay.XS s.talon = WasteTalonStack(lay.XM, h - lay.YS, self, max_rounds=1) lay.createText(s.talon, "n") s.waste = WasteStack(lay.XM + lay.XS, h - lay.YS, self) lay.createText(s.waste, "n") # define stack-groups lay.defaultStackGroups()
def createGame(self): reserves = 8 rows = 10 max_rows = max(8, rows, reserves) l, s = Layout(self), self.s self.setSize(l.XM + max_rows * l.XS, l.YM + 4 * l.YS + 12 * l.YOFFSET) s.addattr(reserves2=[]) # register extra stack variables x, y = l.XM + (max_rows - reserves) * l.XS / 2 + l.XS / 2, l.YM for i in range(reserves / 2): stack = Barrier_ReserveStack(x, y, self) s.reserves2.append(stack) l.createText(stack, "ne") x += 2 * l.XS x, y = l.XM + (max_rows - reserves) * l.XS / 2, l.YM + l.YS for i in range(reserves): s.reserves.append(OpenStack(x, y, self)) x += l.XS x, y = l.XM + (max_rows - rows) * l.XS / 2, l.YM + 2 * l.YS for i in range(rows): s.rows.append(AC_RowStack(x, y, self)) x += l.XS x, y = l.XM + (max_rows - 8) * l.XS / 2, self.height - l.YS for i in range(8): s.foundations.append(SS_FoundationStack(x, y, self, suit=i / 2)) x += l.XS x, y = l.XM, self.height - l.YS s.talon = InitialDealTalonStack(x, y, self) l.defaultStackGroups()
def createGame(self, rows=7): l, s = Layout(self), self.s self.setSize(l.XM + 10 * l.XS, l.YM + 3 * l.YS + 12 * l.YOFFSET) y = l.YM for i in range(2): x = l.XM + 2 * l.XS for j in range(8): s.foundations.append( self.Foundation_Class(x, y, self, suit=j % 4)) x += l.XS y += l.YS x, y = l.XM + (10 - rows) * l.XS // 2, l.YM + 2 * l.YS for i in range(rows): s.rows.append(AC_RowStack(x, y, self)) x += l.XS x, y = l.XM, l.YM s.talon = WasteTalonStack(x, y, self, max_rounds=1) l.createText(s.talon, 'ne') y += l.YS s.waste = WasteStack(x, y, self) l.createText(s.waste, 'ne') l.defaultStackGroups()
def createGame(self): # create layout l, s = Layout(self), self.s # set window w, h = l.XM + max(9 * l.XS, 5 * l.XS + 18 * l.XOFFSET), l.YM + 2 * l.YS + 12 * l.YOFFSET self.setSize(w, h) # create stacks x, y = l.XM, l.YM stack = self.ReserveStack_Class(x, y, self) stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0 s.reserves.append(stack) self.setRegion( s.reserves, (-999, -999, w - 4 * l.XS - l.CW / 2, l.YM + l.YS - l.CH / 2)) x = w - 4 * l.XS for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i)) x += l.XS x, y = l.XM + (w - (l.XM + 9 * l.XS)) / 2, l.YM + l.YS for i in range(9): s.rows.append(AC_RowStack(x, y, self, max_move=1)) x += l.XS s.talon = InitialDealTalonStack(w - l.XS, h - l.YS, self) # define stack-groups l.defaultStackGroups()
def createGame(self, rows=8, playcards=16): # create layout l, s = Layout(self), self.s # set window decks = self.gameinfo.decks max_rows = max(8, rows) self.setSize(l.XM + max_rows * l.XS, l.YM + 2 * l.YS + (playcards + 4 * decks) * l.YOFFSET) # create stacks x, y = l.XM + (max_rows - 8) * l.XS / 2, l.YM for i in range(8): stack = Choice_Foundation(x, y, self, base_rank=(i + 5), dir=0, suit=ANY_SUIT, max_cards=(4 * decks)) stack.CARD_YOFFSET = l.YOFFSET s.foundations.append(stack) x += l.XS x, y = l.XM + (max_rows - rows) * l.XS / 2, l.YM + l.YS + (4 * decks) * l.YOFFSET for i in range(rows): s.rows.append(AC_RowStack(x, y, self)) x += l.XS x, y = self.width - l.XS, self.height - l.YS s.talon = InitialDealTalonStack(x, y, self) # define stack-groups l.defaultStackGroups()
def canMoveCards(self, cards): if self.game.base_rank is None: return False if not AC_RowStack.canMoveCards(self, cards): return False if len(cards) == 1 or len(self.cards) == len(cards): return True return False
def acceptsCards(self, from_stack, cards): if not self.basicAcceptsCards(from_stack, cards): return 0 stackcards = self.cards if stackcards: if (stackcards[-1].suit == 4 or cards[0].suit == 4): return stackcards[-1].rank == cards[0].rank + 1 return AC_RowStack.acceptsCards(self, from_stack, cards)
def canMoveCards(self, cards): if self.game.base_rank is None: return False if not AC_RowStack.canMoveCards(self, cards): return False if len(cards) == 1 or len(self.cards) == len(cards): return True return False
def acceptsCards(self, from_stack, cards): if not AC_RowStack.acceptsCards(self, from_stack, cards): return False if not self.cards and from_stack is self.game.s.waste: for stack in self.game.s.reserves: if stack.cards: return False return True if from_stack in self.game.s.rows and \ len(cards) != len(from_stack.cards): return False return True
def acceptsCards(self, from_stack, cards): if not AC_RowStack.acceptsCards(self, from_stack, cards): return False if not self.cards and from_stack is self.game.s.waste: for stack in self.game.s.reserves: if stack.cards: return False return True if from_stack in self.game.s.rows and \ len(cards) != len(from_stack.cards): return False return True
def createGame(self): # create layout l, s = Layout(self), self.s # set window self.setSize(l.XM + 10 * l.XS, max(l.YM + 2 * l.YS + 12 * l.YOFFSET, l.YM + 5 * l.YS)) # create stacks x = l.XM for i in range(2): y = l.YM + l.YS for j in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=j)) y += l.YS x += l.XS x, y = l.XM + 2 * l.XS, l.YM for i in range(8): stack = AC_RowStack(x, y, self, max_move=1) stack.getBottomImage = stack._getReserveBottomImage stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, 0 s.rows.append(stack) x += l.XS x, y = l.XM + 2 * l.XS, l.YM + l.YS for i in range(8): stack = OpenStack(x, y, self, max_accept=0) stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, l.YOFFSET s.reserves.append(stack) x += l.XS s.talon = KingsdownEights_Talon(l.XM, l.YM, self, max_rounds=1) l.createText(s.talon, "se") # define stack-groups l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM + 9 * l.XS, l.YM + 2 * l.YS + 20 * l.YOFFSET) x, y = l.XM, l.YM s.talon = TalonStack(x, y, self) l.createText(s.talon, "s") y = l.YM for i in range(2): x = l.XM + l.XS for j in range(8): s.rows.append(AC_RowStack(x, y, self, max_move=1)) x += l.XS y += l.YS + 10 * l.YOFFSET l.defaultStackGroups()
def createGame(self): # create layout l, s = Layout(self), self.s # set window self.setSize(l.XM + 8.5 * l.XS, l.YM + 3 * l.YS + 14 * l.XOFFSET) # create stacks x, y, = l.XM, l.YM for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i)) x += l.XS x += l.XS / 2 for i in range(4): s.foundations.append( SS_FoundationStack(x, y, self, suit=i, base_rank=KING, dir=-1)) x += l.XS x, y = l.XM, l.YM + l.YS for j in range(4): s.rows.append(AC_RowStack(x, y, self)) x += l.XS x += l.XS / 2 for j in range(4): s.rows.append(AC_RowStack(x, y, self, dir=1)) x += l.XS x, y = self.width - l.XS, self.height - l.YS s.talon = WasteTalonStack(x, y, self, max_rounds=1) l.createText(s.talon, 'n') x -= l.XS s.waste = WasteStack(x, y, self) l.createText(s.waste, 'n') # define stack-groups l.defaultStackGroups()
def createGame(self): # create layout l, s = Layout(self), self.s # set window self.setSize(l.XM + 9 * l.XS, l.YM + 2 * l.YS + 12 * l.YOFFSET) # create stacks x, y, = l.XM + l.XS, l.YM for i in range(8): s.foundations.append( DieRussische_Foundation(x, y, self, suit=i % 4, max_cards=8)) x += l.XS x, y, = l.XM + l.XS, l.YM + l.YS for i in range(8): s.rows.append(AC_RowStack(x, y, self, max_move=1, max_accept=1)) x += l.XS s.talon = RedealTalonStack(l.XM, l.YM + l.YS / 2, self, max_rounds=3) l.createRoundText(s.talon, 'nn') # define stack-groups l.defaultStackGroups()
def createGame(self): # create layout l, s = Layout(self), self.s # set window w, h = l.XM + 9 * l.XS, l.YM + 3 * l.YS + 12 * l.YOFFSET self.setSize(w, h) # create stacks x, y = l.XM + l.XS2, l.YM for i in range(8): s.foundations.append( SS_FoundationStack(x, y, self, suit=int(i // 2), max_cards=10)) x += l.XS x, y = l.XM + l.XS // 2, l.YM + l.YS for i in range(8): s.rows.append( AC_RowStack(x, y, self, base_rank=ANY_RANK, max_move=1)) x += l.XS x, y = l.XM, h - l.YS s.talon = Octave_Talon(x, y, self, max_rounds=2) l.createText(s.talon, "n") x += l.XS s.waste = Octave_Waste(x, y, self) l.createText(s.waste, 'n') x += l.XS for i in range(7): stack = WasteStack(x, y, self, max_accept=0) s.reserves.append(stack) x += l.XS # define stack-groups l.defaultStackGroups()
def acceptsCards(self, from_stack, cards): if not AC_RowStack.acceptsCards(self, from_stack, cards): return False # when empty, only accept a single card return self.cards or len(cards) == 1
def basicAcceptsCards(self, from_stack, cards): if from_stack in self.game.s.rows: if len(cards) != 1 and len(cards) != len(from_stack.cards): return False return AC_RowStack.basicAcceptsCards(self, from_stack, cards)
def acceptsCards(self, from_stack, cards): if self.game.getState() == 0: return False if from_stack in self.game.s.reserves: return False return AC_RowStack.acceptsCards(self, from_stack, cards)
def __init__(self, x, y, game, **cap): kwdefault(cap, mod=13, max_move=1) AC_RowStack.__init__(self, x, y, game, **cap)
def acceptsCards(self, from_stack, cards): if not AC_RowStack.acceptsCards(self, from_stack, cards): return False if not self.cards: return from_stack is self.game.s.waste return from_stack not in self.game.s.reserves
def acceptsCards(self, from_stack, cards): if not AC_RowStack.acceptsCards(self, from_stack, cards): return False # Note that this reserve stack accepts sequences if both # the reserve stack and the Talon are empty. return len(self.cards) == 0 and len(self.game.s.talon.cards) == 0
def acceptsCards(self, from_stack, cards): if not AC_RowStack.acceptsCards(self, from_stack, cards): return False if not self.cards: return from_stack is self.game.s.waste return from_stack not in self.game.s.reserves
def acceptsCards(self, from_stack, cards): if not AC_RowStack.acceptsCards(self, from_stack, cards): return False if self.cards: return len(cards) == 1 return True
def acceptsCards(self, from_stack, cards): if self.cards and not self.cards[-1].face_up: return True return AC_RowStack.acceptsCards(self, from_stack, cards)
def acceptsCards(self, from_stack, cards): if not AC_RowStack.acceptsCards(self, from_stack, cards): return False # when empty, only accept a single card return self.cards or len(cards) == 1
def acceptsCards(self, from_stack, cards): if not AC_RowStack.acceptsCards(self, from_stack, cards): return False # Note that this reserve stack accepts sequences if both # the reserve stack and the Talon are empty. return len(self.cards) == 0 and len(self.game.s.talon.cards) == 0
def acceptsCards(self, from_stack, cards): if not AC_RowStack.acceptsCards(self, from_stack, cards): return False if from_stack is self.game.s.waste: return False return True
def basicAcceptsCards(self, from_stack, cards): if from_stack in self.game.s.rows: if len(cards) != 1 and len(cards) != len(from_stack.cards): return False return AC_RowStack.basicAcceptsCards(self, from_stack, cards)
def acceptsCards(self, from_stack, cards): if not AC_RowStack.acceptsCards(self, from_stack, cards): return False if from_stack in self.game.s.reserves: return False return True
def acceptsCards(self, from_stack, cards): if from_stack in self.game.s.reserves: return False return AC_RowStack.acceptsCards(self, from_stack, cards)
def acceptsCards(self, from_stack, cards): if not AC_RowStack.acceptsCards(self, from_stack, cards): return False return BritishConstitution_RowStackMethods.acceptsCards( self, from_stack, cards)