Beispiel #1
0
    def createGame(self):

        l, s = Layout(self), self.s
        self.setSize(l.XM+8.5*l.XS, l.YM+4*l.YS)

        y = l.YM
        suit = 0
        for i in (0, 1, 3, 4):
            x = l.XM+(2+i)*l.XS
            s.foundations.append(SS_FoundationStack(x, y, self, suit=suit))
            suit += 1

        x, y = l.XM+4*l.XS, l.YM
        for i in range(4):
            s.foundations.append(SS_FoundationStack(x, y, self, suit=i,
                                                    base_rank=KING, dir=-1))
            y += l.YS

        for i, j in ((0, 0), (1, 0), (2, 0), (5, 0), (6, 0), (7, 0),
                     (0, 1), (1, 1), (2, 1), (5, 1), (6, 1), (7, 1),
                     ):
            x, y = l.XM+(0.5+i)*l.XS, l.YM+(1.5+j)*l.YS
            stack = BasicRowStack(x, y, self, max_accept=0)
            s.rows.append(stack)
            stack.CARD_YOFFSET = 0

        x, y = l.XM, l.YM
        s.talon = DealRowRedealTalonStack(x, y, self, max_rounds=3)
        l.createText(s.talon, 'se')
        l.createRoundText(s.talon, 'ne')

        l.defaultStackGroups()
Beispiel #2
0
    def createGame(self, max_rounds=2):

        l, s = Layout(self), self.s
        self.setSize(l.XM + 10 * l.XS, l.YM + 5 * l.YS)

        lay = (
            (1.5, 0),
            (2.5, 0.3),
            (3, 1.3),
            (2.5, 2.3),
            (1.5, 2.6),
            (0.5, 2.3),
            (0, 1.3),
            (0.5, 0.3),
        )

        suit = 0
        x0, y0 = l.XM + l.XS, l.YM
        for xx, yy in lay:
            x, y = x0 + xx * l.XS, y0 + yy * l.YS
            s.foundations.append(
                SS_FoundationStack(x,
                                   y,
                                   self,
                                   suit=suit // 2,
                                   base_rank=6,
                                   max_cards=7))
            suit += 1
        suit = 0
        x0, y0 = l.XM + 5 * l.XS, l.YM
        for xx, yy in lay:
            x, y = x0 + xx * l.XS, y0 + yy * l.YS
            s.foundations.append(
                SS_FoundationStack(x,
                                   y,
                                   self,
                                   suit=suit // 2,
                                   base_rank=5,
                                   dir=-1,
                                   max_cards=6))
            suit += 1

        x, y = l.XM, l.YM + 4 * l.YS
        for i in range(8):
            stack = BasicRowStack(x, y, self)
            stack.CARD_YOFFSET = 0
            s.rows.append(stack)
            x += l.XS

        x += l.XS
        s.talon = DealRowRedealTalonStack(x, y, self, max_rounds=2)
        l.createText(s.talon, 'nw')
        l.createRoundText(s.talon, 'sw')

        l.defaultStackGroups()
Beispiel #3
0
    def createGame(self, max_rounds=2):

        l, s = Layout(self), self.s
        self.setSize(l.XM+10*l.XS, l.YM+5*l.YS)

        lay = (
            (1.5, 0),
            (2.5, 0.3),
            (3,   1.3),
            (2.5, 2.3),
            (1.5, 2.6),
            (0.5, 2.3),
            (0,   1.3),
            (0.5, 0.3),
            )

        suit = 0
        x0, y0 = l.XM+l.XS, l.YM
        for xx, yy in lay:
            x, y = x0+xx*l.XS, y0+yy*l.YS
            s.foundations.append(SS_FoundationStack(x, y, self, suit=suit//2,
                                 base_rank=6, max_cards=7))
            suit += 1
        suit = 0
        x0, y0 = l.XM+5*l.XS, l.YM
        for xx, yy in lay:
            x, y = x0+xx*l.XS, y0+yy*l.YS
            s.foundations.append(SS_FoundationStack(x, y, self, suit=suit//2,
                                 base_rank=5, dir=-1, max_cards=6))
            suit += 1

        x, y = l.XM, l.YM+4*l.YS
        for i in range(8):
            stack = BasicRowStack(x, y, self)
            stack.CARD_YOFFSET = 0
            s.rows.append(stack)
            x += l.XS

        x += l.XS
        s.talon = DealRowRedealTalonStack(x, y, self, max_rounds=2)
        l.createText(s.talon, 'nw')
        l.createRoundText(s.talon, 'sw')

        l.defaultStackGroups()
