def createGame(self): l, s = Layout(self), self.s h0 = l.YS+3*l.YOFFSET self.setSize(l.XM+10*l.XS, l.YM+l.YS+l.TEXT_HEIGHT+2*h0) 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 += l.XS for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i % 4)) 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 y = l.YM+l.YS+l.TEXT_HEIGHT for i in range(2): x = l.XM for j in range(10): s.rows.append(DoubleLine_RowStack(x, y, self, max_cards=2, max_move=1, max_accept=1, base_rank=NO_RANK)) x += l.XS y += h0 l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM+5*l.XS, l.YM+4*l.YS) for i, j in ((1,0), (2,0), (3,0), (4,1.5), (3,3), (2,3), (1,3), (0,1.5), ): x, y = l.XM+i*l.XS, l.YM+j*l.YS stack = RK_RowStack(x, y, self, dir=1, mod=13, max_move=0) s.rows.append(stack) stack.CARD_YOFFSET = 0 x, y = l.XM+1.5*l.XS, l.YM+1.5*l.YS s.talon = WasteTalonStack(x, y, self, max_rounds=2) l.createText(s.talon, 'nw') l.createRoundText(self.s.talon, 'nn') x += l.XS s.waste = WasteStack(x, y, self) l.createText(s.waste, 'ne') l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM+10*l.XS, l.YM+5*l.YS) 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+6*l.XS, y, self, suit=i)) x += l.XS x, y = l.XM+4*l.XS, l.YM r = range(11) for i in range(5,0,-1): for j in r[i:-i]: x, y = l.XM+(j-0.5)*l.XS, l.YM+(5-i)*l.YS s.rows.append(BasicRowStack(x, y, self, max_accept=0)) x, y = l.XM, l.YM+1.5*l.YS 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): l, s = Layout(self), self.s self.setSize(l.XM+5*l.XS, l.YM+5*l.YS) suit = 0 for x, y in ((0,0), (4,0), (0,4), (4,4)): x, y = l.XM+x*l.XS, l.YM+y*l.YS s.foundations.append(SS_FoundationStack(x, y, self, suit=suit)) suit += 1 x, y = l.XM+3*l.XS/2, l.YM s.talon = WasteTalonStack(x, y, self, max_rounds=1) l.createText(s.talon, 'nw') x += l.XS s.waste = WasteStack(x, y, self) l.createText(s.waste, 'ne') y = l.YM+l.YS for i in range(3): x = l.XM+l.XS for j in range(3): stack = CornerSuite_RowStack(x, y, self, max_move=1) s.rows.append(stack) stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, 0 x += l.XS y += l.YS l.defaultStackGroups()
def createGame(self): # create layout l, s = Layout(self), self.s # set window w, h = l.XM+12*l.XS, l.YM+l.YS+16*l.YOFFSET self.setSize(w, h) # create stacks x, y = l.XM, l.YM s.talon = DealRowTalonStack(x, y, self) l.createText(s.talon, "s") x += l.XS for i in range(10): stack = self.RowStack_Class(x, y, self, base_rank=ANY_RANK, max_move=UNLIMITED_MOVES, max_accept=UNLIMITED_ACCEPTS) s.rows.append(stack) x += l.XS s.foundations.append(AbstractFoundationStack(x, y, self, suit=ANY_SUIT, max_accept=0, max_cards=104)) l.createText(s.foundations[0], "s") # define stack-groups 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, max_rounds=2): l, s = Layout(self), self.s self.setSize(l.XM+8*l.XS, l.YM+4*l.YS) y = l.YM for i in range(2): x = l.XM for j in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=j, base_rank=6, max_cards=7)) x += l.XS y += l.YS for i in range(2): x = l.XM for j in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=j, base_rank=5, dir=-1, max_cards=6)) x += l.XS y += l.YS y = l.YM for i in range(3): x = l.XM+5*l.XS for j in range(3): s.rows.append(ReserveStack(x, y, self)) x += l.XS y += l.YS x, y = l.XM+5*l.XS, l.YM+3*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') l.defaultStackGroups()
def createGame(self): playcards = 6 l, s = Layout(self), self.s self.setSize( l.XM+10*l.XS, l.YM+3*l.YS+2*playcards*l.YOFFSET+l.TEXT_HEIGHT) x, y = l.XM, l.YM s.talon = SlyFox_Talon(x, y, self) s.waste = s.talon l.createText(s.talon, 'ne') tx, ty, ta, tf = l.getTextAttr(s.talon, "ss") font = self.app.getFont("canvas_default") self.texts.misc = MfxCanvasText(self.canvas, tx, ty, anchor=ta, font=font) x += 2*l.XS for i in range(4): s.foundations.append(SlyFox_Foundation(x, y, self, suit=i)) s.foundations.append(SlyFox_Foundation(x+4*l.XS, y, self, suit=i, base_rank=KING, dir=-1)) x += l.XS y = l.YM+l.YS+l.TEXT_HEIGHT for i in range(2): x = l.XM for j in range(10): stack = SlyFox_RowStack(x, y, self, max_cards=UNLIMITED_CARDS) s.rows.append(stack) stack.CARD_YOFFSET = l.YOFFSET x += l.XS y += l.YS+playcards*l.YOFFSET l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s w, h = l.XM+8*l.XS, l.YM+4*l.YS self.setSize(w, h) x, y = l.XM, l.YM for i in range(8): s.foundations.append(SS_FoundationStack(x, y, self, suit=i/2, base_rank=KING, mod=13)) x += l.XS x, y = l.XM, l.YM+l.YS s.talon = TheSpark_Talon(x, y, self, max_rounds=1, num_deal=3) l.createText(s.talon, 'se') y += l.YS for i in (0,1): stack = WasteStack(x, y, self) s.reserves.append(stack) l.createText(stack, 'se') y += l.YS y = l.YM+l.YS*3/2 for i in range(2): x = l.XM+2*l.XS for j in range(6): stack = SS_RowStack(x, y, self, max_move=1) stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, 0 s.rows.append(stack) x += l.XS y += l.YS l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s w1 = l.XS+12*l.XOFFSET w, h = l.XM+2*l.XS+2*w1, l.YM+4*l.YS self.setSize(w, h) for x, y in ((l.XM, l.YM), (l.XM+w1+2*l.XS+l.XM, l.YM), (l.XM, l.YM+3*l.YS), (l.XM+w1+2*l.XS+l.XM, l.YM+3*l.YS),): stack = SS_RowStack(x, y, self, max_move=1) stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0 s.rows.append(stack) i = 0 for x, y in ((l.XM+w1, l.YM), (l.XM+w1+l.XS, l.YM), (l.XM+w1-2*l.XS-l.XS/2-l.XM, l.YM+1.5*l.YS), (l.XM+w1-l.XS-l.XS/2-l.XM, l.YM+1.5*l.YS), (l.XM+w1+2*l.XS+l.XS/2+l.XM, l.YM+1.5*l.YS), (l.XM+w1+3*l.XS+l.XS/2+l.XM, l.YM+1.5*l.YS), (l.XM+w1, l.YM+3*l.YS), (l.XM+w1+l.XS, l.YM+3*l.YS),): s.foundations.append(SS_FoundationStack(x, y, self, suit=i%4)) i += 1 x, y = l.XM+w1, l.YM+1.5*l.YS s.talon = WasteTalonStack(x, y, self, max_rounds=4) l.createText(s.talon, 's') l.createRoundText(s.talon, 'nn') x += l.XS s.waste = WasteStack(x, y, self) l.createText(s.waste, 's') l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM+12*l.XS, l.YM+max(4.5*l.YS, 2*l.YS+12*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 += 2*l.XS for i in range(8): s.foundations.append(SS_FoundationStack(x, y, self, suit=i/2)) x += l.XS x, y = l.XM, l.YM+l.YS*3/2 for i in range(3): s.reserves.append(ReserveStack(x, y, self)) y += l.YS x, y = l.XM+2*l.XS, l.YM+l.YS for i in range(10): s.rows.append(SS_RowStack(x, y, self, max_move=1)) x += l.XS l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM+10*l.XS, l.YM+2*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 += l.XS for i in range(8): s.foundations.append(SS_FoundationStack(x, y, self, suit=i%4, max_cards=12)) x += l.XS x, y = l.XM, l.YM+l.YS+l.TEXT_HEIGHT s.foundations.append(RK_FoundationStack(x, y, self, suit=ANY_SUIT, base_rank=KING, dir=0, max_cards=8)) x += 3*l.XS for i in range(6): s.rows.append(RK_RowStack(x, y, self, max_move=1)) x += l.XS l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM+8*l.XS, l.YM+4*l.YS) x, y = l.XM, l.YM for i in range(8): s.foundations.append(SS_FoundationStack(x, y, self, suit=i/2, base_rank=4, dir=-1, mod=13, max_cards=6)) x += l.XS x, y = l.XM, l.YM+l.YS for i in range(8): s.foundations.append(SS_FoundationStack(x, y, self, suit=i/2, base_rank=5, max_cards=7)) x += l.XS x, y = l.XM+3*l.XS, l.YM+3*l.YS s.talon = WasteTalonStack(x, y, self, max_rounds=2) l.createText(s.talon, 'n') l.createRoundText(self.s.talon, 'nnn') x += l.XS s.waste = WasteStack(x, y, self) l.createText(s.waste, 'n') l.defaultStackGroups()
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()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM+8*l.XS, l.YM+4*l.YS) s.talon = Matrimony_Talon(l.XM, l.YM, self, max_rounds=17) l.createText(s.talon, 'se') l.createRoundText(s.talon, 'ne') x, y = l.XM+2*l.XS, l.YM for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i, base_rank=JACK, dir=-1, mod=13)) x += l.XS x, y = l.XM+2*l.XS, l.YM+l.YS for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i, base_rank=QUEEN, dir=1, mod=13)) x += l.XS y = l.YM+2*l.YS for i in range(2): x = l.XM for j in range(8): stack = LadyOfTheManor_RowStack(x, y, self, max_accept=0) stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, 0 s.rows.append(stack) x += l.XS y += l.YS l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM+7*l.XS, l.YM+4*l.YS) x, y = l.XM, l.YM s.talon = WasteTalonStack(x, y, self, max_rounds=3) l.createText(s.talon, 's') l.createRoundText(s.talon, 'ne', dx=l.XS) x += l.XS s.waste = WasteStack(x, y, self) l.createText(s.waste, 's') x0, y0 = l.XM+2*l.XS, l.YM k = 0 for i, j in((2, 0), (0, 1.5), (4, 1.5), (2, 3)): x, y = x0+i*l.XS, y0+j*l.YS s.foundations.append(RK_FoundationStack(x, y, self, ##suit=ANY_SUIT, base_rank=KING, dir=-1, max_move=0)) k += 1 k = 0 for i, j in((2, 1), (1, 1.5), (3, 1.5), (2, 2)): x, y = x0+i*l.XS, y0+j*l.YS s.foundations.append(RK_FoundationStack(x, y, self, ##suit=ANY_SUIT, base_rank=1, max_move=0, max_cards=12)) k += 1 k = 0 for i, j in((1, 0.2), (3, 0.2), (1, 2.8), (3, 2.8)): x, y = x0+i*l.XS, y0+j*l.YS s.foundations.append(IdleAces_AceFoundation(x, y, self, suit=k, max_cards=1, max_move=0)) k += 1 l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM+13*l.XS, l.YM+7*l.YS) self.base_rank = ANY_RANK x, y = l.XM+2.5*l.XS, l.YM for i in range(8): s.foundations.append(StepUp_Foundation(x, y, self, suit=i%4, mod=13, base_rank=ANY_RANK)) x += l.XS tx, ty, ta, tf = l.getTextAttr(s.foundations[0], "sw") font = self.app.getFont("canvas_default") self.texts.info = MfxCanvasText(self.canvas, tx, ty, anchor=ta, font=font) x, y = l.XM, l.YM+l.YS for i in range(13): s.reserves.append(ReserveStack(x, y, self)) x += l.XS x, y = l.XM+2*l.XS, l.YM+2*l.YS for i in range(9): s.rows.append(StepUp_RowStack(x, y, self, max_move=1, mod=13)) x += l.XS x, y = l.XM, l.YM+2.5*l.YS s.talon = StepUp_Talon(x, y, self, max_rounds=1) l.createText(s.talon, 'se') y += l.YS 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+9*l.XS, l.YM+4*l.YS) x, y = l.XM, l.YM s.talon = SlyFox_Talon(x, y, self) s.waste = s.talon l.createText(s.talon, 'ne') tx, ty, ta, tf = l.getTextAttr(s.talon, "ss") font = self.app.getFont("canvas_default") self.texts.misc = MfxCanvasText(self.canvas, tx, ty, anchor=ta, font=font) y = l.YM for i in range(4): x = l.XM+1.5*l.XS for j in range(5): stack = SlyFox_RowStack(x, y, self, max_cards=UNLIMITED_CARDS) stack.CARD_YOFFSET = 0 s.rows.append(stack) x += l.XS y += l.YS x, y = self.width-2*l.XS, l.YM for i in range(4): s.foundations.append(SlyFox_Foundation(x, y, self, suit=i)) s.foundations.append(SlyFox_Foundation(x+l.XS, y, self, suit=i, base_rank=KING, dir=-1)) y += l.YS l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM+8*l.XS, l.YM+5*l.YS) y = l.YM for i in range(5): x = l.XM+(8-i)*l.XS/2 for j in range(i+1): s.rows.append(ReserveStack(x, y, self)) x += l.XS y += l.YS suit = 0 for xx, yy in ((1.5, 1.5), (1, 2.5), (6.5, 1.5), (7, 2.5)): x, y = l.XM+xx*l.XS, l.YM+yy*l.YS s.foundations.append(SS_FoundationStack(x, y, self, suit)) suit += 1 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') 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 + 6*l.YS) # create stacks y = l.YM for d in ((1, 2.5), (2, 2), (3, 1.5), (4, 1), (5, 0.5), (5, 0.5)): x = l.XM + d[1] * l.XS for i in range(d[0]): s.rows.append(EiffelTower_RowStack(x, y, self)) x = x + l.XS y = y + l.YS x = l.XM + 6 * l.XS y = l.YM + 5 * l.YS // 2 s.waste = self.Waste_Class(x, y, self) l.createText(s.waste, "s") x = x + l.XS s.talon = self.Talon_Class(x, y, self, max_rounds=1) l.createText(s.talon, "s") # define stack-groups l.defaultStackGroups()
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()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM+9.5*l.XS, l.YM+4*l.YS) x, y = l.XM+l.XS, l.YM for i in range(8): s.foundations.append(SS_FoundationStack(x, y, self, suit=i%4, base_rank=JACK, dir=-1, max_cards=11)) x += l.XS x, y = l.XM+l.XS, l.YM+l.YS for i in range(8): s.foundations.append(Adela_Foundation(x, y, self, suit=i%4, base_rank=QUEEN, max_cards=1)) x += l.XS x, y = l.XM+l.XS, l.YM+2*l.YS for i in range(8): s.foundations.append(Adela_Foundation(x, y, self, suit=i%4, base_rank=KING, max_cards=1)) x += l.XS x, y = l.XM, l.YM+l.YS s.talon = DealRowTalonStack(x, y, self) l.createText(s.talon, 'n') x, y = l.XM+l.XS/2, l.YM+3*l.YS for i in range(9): stack = SS_RowStack(x, y, self, max_move=1, dir=1) s.rows.append(stack) stack.CARD_YOFFSET = 0 x += l.XS l.defaultStackGroups()
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, 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 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, 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): l, s = Layout(self), self.s self.setSize(l.XM+9*l.XS, l.YM+5*l.YS) x, y = l.XM, l.YM for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i)) y += l.YS x, y = self.width-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 x, y = (self.width-l.XS)/2, self.height-l.YS s.talon = DealRowTalonStack(x, y, self) l.createText(s.talon, 'se') y = l.YM for i in range(4): x = l.XM+l.XS*3/2 for j in range(6): stack = UD_SS_RowStack(x, y, self, base_rank=NO_RANK) s.rows.append(stack) stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, 0 x += l.XS y += l.YS l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM+5.5*l.XS, l.YM+3*l.YS) x, y = l.XM, l.YM+l.YS/2 s.talon = WasteTalonStack(x, y, self, max_rounds=3) l.createText(s.talon, "se") l.createRoundText(s.talon, 'nn') y += l.YS s.waste = WasteStack(x, y, self) l.createText(s.waste, "se") x, y = l.XM+1.5*l.XS, l.YM for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i, mod=13, max_cards=6, base_rank=4, dir=-1)) x += l.XS x, y = l.XM+1.5*l.XS, l.YM+l.YS for i in range(4): s.foundations.append(AbstractFoundationStack(x, y, self, suit=i, max_cards=1, max_move=0, base_rank=QUEEN)) x += l.XS x, y = l.XM+1.5*l.XS, l.YM+2*l.YS for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i, mod=13, max_cards=6, base_rank=5)) x += l.XS l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s w, h = l.XM+8*l.XS, 2*l.YM+3*l.YS self.setSize(w, h) x, y = l.XM+3*l.XS, l.YM for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i)) x += l.XS x, y = l.XM, l.YM s.talon = WasteTalonStack(x, y, self, max_rounds=1) l.createText(s.talon, 'se') y += l.YS s.waste = WasteStack(x, y, self) l.createText(s.waste, 'se') y = 2*l.YM+l.YS for i in range(2): x = l.XM+2*l.XS for j in range(6): stack = SS_RowStack(x, y, self, max_move=1) stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, 0 s.rows.append(stack) x += l.XS y += l.YS l.defaultStackGroups()
def createGame(self): # create layout l, s = Layout(self), self.s # set window self.setSize(l.XM+8*l.XS, l.YM+5*l.YS) # create stacks x, y = l.XM, l.YM for i in range(8): s.foundations.append(SS_FoundationStack(x, y, self, suit=i/2, max_cards=10)) x += l.XS y = l.YM+l.YS for i in range(3): x = l.XM for j in range(8): ##stack = SS_RowStack(x, y, self, max_move=1) stack = ReserveStack(x, y, self) stack.CARD_YOFFSET = 0 s.rows.append(stack) x += l.XS y += l.YS x, y = self.width-l.XS, self.height-l.YS s.talon = DealRowTalonStack(x, y, self) l.createText(s.talon, 'sw') # 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 + 3 * l.YS + 12 * l.YOFFSET) # create stacks x, y = l.XM + l.XS, l.YM for i in range(8): s.foundations.append( MountOlympus_Foundation(x, y, self, suit=i // 2, base_rank=ACE, dir=2, max_move=0, max_cards=7)) x += l.XS x, y = l.XM + l.XS, l.YM + l.YS for i in range(8): s.foundations.append( MountOlympus_Foundation(x, y, self, suit=i // 2, base_rank=1, dir=2, max_move=0, max_cards=6)) x += l.XS x, y = l.XM, l.YM + 2 * l.YS for i in range(9): s.rows.append(self.RowStack_Class(x, y, self, dir=-2)) x += l.XS s.talon = DealRowTalonStack(l.XM, l.YM, self) l.createText(s.talon, 's') # define stack-groups l.defaultStackGroups()
def createGame(self, playcards=5): # create layout l, s = Layout(self), self.s # set window w = max(2 * l.XS, l.XS + (playcards - 1) * l.XOFFSET) self.setSize(l.XM + 5 * w, l.YM + 4 * l.YS) # create stacks y = l.YM for i in range(5): x = l.XM + i * w s.rows.append(self.RowStack_Class(x, y, self)) for i in range(2): y = y + l.YS for j in (0, 1, 3, 4): x = l.XM + j * w s.rows.append(self.RowStack_Class(x, y, self)) y = y + l.YS for i in range(4): x = l.XM + i * w s.rows.append(self.RowStack_Class(x, y, self)) for r in s.rows: r.CARD_XOFFSET = l.XOFFSET r.CARD_YOFFSET = 0 x, y = l.XM + 2 * w, l.YM + 3 * l.YS / 2 s.foundations.append( BlackHole_Foundation(x, y, self, suit=ANY_SUIT, dir=0, mod=13, max_move=0, max_cards=52)) l.createText(s.foundations[0], "s") x, y = l.XM + 4 * w, self.height - l.YS s.talon = InitialDealTalonStack(x, y, self) # define stack-groups l.defaultStackGroups()
def createGame(self): # create layout l, s = Layout(self), self.s # set window # (set size so that at least 13 cards are fully playable) w = max(3*l.XS, l.XS+13*l.XOFFSET) self.setSize(l.XM+2*w+2*l.XS, l.YM + 5*l.YS + l.TEXT_HEIGHT) # create stacks x, y = l.XM, l.YM+4*l.YS s.talon = InitialDealTalonStack(x, y, self) x, y = l.XM+w-l.XS, self.height-l.YS for i in range(4): stack = OpenStack(x, y, self, max_accept=0) s.reserves.append(stack) l.createText(stack, 'n') x += l.XS x = l.XM + w for x in (l.XM + w, l.XM + w + l.XS): y = l.YM for i in range(4): s.foundations.append(RK_FoundationStack(x, y, self, max_move=0)) y += l.YS for x in (l.XM, l.XM + w + 2*l.XS): y = l.YM for i in range(4): stack = RK_RowStack( x, y, self, max_move=1, max_accept=1, base_rank=ANY_RANK) stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0 s.rows.append(stack) y += l.YS l.setRegion(s.rows[:4], (-999, -999, w-l.CW/2, l.YM+4*l.YS-l.CH/2)) # define stack-groups l.defaultStackGroups() # set regions l.defaultRegions()
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()
def createGame(self): # create layout l, s = Layout(self, TEXT_HEIGHT=40), self.s help, text_width = self._getHelpText() text_width += 2*l.XM # set window w = l.XM+5.5*l.XS+text_width h = max(2*l.YS, 20*l.YOFFSET) self.setSize(w, l.YM + l.YS + l.TEXT_HEIGHT + h) # create stacks x0 = l.XM + l.XS * 3 // 2 x, y = x0, l.YM for i in range(4): stack = self.Foundation_Class(x, y, self, mod=13, dir=i+1, base_rank=i) s.foundations.append(stack) tx, ty, ta, tf = l.getTextAttr(stack, "s") font = self.app.getFont("canvas_default") stack.texts.misc = MfxCanvasText(self.canvas, tx, ty, anchor=ta, font=font) x = x + l.XS self.texts.help = MfxCanvasText( self.canvas, x + l.XM, y + l.CH // 2, text=help, anchor="w", font=self.app.getFont("canvas_fixed")) x = x0 y = l.YM + l.YS + l.TEXT_HEIGHT for i in range(4): s.rows.append(self.RowStack_Class(x, y, self)) x = x + l.XS self.setRegion(s.rows, (-999, y-l.CH//2, 999999, 999999)) x = l.XM s.talon = WasteTalonStack(x, y, self, max_rounds=1) l.createText(s.talon, "n") y = y + l.YS s.waste = WasteStack(x, y, self, max_cards=1) # define stack-groups l.defaultStackGroups()
def createGame(self): # , rows=9, reserves=8): # create layout l, s = Layout(self), self.s # set size self.setSize(l.XM + 10 * l.XS, l.YM + (5 + len(self.Foundation_Classes)) * l.YS) # playcards = 4 * l.YS / l.YOFFSET xoffset, yoffset = [], [] for i in range(playcards): xoffset.append(0) yoffset.append(l.YOFFSET) for i in range(104 - playcards): xoffset.append(l.XOFFSET) yoffset.append(0) # create stacks y = l.YM for found_class in self.Foundation_Classes: x = l.XM for i in range(8): s.foundations.append( found_class(x, y, self, suit=ANY_SUIT, max_move=0)) x += l.XS y += l.YS x, y = l.XM, l.YM + l.YS * len(self.Foundation_Classes) self.setRegion(s.foundations, (-999, -999, 999999, y - l.XM / 2)) for i in range(8): stack = self.RowStack_Class(x, y, self, max_move=1) stack.CARD_XOFFSET = xoffset stack.CARD_YOFFSET = yoffset s.rows.append(stack) x += l.XS s.talon = self.Talon_Class(l.XM + 9 * l.XS, l.YM, self) l.createText(s.talon, "s") # define stack-groups l.defaultStackGroups()
def createGame(self): # create layout l, s = Layout(self), self.s s.addattr(xwastes=[]) # register extra stack variable # set window w, h = l.XM+11*l.XS, l.YM+6*l.YS self.setSize(w, h) # create stacks x, y, = l.XM, l.YM s.talon = Interment_Talon(x, y, self) l.createText(s.talon, 'ne') x += 1.5*l.XS for i in range(8): s.foundations.append(SS_FoundationStack(x, y, self, suit=i/2)) x += l.XS x, y = l.XM, l.YM+l.YS for i in range(3): stack = Interment_Waste(x, y, self, max_cards=UNLIMITED_CARDS) l.createText(stack, 'ne') s.xwastes.append(stack) y += l.YS x, y = l.XM+1.5*l.XS, l.YM+l.YS for i in range(8): s.rows.append(SS_RowStack(x, y, self, max_move=1)) x += l.XS x, y = self.width-l.XS, l.YM stack = Interment_Reserve(x, y, self) s.reserves.append(stack) l.createText(stack, 'nw') y += l.YS for i in range(5): s.reserves.append(OpenStack(x, y, self)) y += l.YS # define stack-groups l.defaultStackGroups() self.sg.dropstacks += s.xwastes self.sg.openstacks += s.xwastes self.sg.dropstacks.append(s.talon)
def createGame(self): # create layout l, s = Layout(self), self.s # set window w, h = l.XM + 12 * l.XS, l.YM + 5 * l.YS self.setSize(w, h) # create stacks x = l.XM for i in range(12): for y in (l.YM, l.YM + 4 * l.YS): stack = Zodiac_RowStack(x, y, self, base_rank=NO_RANK) s.rows.append(stack) stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, 0 x += l.XS x = l.XM + 4 * l.XS for i in range(4): y = l.YM + l.YS s.foundations.append(Zodiac_Foundation(x, y, self, suit=i)) y += 2 * l.YS s.foundations.append( Zodiac_Foundation(x, y, self, suit=i, base_rank=KING, dir=-1)) x += l.XS x, y = l.XM + 2 * l.XS, l.YM + 2 * l.YS for i in range(8): s.reserves.append(Zodiac_ReserveStack(x, y, self)) x += l.XS x, y = l.XM + l.XS, l.YM + l.YS s.talon = WasteTalonStack(x, y, self, max_rounds=UNLIMITED_REDEALS) 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 createGame(self): l, s = Layout(self), self.s self.setSize(l.XM+5.5*l.XS, l.YM+4*l.YS) x, y = l.XM, l.YM+l.YS s.talon = WasteTalonStack(x, y, self, max_rounds=3) l.createText(s.talon, 'ne') l.createRoundText(s.talon, 'nn') y += l.YS s.waste = WasteStack(x, y, self) l.createText(s.waste, 'ne') x, y = l.XM+1.5*l.XS, l.YM for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i, max_cards=13)) x += l.XS x = l.XM+1.5*l.XS y += l.YS for i in range(4): s.rows.append(AbstractFoundationStack(x, y, self, suit=i, max_cards=1, max_move=0, base_rank=QUEEN)) x += l.XS x = l.XM+1.5*l.XS y += l.YS for i in range(4): s.rows.append(AbstractFoundationStack(x, y, self, suit=i, max_cards=1, max_move=0, base_rank=JACK)) x += l.XS x = l.XM+1.5*l.XS y += l.YS for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i, mod=13, max_cards=11, base_rank=9, dir=-1)) x += l.XS l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM + 13 * l.XS, l.YM + 7 * l.YS) self.base_rank = ANY_RANK self.draws_with_open = 0 x, y = l.XM + 2.5 * l.XS, l.YM for i in range(8): s.foundations.append( StepUp_Foundation(x, y, self, suit=i % 4, mod=13, base_rank=ANY_RANK)) x += l.XS tx, ty, ta, tf = l.getTextAttr(s.foundations[0], "sw") font = self.app.getFont("canvas_default") self.texts.info = MfxCanvasText(self.canvas, tx, ty, anchor=ta, font=font) x, y = l.XM, l.YM + l.YS for i in range(13): s.reserves.append(ReserveStack(x, y, self)) x += l.XS x, y = l.XM + 2 * l.XS, l.YM + 2 * l.YS for i in range(9): s.rows.append(StepUp_RowStack(x, y, self, max_move=1, mod=13)) x += l.XS x, y = l.XM, l.YM + 2.5 * l.YS s.talon = StepUp_Talon(x, y, self, max_rounds=1) l.createText(s.talon, 'se') y += l.YS s.waste = WasteStack(x, y, self) l.createText(s.waste, 'se') l.defaultStackGroups()
def createGame(self): # create layout l, s = Layout(self, card_x_space=4, card_y_space=4), self.s # set window self.setSize(l.XM + 9 * l.XS, l.YM + 6 * l.YS) # create stacks for i in range(6): for j in range(9): x, y, = l.XM + j * l.XS, l.YM + i * l.YS s.rows.append( Maze_RowStack(x, y, self, max_accept=1, max_cards=1)) # s.talon = InitialDealTalonStack(-2*l.XS, l.YM+5*l.YS/2, self) s.talon = InitialDealTalonStack(self.width - l.XS + 1, self.height - l.YS, self) # create an invisble stack to hold the four Kings s.internals.append(InvisibleStack(self)) # define stack-groups l.defaultStackGroups()
def createGame(self, rows=12): l, s = Layout(self), self.s self.setSize(l.XM+rows*l.XS, l.YM+2*l.YS+l.TEXT_HEIGHT+20*l.YOFFSET) x, y = l.XM+(rows-4)/2*l.XS, l.YM for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i, mod=13, max_cards=26)) x += l.XS x, y = l.XM, l.YM+l.YS+l.TEXT_HEIGHT for i in range(rows): s.rows.append(RK_RowStack(x, y, self, mod=13)) x += l.XS x, y = l.XM, l.YM s.talon = WasteTalonStack(x, y, self, num_deal=2, max_rounds=1) l.createText(s.talon, 's') x = x + l.XS s.waste = WasteStack(x, y, self, max_cards=2) s.waste.CARD_XOFFSET = l.XOFFSET l.defaultStackGroups()
def createGame(self, rows=8): l, s = Layout(self), self.s w, h = l.XM+rows*l.XS, l.YM+2*l.YS+14*l.YOFFSET self.setSize(w, h) x, y = l.XM, l.YM for i in range(rows): s.rows.append( RK_RowStack( x, y, self, max_cards=13, mod=13, dir=1, max_move=1)) x += l.XS x, y = l.XM, h-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') l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM+12*l.XS, l.YM+3*l.YS+3*l.YOFFSET) x, y = l.XM, l.YM for i in range(12): s.rows.append(Nestor_RowStack(x, y, self, max_move=1, max_accept=1, dir=0, base_rank=NO_RANK)) x += l.XS x, y = l.XM, self.height-l.YS s.talon = TalonStack(x, y, self) l.createText(s.talon, 'n') x, y = self.width-l.XS, self.height-l.YS s.foundations.append(AbstractFoundationStack(x, y, self, suit=ANY_SUIT, max_move=0, max_cards=52, base_rank=ANY_RANK, max_accept=0)) l.createText(s.foundations[0], "n") l.defaultStackGroups()
def createGame(self, rows=8): l, s = Layout(self), self.s self.setSize(l.XM+rows*l.XS, l.YM+2*l.YS+10*l.YOFFSET) x, y = l.XM, l.YM s.talon = Strategerie_Talon(x, y, self) l.createText(s.talon, 'ne') x = self.width-l.XS stack = self.Foundation_Class(x, y, self, suit=ANY_SUIT, max_cards=52, max_move=0, mod=13, base_rank=ANY_RANK) s.foundations.append(stack) l.createText(stack, 'nw') x, y = l.XM, l.YM+l.YS for i in range(rows): s.rows.append(CircleNine_RowStack(x, y, self, max_accept=1, max_move=1, base_rank=NO_RANK)) x += l.XS l.defaultStackGroups() self.sg.dropstacks.append(s.talon)
def createGame(self, reserves=6): l, s = Layout(self), self.s w, h = 3*l.XM+5*l.XS, l.YM+5*l.YS self.setSize(w, h) lay = ((0, 2, 0, QUEEN, -1), (0, 1, 0, QUEEN, -1), (0, 0, 1, QUEEN, -1), (2, 0, 1, QUEEN, -1), (1, 0, 2, QUEEN, -1), (2, 1, 3, QUEEN, -1), (2, 2, 3, QUEEN, -1), (1, 1, 2, KING, 1), ) for xx, yy, suit, base_rank, dir in lay: x, y = 2*l.XM+l.XS+xx*l.XS, l.YM+yy*l.YS stack = SS_FoundationStack(x, y, self, suit=suit, max_move=0, base_rank=base_rank, dir=dir, mod=13) s.foundations.append(stack) for x, y in ((l.XM, l.YM), (3*l.XM+4*l.XS, l.YM)): for i in range(5): stack = RK_RowStack(x, y, self, dir=1, base_rank=NO_RANK, max_move=1, mod=13) stack.CARD_YOFFSET = 0 s.rows.append(stack) y += l.YS x, y = 2*l.XM+1.5*l.XS, l.YM+4*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') l.defaultStackGroups()
def createGame(self): # create layout l, s = Layout(self), self.s # set window self.setSize(l.XM + 5 * l.XS, l.YM + 3 * l.YS) # create stacks x, y = l.XM + l.XS, l.YM + 2 * l.YS s.talon = RightAndLeft_Talon(x, y, self, max_rounds=UNLIMITED_REDEALS) l.createText(s.talon, 'se') x, y = l.XM + 0.5 * l.XS, l.YM for i in range(2): stack = Nestor_RowStack(x, y, self, max_move=1, max_accept=1, dir=0, base_rank=NO_RANK) stack.CARD_YOFFSET = 0 l.createText(stack, 's') s.rows.append(stack) x += l.XS x += 1.5 * l.XS s.foundations.append( AbstractFoundationStack(x, y, self, suit=ANY_SUIT, max_move=0, max_cards=104, max_accept=0, base_rank=ANY_RANK)) l.createText(s.foundations[0], 's') # define stack-groups l.defaultStackGroups()
def createGame(self, pyramid_len=7, reserves=0, waste=True, texts=True): # create layout l, s = Layout(self), self.s # set window w = l.XM + 13 * l.XS h = l.YM + 4 * l.YS self.setSize(w, h) # create stacks x, y = l.XM + l.XS // 2, l.YM s.rows = self._createPyramid(l, x, y, 7) x += 5.5 * l.XS s.rows += self._createInvertedPyramid(l, x, y, 7) x, y = l.XM, l.YM s.talon = self.Talon_Class(x, y, self) l.createText(s.talon, "se") l.createRoundText(s.talon, 'ne') y += l.YS s.waste = self.WasteStack_Class(x, y, self, max_accept=1) l.createText(s.waste, "se") x, y = self.width - l.XS, self.height - l.YS s.foundations.append( self.Foundation_Class(x, y, self, suit=ANY_SUIT, dir=0, base_rank=ANY_RANK, max_move=0, max_cards=104)) l.createText(s.foundations[0], 'sw') # define stack-groups l.defaultStackGroups() self.sg.openstacks.append(s.talon) self.sg.dropstacks.append(s.talon) self.sg.openstacks.append(s.waste)
def createGame(self, rows=8, reserves=6, playcards=12): # create layout l, s = Layout(self), self.s # set window decks = self.gameinfo.decks foundations = decks * 4 max_rows = max(foundations, rows) w, h = l.XM + (max_rows + 1) * l.XS, l.YM + 3 * l.YS + playcards * l.YOFFSET self.setSize(w, h) # create stacks x, y = l.XM + l.XS + (max_rows - foundations) * l.XS // 2, l.YM for fclass in self.Foundation_Classes: for i in range(4): s.foundations.append(fclass(x, y, self, suit=i)) x += l.XS x, y = l.XM + l.XS + (max_rows - rows) * l.XS // 2, l.YM + l.YS for i in range(rows): s.rows.append( self.RowStack_Class(x, y, self, max_move=1, max_accept=1)) x += l.XS self.setRegion(s.rows, (-999, y - l.CH // 2, 999999, h - l.YS - l.CH // 2)) d = (w - reserves * l.XS) // reserves x, y = l.XM, h - l.YS for i in range(reserves): stack = ReserveStack(x, y, self) stack.CARD_XOFFSET, stack.CARD_YOFFSET = 2, 0 s.reserves.append(stack) x += l.XS + d s.talon = self.Talon_Class(l.XM, l.YM, self) l.createText(s.talon, "s") # define stack-groups l.defaultStackGroups()
def createGame(self): # create layout l, s = Layout(self, card_x_space=20, card_y_space=20), self.s # set window self.setSize(5 * l.XS + l.XM, 3 * l.YS + l.YM + l.YM) # create stacks x = l.XM y = l.YM s.talon = WasteTalonStack(x, y, self, max_rounds=1) l.createText(s.talon, "s") x = x + l.XS s.waste = WasteStack(x, y, self) l.createText(s.waste, "s") x0, y0 = x + l.XS, y for d in ((0, 1), (1, 0), (1, 2), (2, 1)): x, y = x0 + d[0] * l.XS, y0 + d[1] * l.YS s.rows.append(Windmill_RowStack(x, y, self)) x, y = x0 + l.XS, y0 + l.YS s.foundations.append( Windmill_Foundation(x, y, self, base_rank=5, mod=13, max_cards=24, dir=-1)) for d in ((0.1, 0.1), (1.9, 0.1), (0.1, 1.9), (1.9, 1.9)): x, y = x0 + d[0] * l.XS, y0 + d[1] * l.YS s.foundations.append( Windmill_Foundation(x, y, self, max_cards=7, base_rank=6, mod=13)) # define stack-groups l.defaultStackGroups()
def createGame(self, rows=9, max_rounds=1, num_deal=1, playcards=16): # create layout l, s = Layout(self), self.s # set window # (piles up to 16 cards are playable in default window size) decks = self.gameinfo.decks maxrows = max(rows, decks*4+1) w1, w2 = (maxrows - decks*4)*l.XS//2, (maxrows - rows)*l.XS//2 h = max(3*l.YS, playcards*l.YOFFSET) self.setSize(l.XM + maxrows*l.XS + l.XM, l.YM + 3*l.YS + h) # extra settings self.base_rank = None # create stacks x, y = l.XM + w1, l.YM s.talon = self.Talon_Class( x, y, self, max_rounds=max_rounds, num_deal=num_deal) l.createText(s.talon, "sw") x = x + l.XS s.waste = WasteStack(x, y, self) l.createText(s.waste, "se", text_format="%D") x = x + 2*l.XS stack = self.ReserveStack_Class(x, y, self) stack.CARD_XOFFSET = l.XOFFSET l.createText(stack, "sw") s.reserves.append(stack) x, y = l.XM + w1, y + l.YS for i in range(4): for j in range(decks): s.foundations.append(self.Foundation_Class(x, y, self, suit=i)) x = x + l.XS x, y = l.XM + w2, y + l.YS for i in range(rows): s.rows.append(self.RowStack_Class(x, y, self)) x = x + l.XS # define stack-groups l.defaultStackGroups()
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()
def createGame(self): l, s = Layout(self), self.s font = self.app.getFont("canvas_default") # Set window size h = max(5 * l.YS, 20 * l.YOFFSET) self.setSize(l.XM + 9 * l.XS, l.YM + l.YS + h) # Create foundations x = self.width - l.XS y = l.YM s.foundations.append(SS_FoundationStack(x, y, self, 4, max_cards=22)) y = y + l.YS for i in range(4): s.foundations.append( SS_FoundationStack(x, y, self, i, max_cards=14)) y = y + l.YS # Create rows x = l.XM y = l.YM for j in range(2): for i in range(8): s.rows.append( Excuse_RowStack(x, y, self, max_move=1, max_accept=1, base_rank=NO_RANK)) x = x + l.XS x = l.XM y = y + l.YS * 3 self.setRegion(s.rows, (-999, -999, l.XM + l.XS * 8, 999999)) # Create talon s.talon = InitialDealTalonStack(l.XM, self.height - l.YS, self) # Define stack groups l.defaultStackGroups()
def createGame(self): # create layout layout, s = Layout(self), self.s # set window h = layout.YM + layout.YS + 4 * layout.YOFFSET self.setSize(layout.XM + 7 * layout.XS, 3 * layout.YM + 2 * h + layout.YS) # create stacks x, y = layout.XM, layout.YM for i in range(7): s.rows.append(self.RowStack_Class(x, y, self)) x += layout.XS x, y = layout.XM, layout.YM + h for i in range(6): s.rows.append(self.RowStack_Class(x, y, self)) x += layout.XS for r in s.rows: r.CARD_XOFFSET, r.CARD_YOFFSET = 0, layout.YOFFSET x, y = layout.XM, self.height - layout.YS stack = BlackHole_Foundation(x, y, self, ANY_SUIT, dir=0, mod=13, max_move=0, max_cards=52, base_rank=ANY_RANK) s.foundations.append(stack) stack.CARD_XOFFSET, stack.CARD_YOFFSET = (self.width - layout.XS) // 51, 0 layout.createText(stack, 'n') x = self.width - layout.XS s.talon = InitialDealTalonStack(x, y, self) # define stack-groups layout.defaultStackGroups()
def createGame(self): # create layout l, s = Layout(self), self.s # set window self.setSize(l.XM + 7*l.XS, l.YM + l.TEXT_HEIGHT + 5*l.YS) # create stacks x, y = l.XM, l.YM s.talon = Glenwood_Talon(x, y, self, max_rounds=2, num_deal=1) l.createText(s.talon, "s") l.createRoundText(s.talon, 'ne', dx=l.XS) x += l.XS s.waste = WasteStack(x, y, self) l.createText(s.waste, "s") x += 2*l.XS for i in range(4): s.foundations.append(self.Foundation_Class(x, y, self, i, dir=1, mod=13, base_rank=ANY_RANK, max_move=0)) x += l.XS tx, ty, ta, tf = l.getTextAttr(None, "ss") tx, ty = x - l.XS + tx, y + ty font = self.app.getFont("canvas_default") self.texts.info = MfxCanvasText(self.canvas, tx, ty, anchor=ta, font=font) for i in range(4): x = l.XM + (i+3)*l.XS y = l.YM+l.TEXT_HEIGHT+l.YS s.rows.append(self.RowStack_Class(x, y, self, mod=13)) for i in range(4): x = l.XM y = l.YM+l.TEXT_HEIGHT+(i+1)*l.YS stack = self.ReserveStack_Class(x, y, self) s.reserves.append(stack) stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0 # define stack-groups l.defaultStackGroups()
def createGame(self): # create layout l, s = Layout(self), self.s # set window w, h = max(2 * l.XM + 2 * l.XS + (5 + 13) * l.XOFFSET, l.XM + 8 * l.XS), l.YM + 8 * l.YS self.setSize(w, h) # create stacks x, y, = l.XM, l.YM for i in range(4): stack = BasicRowStack(x, y, self, max_move=1, max_accept=0) stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0 s.rows.append(stack) y += l.YS x, y, = 2 * l.XM + l.XS + 5 * l.XOFFSET, l.YM for i in range(4): stack = Osmosis_Foundation(x, y, self, i, base_rank=ANY_RANK, max_move=0) stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0 s.foundations.append(stack) y += l.YS y = l.YM + 4 * l.YS for i in range(4): x = l.XM for j in range(8): s.reserves.append(OpenStack(x, y, self, max_accept=0)) x += l.XS y += l.YS x, y = w - l.XS, l.YM s.talon = InitialDealTalonStack(x, y, self) # define stack-groups l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM + 9 * l.XS, l.YM + 4 * l.YS) x, y = l.XM, l.YM s.talon = SlyFox_Talon(x, y, self) s.waste = s.talon l.createText(s.talon, 'ne') tx, ty, ta, tf = l.getTextAttr(s.talon, "ss") font = self.app.getFont("canvas_default") self.texts.misc = MfxCanvasText(self.canvas, tx, ty, anchor=ta, font=font) y = l.YM for i in range(4): x = l.XM + 1.5 * l.XS for j in range(5): stack = SlyFox_RowStack(x, y, self, max_cards=UNLIMITED_CARDS) stack.CARD_YOFFSET = 0 s.rows.append(stack) x += l.XS y += l.YS x, y = self.width - 2 * l.XS, l.YM for i in range(4): s.foundations.append(SlyFox_Foundation(x, y, self, suit=i)) s.foundations.append( SlyFox_Foundation(x + l.XS, y, self, suit=i, base_rank=KING, dir=-1)) y += l.YS l.defaultStackGroups()
def createGame(self): # create layout l, s = Layout(self, card_x_space=4), self.s # game extras self.other_stack = None self.closed_cards = -1 self.score = 0 # set window self.setSize(l.XM + self.COLUMNS * l.XS, l.YM + (self.ROWS + 1) * l.YS) # create stacks for i in range(self.ROWS): for j in range(self.COLUMNS): x, y = l.XM + j * l.XS, l.YM + i * l.YS s.rows.append( Concentration_RowStack(x, y, self, max_move=0, max_accept=0, max_cards=1)) x, y = l.XM + self.COLUMNS * l.XS / 2, self.height - l.YS s.talon = InitialDealTalonStack(x, y, self) l.createText(s.talon, dx=-10, anchor="sw", text_format="%D") # create text x, y = l.XM, self.height - l.YM if self.preview <= 1: self.texts.score = MfxCanvasText( self.canvas, x, y, anchor="sw", font=self.app.getFont("canvas_large")) # define stack-groups l.defaultStackGroups()
def createGame(self): # create layout layout, s = Layout(self), self.s # set window ww = layout.XS + max(2*layout.XOFFSET, layout.XS//2) w = layout.XM + 1.5*layout.XS + 4*ww h = layout.YM + 3*layout.YS self.setSize(w, h) # create stacks for xx, yy in ((0, 0), (1, 0), (2, 0), (3, 0), (0, 1), (3, 1), (0, 2), (1, 2), (2, 2), (3, 2), ): x, y = layout.XM + 1.5*layout.XS + ww*xx, layout.YM + layout.YS*yy stack = Hurricane_Reserve(x, y, self, max_accept=1) stack.CARD_XOFFSET, stack.CARD_YOFFSET = layout.XOFFSET, 0 s.reserves.append(stack) d = 3*ww - 4*layout.XS - 2*layout.XOFFSET x = layout.XM + 1.5*layout.XS + layout.XS+2*layout.XOFFSET + d//2 y = layout.YM+layout.YS for i in range(3): stack = Hurricane_RowStack(x, y, self, max_accept=1) s.rows.append(stack) x += layout.XS x, y = layout.XM, layout.YM s.talon = TalonStack(x, y, self) layout.createText(s.talon, 'ne') y += 2*layout.YS s.foundations.append(AbstractFoundationStack(x, y, self, suit=ANY_SUIT, dir=0, base_rank=ANY_RANK, max_accept=0, max_move=0, max_cards=52)) layout.createText(s.foundations[0], 'ne') # define stack-groups layout.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s # Set window size self.setSize(l.XM + l.XS * 13, l.YM * 2 + l.YS * 6) # Create left foundations x = l.XM y = l.YM s.foundations.append(Gaji_Foundation(x, y, self, -1, base_rank=0)) x += l.XS s.foundations.append(Gaji_Foundation(x, y, self, -1, base_rank=1)) # Create right foundations x = self.width - l.XS * 2 s.foundations.append(Gaji_Foundation(x, y, self, -1, base_rank=2)) x += l.XS s.foundations.append(Gaji_Foundation(x, y, self, -1, base_rank=3)) # Create row stacks x = l.XS * 2.5 + l.XM for i in range(8): s.rows.append( Gaji_RowStack(x, y, self, yoffset=l.CH // 2, max_cards=12, max_accept=12)) x += l.XS self.setRegion(s.rows, (l.XM + l.XS * 2, -999, l.XM + l.XS * 10, 999999)) # Create talon s.talon = InitialDealTalonStack(self.width - l.XS, self.height - l.YS, self) # Define stack groups l.defaultStackGroups()