Beispiel #1
0
    def createGame(self):

        l, s = Layout(self), self.s
        self.setSize(l.XM+7*l.XS, l.YM+2*l.YS+20*l.YOFFSET)

        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 += 3.5*l.XS
        s.foundations.append(FourByFour_Foundation(x, y, self,
                             suit=ANY_SUIT, base_rank=ANY_RANK, max_cards=52,
                             max_accept=1, max_move=0, mod=13))
        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+3*l.XS, l.YM+l.YS
        for i in range(4):
            stack = UD_RK_RowStack(x, y, self, mod=13)
            stack.getBottomImage = stack._getReserveBottomImage
            s.rows.append(stack)
            x += l.XS

        l.defaultStackGroups()
Beispiel #2
0
    def createGame(self):
        # create layout
        layout, s = Layout(self), self.s

        # set window
        h = layout.YS + 6*layout.YOFFSET
        self.setSize(layout.XM + 7*layout.XS, layout.YM + 2*h)

        # create stacks
        y = layout.YM
        for i in range(7):
            x = layout.XM + i*layout.XS
            s.rows.append(
                UD_RK_RowStack(x, y, self, mod=13, base_rank=NO_RANK))
        y = layout.YM+h
        for i in range(6):
            x = layout.XM + i*layout.XS
            s.rows.append(
                UD_RK_RowStack(x, y, self, mod=13, base_rank=NO_RANK))
        stack = FourLeafClovers_Foundation(
            layout.XM+6*layout.XS, self.height-layout.YS, self,
            suit=ANY_SUIT, dir=0, mod=13,
            max_move=0, max_cards=52)
        s.foundations.append(stack)
        layout.createText(stack, 'n')
        x, y = layout.XM + 7*layout.XS, self.height - layout.YS
        s.talon = InitialDealTalonStack(x, y, self)

        # define stack-groups
        layout.defaultStackGroups()
Beispiel #3
0
    def createGame(self):

        l, s = Layout(self), self.s
        self.setSize(l.XM+7*l.XS, l.YM+2*l.YS+20*l.YOFFSET)

        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 += 3.5*l.XS
        s.foundations.append(FourByFour_Foundation(x, y, self,
                             suit=ANY_SUIT, base_rank=ANY_RANK, max_cards=52,
                             max_accept=1, max_move=0, mod=13))
        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+3*l.XS, l.YM+l.YS
        for i in range(4):
            stack = UD_RK_RowStack(x, y, self, mod=13)
            stack.getBottomImage = stack._getReserveBottomImage
            s.rows.append(stack)
            x += l.XS

        l.defaultStackGroups()
Beispiel #4
0
    def createGame(self):
        # create layout
        l, s = Layout(self), self.s

        # set window
        self.setSize(l.XM+9*l.XS, l.YM+3*l.YS+12*l.YOFFSET)

        # create stacks
        x, y = l.XM, l.YM
        for i in range(4):
            s.foundations.append(
                Rittenhouse_Foundation(x, y, self, max_move=0))
            x += l.XS
        x += l.XS
        for i in range(4):
            s.foundations.append(Rittenhouse_Foundation(x, y, self,
                                 base_rank=KING, dir=-1, max_move=0))
            x += l.XS
        x, y = l.XM, l.YM+l.YS
        for i in range(9):
            s.rows.append(UD_RK_RowStack(x, y, self))
            x += l.XS

        s.talon = InitialDealTalonStack(l.XM, self.height-l.YS, self)

        # default
        l.defaultAll()
Beispiel #5
0
    def createGame(self, rows=6, playcards=18):
        # create layout
        layout, s = Layout(self), self.s

        # set window
        self.setSize(
            layout.XM + rows*layout.XS,
            layout.YM + 2*layout.YS + playcards*layout.XOFFSET)

        # create stacks
        x, y, = layout.XM, layout.YM+layout.YS
        for i in range(rows):
            s.rows.append(UD_RK_RowStack(x, y, self, mod=13))
            x += layout.XS

        x, y = layout.XM + (rows-1)*layout.XS//2, layout.YM
        stack = BlackHole_Foundation(x, y, self, max_move=0, suit=ANY_SUIT,
                                     base_rank=ANY_RANK, dir=0, mod=13,
                                     max_cards=52*self.gameinfo.decks)
        s.foundations.append(stack)
        layout.createText(stack, 'ne')

        x, y = layout.XM, self.height-layout.YS
        s.talon = InitialDealTalonStack(x, y, self)

        # define stack-groups
        layout.defaultStackGroups()
 def acceptsCards(self, from_stack, cards):
     if not UD_RK_RowStack.acceptsCards(self, from_stack, cards):
         return False
     return len(self.game.s.talon.cards) == 0
Beispiel #7
0
 def acceptsCards(self, from_stack, cards):
     if not UD_RK_RowStack.acceptsCards(self, from_stack, cards):
         return False
     return len(self.game.s.talon.cards) == 0