Beispiel #4
0
    def createGame(self):

        # create layout
        l, s = Layout(self), self.s

        # set window
        self.setSize(l.XM + 10 * l.XS,
                     max(l.YM + l.YS + 20 * l.YOFFSET, 2 * l.YM + 5 * l.YS))

        # create stacks
        x, y, = l.XM + 2 * l.XS, l.YM
        for i in range(4):
            s.foundations.append(SS_FoundationStack(x, y, self, suit=i))
            x = x + l.XS
        for i in range(4):
            s.foundations.append(
                SS_FoundationStack(x, y, self, suit=i, base_rank=KING, dir=-1))
            x = x + l.XS
        x, y = l.XM + 2 * l.XS, 2 * l.YM + l.YS
        for i in range(6):
            stack = BasicRowStack(x, y, self, max_move=1, max_accept=0)
            s.rows.append(stack)
            if not self.ROW_YOFFSET:
                stack.CARD_YOFFSET = 0
            x = x + l.XS

        x, y = l.XM, 2 * l.YM + l.YS
        for i in range(4):
            self.s.reserves.append(ReserveStack(x, y, self))
            y += l.YS
        x, y = l.XM + 9 * l.XS, 2 * l.YM + l.YS
        for i in range(4):
            self.s.reserves.append(ReserveStack(x, y, self))
            y += l.YS

        s.talon = Tournament_Talon(l.XM, l.YM, self, max_rounds=3)
        l.createText(s.talon, "se")
        l.createRoundText(s.talon, 'ne')

        # define stack-groups
        l.defaultStackGroups()
Beispiel #5
0
    def createGame(self):

        # create layout
        l, s = Layout(self), self.s

        # set window
        self.setSize(l.XM+10*l.XS, max(l.YM+l.YS+20*l.YOFFSET, 2*l.YM+5*l.YS))

        # create stacks
        x, y, = l.XM+2*l.XS, l.YM
        for i in range(4):
            s.foundations.append(SS_FoundationStack(x, y, self, suit=i))
            x = x + l.XS
        for i in range(4):
            s.foundations.append(SS_FoundationStack(x, y, self, suit=i,
                                                    base_rank=KING, dir=-1))
            x = x + l.XS
        x, y = l.XM+2*l.XS, 2*l.YM+l.YS
        for i in range(6):
            stack = BasicRowStack(x, y, self, max_move=1, max_accept=0)
            s.rows.append(stack)
            if not self.ROW_YOFFSET:
                stack.CARD_YOFFSET = 0
            x = x + l.XS

        x, y = l.XM, 2*l.YM+l.YS
        for i in range(4):
            self.s.reserves.append(ReserveStack(x, y, self))
            y += l.YS
        x, y = l.XM+9*l.XS, 2*l.YM+l.YS
        for i in range(4):
            self.s.reserves.append(ReserveStack(x, y, self))
            y += l.YS

        s.talon = Tournament_Talon(l.XM, l.YM, self, max_rounds=3)
        l.createText(s.talon, "se")
        l.createRoundText(s.talon, 'ne')

        # define stack-groups
        l.defaultStackGroups()
Beispiel #6
0
    def createGame(self, rows=4):
        # create layout
        max_rows = max(10, 4 + rows)
        l, s = Layout(self), self.s

        # set window
        w, h = l.XM + max_rows * l.XS, l.YM + 2 * l.YS + 18 * l.YOFFSET
        self.setSize(w, h)

        # create stacks
        x, y = l.XM, l.YM
        s.talon = GrandDuchess_Talon(x, y, self, max_rounds=4)
        l.createText(s.talon, 'se')
        l.createRoundText(s.talon, 'ne')

        x += 2 * l.XS
        for i in range(4):
            s.foundations.append(SS_FoundationStack(x, y, self, suit=i))
            x += l.XS
        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 + (max_rows - rows) * l.XS // 2, l.YM + l.YS
        for i in range(rows):
            stack = BasicRowStack(x, y, self, max_move=1, max_accept=0)
            stack.CARD_YOFFSET = l.YOFFSET
            s.rows.append(stack)
            x += l.XS
        dx = (max_rows - rows) * l.XS // 4 - l.XS // 2
        x, y = l.XM + dx, l.YM + l.YS
        s.reserves.append(GrandDuchess_Reserve(x, y, self))
        x, y = self.width - dx - l.XS, l.YM + l.YS
        s.reserves.append(GrandDuchess_Reserve(x, y, self))

        # define stack-groups
        l.defaultStackGroups()
Beispiel #7
0
    def createGame(self, rows=4):
        # create layout
        max_rows = max(10, 4+rows)
        l, s = Layout(self), self.s

        # set window
        w, h = l.XM+max_rows*l.XS, l.YM+2*l.YS+18*l.YOFFSET
        self.setSize(w, h)

        # create stacks
        x, y = l.XM, l.YM
        s.talon = GrandDuchess_Talon(x, y, self, max_rounds=4)
        l.createText(s.talon, 'se')
        l.createRoundText(s.talon, 'ne')

        x += 2*l.XS
        for i in range(4):
            s.foundations.append(SS_FoundationStack(x, y, self, suit=i))
            x += l.XS
        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+(max_rows-rows)*l.XS//2, l.YM+l.YS
        for i in range(rows):
            stack = BasicRowStack(x, y, self, max_move=1, max_accept=0)
            stack.CARD_YOFFSET = l.YOFFSET
            s.rows.append(stack)
            x += l.XS
        dx = (max_rows-rows)*l.XS//4-l.XS//2
        x, y = l.XM+dx, l.YM+l.YS
        s.reserves.append(GrandDuchess_Reserve(x, y, self))
        x, y = self.width-dx-l.XS, l.YM+l.YS
        s.reserves.append(GrandDuchess_Reserve(x, y, self))

        # define stack-groups
        l.defaultStackGroups()