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()
def createGame(self, max_rounds=-1, num_deal=1, **layout): # create layout l, s = Layout(self), self.s kwdefault(layout, rows=9, waste=1, texts=1, playcards=19) self.Layout_Method(l, **layout) self.setSize(l.size[0], l.size[1]) # create stacks s.talon = WasteTalonStack(l.s.talon.x, l.s.talon.y, self, max_rounds=max_rounds, num_deal=num_deal) s.waste = WasteStack(l.s.waste.x, l.s.waste.y, self) for r in l.s.foundations: s.foundations.append( self.Foundation_Class(r.x, r.y, self, suit=r.suit)) for r in l.s.rows: s.rows.append(self.RowStack_Class(r.x, r.y, self)) # default l.defaultAll() # extra if max_rounds > 1: anchor = 'nn' if layout.get("texts"): anchor = 'nnn' l.createRoundText(s.talon, anchor) return l
def createGame(self): # create layout l, s = Layout(self), self.s # set window self.setSize(l.XM + 8 * l.XS, l.YM + l.YS + 20 * l.YOFFSET) # create stacks s.talon = Labyrinth_Talon(l.XM, l.YM, self) 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 += l.XS x, y = l.XM, l.YM + l.YS for i in range(6): x = l.XM for j in range(8): s.rows.append(Labyrinth_RowStack(x, y, self, max_move=1)) x += l.XS y += l.YOFFSET # default l.defaultAll()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM+8*l.XS, l.YM+max(4*l.YS, 3*l.YS+14*l.YOFFSET)) x, y = l.XM, self.height-l.YS for i in range(4): suit = i if self.Foundation_Class_1 is RK_FoundationStack: suit = ANY_SUIT s.foundations.append( self.Foundation_Class_1(x, y, self, suit=suit)) x += l.XS for i in range(4): suit = i if self.Foundation_Class_1 is RK_FoundationStack: suit = ANY_SUIT s.foundations.append( self.Foundation_Class_2(x, y, self, suit=suit)) x += l.XS x, y = l.XM+2*l.XS, l.YM+l.YS for i in range(4): s.rows.append(LadyOfTheManor_RowStack(x, y, self, max_accept=0)) x += l.XS for i, j in ((0, 2), (0, 1), (0, 0), (1, 0), (2, 0), (3, 0), (4, 0), (5, 0), (6, 0), (7, 0), (7, 1), (7, 2), ): x, y = l.XM+i*l.XS, l.YM+j*l.YS s.reserves.append(LadyOfTheManor_Reserve(x, y, self, max_accept=0)) s.talon = InitialDealTalonStack( self.width-l.XS, self.height-2*l.YS, self) l.defaultAll()
def createGame(self): # create layout l, s = Layout(self), self.s # set window playcards = 7 w, h = l.XM+l.XS+4*(l.XS+(playcards-1)*l.XOFFSET), l.YM+4*l.YS self.setSize(w, h) # create stacks x, y = l.XM, l.YM for i in range(2): s.foundations.append(SS_FoundationStack(x, y, self, suit=i)) y += l.YS for i in range(2): s.foundations.append(SS_FoundationStack(x, y, self, suit=i+2, base_rank=KING, dir=-1)) y += l.YS x = l.XM+l.XS for i in range(4): y = l.YM for j in range(4): stack = CloverLeaf_RowStack(x, y, self, max_move=1, max_accept=1) s.rows.append(stack) stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0 y += l.YS x += l.XS+(playcards-1)*l.XOFFSET s.talon = InitialDealTalonStack(w-l.XS, h-l.YS, self) # default l.defaultAll()
def createGame(self): l, s = Layout(self), self.s font = self.app.getFont("canvas_card") # Set window size self.setSize(l.XM + l.XS * 7, l.YM + l.YS * 5) # Create rows x, y, offset = l.XM, l.YM, self.app.images.CARD_YOFFSET for i in range(6): s.rows.append(Samuri_RowStack(x, y, self, offset, max_cards=8, max_accept=8, base_rank=0)) x = x + l.XS + l.XM + (l.XM * (i == 2)) x, y = l.XM, y + l.YS * 2.5 for i in range(6): s.rows.append(Samuri_RowStack(x, y, self, offset, max_cards=8, max_accept=8, base_rank=0)) x = x + l.XS + l.XM + (l.XM * (i == 2)) self.setRegion(s.rows, (0, 0, 999999, 999999)) # Create talon s.talon = InitialDealTalonStack(-l.XS, -l.YS, self) # Define stack-groups l.defaultAll()
def createGame(self): # create layout l, s = Layout(self), self.s # set window self.setSize(l.XM+8*l.XS, l.YM+l.YS+20*l.YOFFSET) # create stacks s.talon = Labyrinth_Talon(l.XM, l.YM, self) 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 += l.XS x, y = l.XM, l.YM+l.YS for i in range(6): x = l.XM for j in range(8): s.rows.append(Labyrinth_RowStack(x, y, self, max_move=1)) x += l.XS y += l.YOFFSET # default l.defaultAll()
def createGame(self, rows=8, reserves=4, playcards=6): l, s = Layout(self), self.s self.setSize(l.XM + rows * l.XS, l.YM + 3 * l.YS + playcards * l.YOFFSET) dx = (self.width - l.XM - (reserves + 1) * l.XS) // 3 x, y = l.XM + dx, l.YM for i in range(reserves): s.reserves.append(ReserveStack(x, y, self)) x += l.XS x += dx max_cards = 52 * self.gameinfo.decks s.foundations.append( RK_FoundationStack(x, y, self, base_rank=ANY_RANK, mod=13, max_cards=max_cards)) l.createText(s.foundations[0], 'ne') x, y = l.XM, l.YM + l.YS for i in range(rows): s.rows.append(BasicRowStack(x, y, self)) x += l.XS s.talon = InitialDealTalonStack(l.XM, self.height - l.YS, self) l.defaultAll()
def createGame(self): # create layout l, s = Layout(self), self.s # set window w, h = 3 * l.XM + 8 * l.XS, l.YM + 2 * l.YS + 15 * l.YOFFSET self.setSize(w, h) # create stacks x, y = 2 * l.XM, l.YM + l.YS for i in range(8): s.rows.append(self.RowStack_Class(x, y, self)) x += l.XS y = l.YM for i in range(4): x = l.XM + i * l.XS s.foundations.append(SS_FoundationStack(x, y, self, i, max_move=0)) x += 2 * l.XM + 4 * l.XS s.foundations.append( SS_FoundationStack(x, y, self, i, base_rank=KING, max_move=0, dir=-1)) s.talon = InitialDealTalonStack(w - l.XS, h - l.YS, self) # default l.defaultAll()
def createGame(self): # create layout l, s = Layout(self), self.s # set window w, h = l.XM+(8+2)*l.XS, l.YM+max(3*(l.YS+8*l.YOFFSET), 8*l.YS) self.setSize(w, h) # create stacks y = l.YM for i in range(3): x = l.XM for j in range(8): s.rows.append(UD_SS_RowStack(x, y, self, base_rank=NO_RANK)) x += l.XS y += l.YS+8*l.YOFFSET y = l.YM for j in range(2): for i in range(4): x = l.XM+8*l.XS s.foundations.append(SS_FoundationStack(x, y, self, suit=j*2+i//2, max_move=0)) x += l.XS s.foundations.append( SS_FoundationStack( x, y, self, suit=j*2+i//2, base_rank=KING, max_move=0, dir=-1)) y += l.YS s.talon = InitialDealTalonStack(l.XM, h-l.YS, self) # default l.defaultAll()
def createGame(self): # create layout l, s = Layout(self), self.s # set window w, h = 3*l.XM+8*l.XS, l.YM+2*l.YS+15*l.YOFFSET self.setSize(w, h) # create stacks x, y = 2*l.XM, l.YM+l.YS for i in range(8): s.rows.append(self.RowStack_Class(x, y, self)) x += l.XS y = l.YM for i in range(4): x = l.XM+i*l.XS s.foundations.append(SS_FoundationStack(x, y, self, i, max_move=0)) x += 2*l.XM+4*l.XS s.foundations.append(SS_FoundationStack(x, y, self, i, base_rank=KING, max_move=0, dir=-1)) s.talon = InitialDealTalonStack(w-l.XS, h-l.YS, self) # default l.defaultAll()
def createGame(self): # create layout l, s = Layout(self), self.s # set window w, h = 3*l.XM+10*l.XS, 2*l.YM+2*l.YS+16*l.YOFFSET self.setSize(w, h) # create stacks s.talon = self.Talon_Class(l.XM, h-l.YS, self) x, y = 3*l.XM + 6*l.XS, l.YM for i in range(4): s.foundations.append( self.Foundation_Class( x, y, self, suit=i, mod=13, max_cards=26)) x += l.XS x, y = 2*l.XM, l.YM + l.YS + l.YM for i in range(10): s.rows.append(self.RowStack_Class(x, y, self)) x += l.XS x, y = l.XM, l.YM for i in range(6): s.reserves.append(ReserveStack(x, y, self)) x += l.XS # default l.defaultAll()
def createGame(self): # create layout l, s = Layout(self), self.s # set window w, h = l.XM+12*l.XS, l.YM+2*l.YS+2*(l.YS+5*l.YOFFSET) self.setSize(w, h) # create stacks y = l.YM+2*l.YS for i in range(2): x = l.XM for j in range(12): s.rows.append(BasicRowStack(x, y, self, max_accept=0)) x += l.XS y += l.YS+5*l.YOFFSET x = l.XM+2*l.XS for j in range(2): for i in range(4): y = l.YM s.foundations.append( SS_FoundationStack(x, y, self, suit=j*2+i//2)) y += l.YS s.foundations.append(SS_FoundationStack(x, y, self, suit=j*2+i//2, base_rank=KING, dir=-1)) x += l.XS s.reserves.append(ReserveStack(l.XM, l.YM, self)) s.reserves.append(ReserveStack(w-l.XS, l.YM, self)) s.talon = InitialDealTalonStack(l.XM, l.YM+l.YS, self) # default l.defaultAll()
def createGame(self, rows=13, reserves=10, playcards=20): # create layout l, s = Layout(self), self.s # set window decks = self.gameinfo.decks max_rows = max(decks*4, rows, reserves) w, h = l.XM+max_rows*l.XS, l.YM+3*l.YS+playcards*l.YOFFSET self.setSize(w, h) # create stacks s.talon = self.Talon_Class(l.XM, h-l.YS, self) x, y = l.XM+(max_rows-decks*4)*l.XS//2, l.YM for j in range(4): for i in range(decks): s.foundations.append(self.Foundation_Class(x, y, self, suit=j)) x += l.XS x, y = l.XM+(max_rows-reserves)*l.XS//2, l.YM+l.YS for i in range(reserves): s.reserves.append(ReserveStack(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(self.RowStack_Class(x, y, self)) x += l.XS # default l.defaultAll()
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): # create layout l, s = Layout(self), self.s # set window w, h = 3 * l.XM + 10 * l.XS, 2 * l.YM + 2 * l.YS + 16 * l.YOFFSET self.setSize(w, h) # create stacks s.talon = self.Talon_Class(l.XM, h - l.YS, self) x, y = 3 * l.XM + 6 * l.XS, l.YM for i in range(4): s.foundations.append( self.Foundation_Class(x, y, self, suit=i, mod=13, max_cards=26)) x += l.XS x, y = 2 * l.XM, l.YM + l.YS + l.YM for i in range(10): s.rows.append(self.RowStack_Class(x, y, self)) x += l.XS x, y = l.XM, l.YM for i in range(6): s.reserves.append(ReserveStack(x, y, self)) x += l.XS # default l.defaultAll()
def createGame(self, rows=13, reserves=10, playcards=20): # create layout l, s = Layout(self), self.s # set window decks = self.gameinfo.decks max_rows = max(decks * 4, rows, reserves) w, h = l.XM + max_rows * l.XS, l.YM + 3 * l.YS + playcards * l.YOFFSET self.setSize(w, h) # create stacks s.talon = self.Talon_Class(l.XM, h - l.YS, self) x, y = l.XM + (max_rows - decks * 4) * l.XS / 2, l.YM for j in range(4): for i in range(decks): s.foundations.append(self.Foundation_Class(x, y, self, suit=j)) x += l.XS x, y = l.XM + (max_rows - reserves) * l.XS / 2, l.YM + l.YS for i in range(reserves): s.reserves.append(ReserveStack(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(self.RowStack_Class(x, y, self)) x += l.XS # default l.defaultAll()
def createGame(self, reserves=6): # create layout l, s = Layout(self), self.s # set window w, h = 2 * l.XM + (4 + reserves) * l.XS, l.YM + l.YS + 16 * l.YOFFSET self.setSize(w, h) # create stacks x, y = l.XM, l.YM for i in range(4): s.rows.append( self.RowStack_Class(x, y, self, max_move=1, max_accept=0)) x += l.XS x += l.XM for i in range(reserves): stack = self.Foundation_Class(x, y, self, suit=ANY_SUIT, base_rank=ANY_RANK) stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, l.YOFFSET s.foundations.append(stack) x += l.XS s.talon = InitialDealTalonStack(w - l.XS, h - l.YS, self) # default l.defaultAll()
def createGame(self, max_rounds=-1, num_deal=1, **layout): l, s = Layout(self), self.s kwdefault(layout, rows=8, waste=1) self.Layout_Method(l, **layout) self.setSize(l.size[0], l.size[1]) # Create talon s.talon = self.Talon_Class(l.s.talon.x, l.s.talon.y, self, max_rounds=max_rounds, num_deal=num_deal) s.waste = WasteStack(l.s.waste.x, l.s.waste.y, self) # Create foundations for r in l.s.foundations: s.foundations.append( self.Foundation_Class(r.x, r.y, self, suit=r.suit, base_rank=3)) # Create row stacks for r in l.s.rows: s.rows.append( self.RowStack_Class(r.x, r.y, self, base_rank=0, yoffset=l.YOFFSET)) # Define stack groups l.defaultAll()
def createGame(self, max_rounds=2, num_deal=1, **layout): l, s = Layout(self), self.s kwdefault(layout, rows=7, waste=1, playcards=20) self.Layout_Method(l, **layout) self.setSize(l.size[0], l.size[1]) # Create talon s.talon = self.Talon_Class(l.s.talon.x, l.s.talon.y, self, max_rounds=max_rounds, num_deal=num_deal) s.waste = WasteStack(l.s.waste.x, l.s.waste.y, self) # Create foundations for r in l.s.foundations[:4]: s.foundations.append(self.Foundation_Class(r.x, r.y, self, r.suit, mod=16, max_cards=16, max_move=1)) r = l.s.foundations[4] s.foundations.append(HexATrump_Foundation(r.x, r.y, self, 4, mod=4, max_move=0, max_cards=4, base_rank=ANY_RANK)) # Create rows for r in l.s.rows: s.rows.append(self.RowStack_Class(r.x, r.y, self, suit=ANY_SUIT, base_rank=ANY_RANK)) # Define stack groups l.defaultAll()
def createGame(self): l, s = Layout(self), self.s w, h = l.XM + 9 * l.XS, l.YM + l.YS + 16 * l.YOFFSET self.setSize(w, h) x, y = l.XM, l.YM for i in range(4): stack = Striptease_Reserve(x, y, self, max_move=1, min_cards=1, max_accept=0) stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, l.YOFFSET s.reserves.append(stack) x += l.XS x += l.XS for i in range(4): stack = Striptease_RowStack(x, y, self, max_move=0, mod=13) stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, l.YOFFSET s.rows.append(stack) x += l.XS s.talon = InitialDealTalonStack(w - l.XS, h - l.YS, self) l.defaultAll()
def createGame(self, max_rounds=2, num_deal=1, **layout): l, s = Layout(self), self.s kwdefault(layout, rows=12, waste=1, playcards=20) self.Layout_Method(l, **layout) self.setSize(l.size[0], l.size[1]) # Create talon s.talon = self.Talon_Class(l.s.talon.x, l.s.talon.y, self, max_rounds=max_rounds, num_deal=num_deal) s.waste = WasteStack(l.s.waste.x, l.s.waste.y, self) # Create foundations for r in l.s.foundations: s.foundations.append(self.Foundation_Class(r.x, r.y, self, r.suit, mod=16, max_cards=16, max_move=1)) # Create rows for r in l.s.rows: s.rows.append(self.RowStack_Class(r.x, r.y, self, suit=ANY_SUIT, base_rank=15)) # Create reserve x, y = l.XM, self.height - l.YS s.reserves.append(Familiar_ReserveStack(x, y, self, max_cards=3)) self.setRegion(s.reserves, (-999, y - l.YM, x + l.XS, 999999), priority=1) l.createText(s.reserves[0], "se") # Define stack groups l.defaultAll()
def createGame(self, max_rounds=-1, num_deal=3, **layout): l, s = Layout(self), self.s kwdefault(layout, rows=self.Rows, waste=1, texts=1, playcards=self.PlayCards) self.Layout_Method(l, **layout) self.setSize(l.size[0], l.size[1]) # Create stacks s.talon = self.Talon_Class(l.s.talon.x, l.s.talon.y, self, max_rounds=max_rounds, num_deal=num_deal) s.waste = WasteStack(l.s.waste.x, l.s.waste.y, self) for r in l.s.foundations: s.foundations.append( self.Foundation_Class(r.x, r.y, self, suit=ANY_SUIT, base_rank=r.suit)) for r in l.s.rows: s.rows.append( self.RowStack_Class(r.x, r.y, self, yoffset=l.YOFFSET)) l.defaultAll()
def createGame(self, rows=8, reserves=8, playcards=7): # create layout l, s = Layout(self), self.s # set window max_rows = max(rows, reserves) w, h = l.XM + max_rows * l.XS, l.YM + 2 * l.YS + ( 14 + playcards) * l.YOFFSET self.setSize(w, h) # create stacks x, y = l.XM + (max_rows - rows) * l.XS // 2, l.YM for i in range(rows): stack = self.RowStack_Class(x, y, self, base_rank=ANY_RANK) stack.getBottomImage = stack._getReserveBottomImage s.rows.append(stack) x += l.XS x, y = l.XM + (max_rows - reserves) * l.XS // 2, l.YM + l.YS + 14 * l.YOFFSET for i in range(reserves): stack = self.Reserve_Class(x, y, self) s.reserves.append(stack) stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, l.YOFFSET x += l.XS s.talon = InitialDealTalonStack(l.XM, l.YM, self) # default l.defaultAll()
def createGame(self, **layout): l, s = Layout(self), self.s kwdefault(layout, rows=14, reserves=4, texts=0) self.Layout_Method(l, **layout) self.setSize(l.size[0], l.size[1]) # Create foundations for r in l.s.foundations: s.foundations.append( self.Foundation_Class( r.x, r.y, self, r.suit, mod=12, max_cards=12)) # Create reserve stacks for r in l.s.reserves: s.reserves.append(ReserveStack(r.x, r.y, self, )) # Create row stacks for r in l.s.rows: s.rows.append( self.RowStack_Class( r.x, r.y, self, max_cards=12, suit=ANY_SUIT, base_rank=self.BASE_RANK)) # Create talon s.talon = self.Talon_Class(l.s.talon.x, l.s.talon.y, self) # Define stack groups l.defaultAll()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM + 10 * l.XS, l.YM + 2 * l.YS + 12 * l.YOFFSET) # extra settings self.base_card = None # create stacks x, y = l.XM + 3 * l.XS, l.YM for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i, mod=13)) x = x + l.XS tx, ty, ta, tf = l.getTextAttr(s.foundations[-1], "ne") 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(10): s.rows.append(UD_AC_RowStack(x, y, self, mod=13)) x += l.XS x, y = l.XM, l.YM s.talon = InitialDealTalonStack(x, y, self) # default l.defaultAll()
def createGame(self, reserves=6): # create layout l, s = Layout(self), self.s # set window w, h = 2*l.XM+10*l.XS, l.YM+l.YS+16*l.YOFFSET self.setSize(w, h) # create stacks x, y = l.XM, l.YM for i in range(4): s.rows.append(self.RowStack_Class(x, y, self, max_move=1, max_accept=0)) x += l.XS x += l.XM for i in range(6): stack = self.Foundation_Class(x, y, self, suit=ANY_SUIT, base_rank=ANY_RANK) stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, l.YOFFSET s.foundations.append(stack) x += l.XS s.talon = InitialDealTalonStack(w-l.XS, h-l.YS, self) # default l.defaultAll()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM+10*l.XS, l.YM+2*l.YS+12*l.YOFFSET) # extra settings self.base_card = None # create stacks x, y = l.XM+3*l.XS, l.YM for i in range(4): s.foundations.append(SS_FoundationStack(x, y, self, suit=i, mod=13)) x = x + l.XS tx, ty, ta, tf = l.getTextAttr(s.foundations[-1], "ne") 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(10): s.rows.append(UD_AC_RowStack(x, y, self, mod=13)) x += l.XS x, y = l.XM, l.YM s.talon = InitialDealTalonStack(x, y, self) # default l.defaultAll()
def createGame(self): # create layout l, s = Layout(self), self.s # set window w, h = 2*l.XM+8*l.XS, max(2*(l.YM+l.YS+8*l.YOFFSET), l.YM+5*l.YS) self.setSize(w, h) # create stacks x, y = l.XM, l.YM for i in range(6): s.rows.append(UD_SS_RowStack(x, y, self, base_rank=NO_RANK)) x += l.XS x, y = l.XM, l.YM+l.YS+8*l.YOFFSET for i in range(6): s.rows.append(UD_SS_RowStack(x, y, self, base_rank=NO_RANK)) x += l.XS y = l.YM for i in range(4): x = l.XM+6*l.XS+l.XM s.foundations.append(SS_FoundationStack(x, y, self, i, max_move=0)) x += l.XS s.foundations.append(SS_FoundationStack(x, y, self, i, base_rank=KING, max_move=0, dir=-1)) y += l.YS s.talon = InitialDealTalonStack(w-l.XS, h-l.YS, self) # default l.defaultAll()
def createGame(self, max_rounds=1, num_deal=1, **layout): l, s = Layout(self), self.s kwdefault(layout, rows=8, waste=1) self.Layout_Method(l, **layout) self.setSize(l.size[0], l.size[1]) # Create talon s.talon = self.Talon_Class( l.s.talon.x, l.s.talon.y, self, max_rounds=max_rounds, num_deal=num_deal) s.waste = WasteStack(l.s.waste.x, l.s.waste.y, self) # Create foundations for r in l.s.foundations: s.foundations.append( self.Foundation_Class( r.x, r.y, self, r.suit, mod=12, max_cards=12, max_move=self.MAX_MOVE)) # Create row stacks for r in l.s.rows: s.rows.append( self.RowStack_Class( r.x, r.y, self, suit=ANY_SUIT, base_rank=self.BASE_RANK)) # Define stack groups l.defaultAll()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM + 7 * l.XS, l.YM + 2 * l.YS + 12 * l.YOFFSET) x, y = l.XM, l.YM for i in range(2): s.reserves.append(OpenStack(x, y, self)) x += l.XS x, y = l.XM + 3 * l.XS, l.YM for i in range(4): s.foundations.append( DieRussische_Foundation(x, y, self, suit=i, max_cards=8)) x += l.XS x, y = l.XM + l.XS // 2, l.YM + l.YS for i in range(6): s.rows.append( Thirty_RowStack(x, y, self, max_move=UNLIMITED_MOVES, max_accept=UNLIMITED_ACCEPTS)) x += l.XS x, y = self.width - l.XS, self.height - l.YS s.talon = InitialDealTalonStack(x, y, self) l.defaultAll()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM+7*l.XS, l.YM+2*l.YS+12*l.YOFFSET) x, y = l.XM, l.YM for i in range(2): s.reserves.append(OpenStack(x, y, self)) x += l.XS x, y = l.XM+3*l.XS, l.YM for i in range(4): s.foundations.append(DieRussische_Foundation(x, y, self, suit=i, max_cards=8)) x += l.XS x, y = l.XM+l.XS/2, l.YM+l.YS for i in range(6): s.rows.append(Thirty_RowStack(x, y, self, max_move=UNLIMITED_MOVES, max_accept=UNLIMITED_ACCEPTS)) x += l.XS x, y = self.width-l.XS, self.height-l.YS s.talon = InitialDealTalonStack(x, y, self) l.defaultAll()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM+8*l.XS, l.YM+max(4*l.YS, 3*l.YS+14*l.YOFFSET)) x, y = l.XM, self.height-l.YS for i in range(4): suit = i if self.Foundation_Class_1 is RK_FoundationStack: suit = ANY_SUIT s.foundations.append(self.Foundation_Class_1(x, y, self, suit=suit)) x += l.XS for i in range(4): suit = i if self.Foundation_Class_1 is RK_FoundationStack: suit = ANY_SUIT s.foundations.append(self.Foundation_Class_2(x, y, self, suit=suit)) x += l.XS x, y = l.XM+2*l.XS, l.YM+l.YS for i in range(4): s.rows.append(LadyOfTheManor_RowStack(x, y, self, max_accept=0)) x += l.XS for i, j in ((0,2), (0,1), (0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0), (7,1), (7,2),): x, y = l.XM+i*l.XS, l.YM+j*l.YS s.reserves.append(LadyOfTheManor_Reserve(x, y, self, max_accept=0)) s.talon = InitialDealTalonStack(self.width-l.XS, self.height-2*l.YS, self) l.defaultAll()
def createGame(self, **layout): # Create layout l, s = Layout(self), self.s kwdefault(layout, rows=18, playcards=19) self.Layout_Method(l, **layout) self.setSize(l.size[0], l.size[1]) # Create foundations for r in l.s.foundations: n = 14 + 8 * (r.suit == 4) s.foundations.append( self.Foundation_Class(r.x, r.y, self, r.suit, mod=n, max_cards=n)) # Create rows for r in l.s.rows: s.rows.append(self.RowStack_Class(r.x, r.y, self)) # Create talon s.talon = self.Talon_Class(l.s.talon.x, l.s.talon.y, self) # Define stack groups l.defaultAll()
def createGame(self, **layout): l, s = Layout(self), self.s kwdefault(layout, rows=self.Rows, reserves=self.Reserves, texts=0, playcards=22) self.Layout_Method(l, **layout) self.setSize(l.size[0], l.size[1]) # Create stacks s.talon = self.Talon_Class(l.s.talon.x, l.s.talon.y, self) for r in l.s.foundations: s.foundations.append( self.Foundation_Class(r.x, r.y, self, suit=ANY_SUIT, base_rank=r.suit)) for r in l.s.rows: s.rows.append( self.RowStack_Class(r.x, r.y, self, base_rank=self.BaseRank, yoffset=l.YOFFSET)) for r in l.s.reserves: s.reserves.append(ReserveStack(r.x, r.y, self)) l.defaultAll()
def createGame(self, rows=8, reserves=8, playcards=7): # create layout l, s = Layout(self), self.s # set window max_rows = max(rows, reserves) w, h = l.XM + max_rows*l.XS, l.YM + 2*l.YS + (12+playcards)*l.YOFFSET self.setSize(w, h) # create stacks x, y = l.XM + (max_rows-rows)*l.XS//2, l.YM for i in range(rows): stack = self.RowStack_Class(x, y, self, base_rank=ANY_RANK) stack.getBottomImage = stack._getReserveBottomImage s.rows.append(stack) x += l.XS x, y = l.XM + (max_rows-reserves)*l.XS//2, l.YM+l.YS+12*l.YOFFSET for i in range(reserves): stack = OpenStack(x, y, self, max_accept=0) s.reserves.append(stack) stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, l.YOFFSET x += l.XS s.talon = InitialDealTalonStack(l.XM, l.YM, self) # default l.defaultAll()
def createGame(self, rows=7, playcards=18): l, s = Layout(self), self.s self.Layout_Method(l, rows=rows, waste=0, playcards=playcards) self.setSize(l.size[0], l.size[1]) s.talon = self.Talon_Class(l.s.talon.x, l.s.talon.y, self) for r in l.s.foundations: s.foundations.append(SS_FoundationStack(r.x, r.y, self, suit=r.suit)) for r in l.s.rows: s.rows.append(self.RowStack_Class(r.x, r.y, self)) l.defaultAll()
def createGame(self, rows=8): l, s = Layout(self), self.s l.klondikeLayout(rows=rows, waste=0, playcards=25) self.setSize(l.size[0], l.size[1]) s.talon = WaveTalon(l.s.talon.x, l.s.talon.y, self) for r in l.s.foundations: s.foundations.append( SS_FoundationStack(r.x, r.y, self, suit=r.suit)) for r in l.s.rows: s.rows.append(Yukon_AC_RowStack(r.x, r.y, self)) l.defaultAll()
def createGame(self, rows=7): l, s = Layout(self), self.s Layout.klondikeLayout(l, rows=rows, waste=1) self.setSize(l.size[0], l.size[1]) s.talon = WasteTalonStack(l.s.talon.x, l.s.talon.y, self, max_rounds=1) s.waste = WasteStack(l.s.waste.x, l.s.waste.y, self) for r in l.s.foundations: s.foundations.append(SS_FoundationStack(r.x, r.y, self, suit=r.suit)) for r in l.s.rows: s.rows.append(self.RowStack_Class(r.x, r.y, self)) l.defaultAll()
def createGame(self, rows=8): l, s = Layout(self), self.s l.klondikeLayout(rows=rows, waste=0, playcards=25) self.setSize(l.size[0], l.size[1]) s.talon = WaveTalon(l.s.talon.x, l.s.talon.y, self) for r in l.s.foundations: s.foundations.append(SS_FoundationStack(r.x, r.y, self, suit=r.suit)) for r in l.s.rows: s.rows.append(Yukon_AC_RowStack(r.x, r.y, self)) l.defaultAll()
def createGame(self, playcards=13, reserves=0, texts=False): # 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 + (playcards - 1) * l.XOFFSET) x0 = l.XM x1 = x0 + w + 2 * l.XM x2 = x1 + l.XS + 2 * l.XM x3 = x2 + w + l.XM h = l.YM + (4 + int(reserves != 0)) * l.YS + int(texts) * l.TEXT_HEIGHT self.setSize(x3, h) # create stacks y = l.YM if reserves: x = x1 - int(l.XS * (reserves - 1) / 2) for i in range(reserves): s.reserves.append(ReserveStack(x, y, self)) x += l.XS y += l.YS x = x1 for i in range(4): s.foundations.append( self.Foundation_Class(x, y, self, suit=i, max_move=0)) y += l.YS if texts: tx, ty, ta, tf = l.getTextAttr(None, "ss") tx, ty = x + tx, y - l.YS + ty font = self.app.getFont("canvas_default") self.texts.info = MfxCanvasText(self.canvas, tx, ty, anchor=ta, font=font) for x in (x0, x2): y = l.YM + l.YS * int(reserves != 0) for i in range(4): stack = self.RowStack_Class(x, y, self) stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0 s.rows.append(stack) y += l.YS x, y = self.width - l.XS, self.height - l.YS s.talon = InitialDealTalonStack(x, y, self) if reserves: l.setRegion( s.rows[:4], (-999, l.YM + l.YS - l.CH // 2, x1 - l.CW // 2, 999999)) else: l.setRegion(s.rows[:4], (-999, -999, x1 - l.CW // 2, 999999)) # default l.defaultAll()
def createGame(self, rows=7): l, s = Layout(self), self.s Layout.klondikeLayout(l, rows=rows, waste=1) self.setSize(l.size[0], l.size[1]) s.talon = WasteTalonStack(l.s.talon.x, l.s.talon.y, self, max_rounds=1) s.waste = WasteStack(l.s.waste.x, l.s.waste.y, self) for r in l.s.foundations: s.foundations.append( SS_FoundationStack(r.x, r.y, self, suit=r.suit)) for r in l.s.rows: s.rows.append(self.RowStack_Class(r.x, r.y, self)) l.defaultAll()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM + 13 * l.XS, l.YM + 2 * l.YS + 15 * l.YOFFSET) x, y = l.XM + 6 * l.XS, l.YM s.foundations.append(SS_FoundationStack(x, y, self, base_rank=ANY_RANK, suit=DIAMOND, mod=13)) x, y = l.XM, l.YM + l.YS for i in range(13): s.rows.append(DiamondMine_RowStack(x, y, self)) x += l.XS s.talon = InitialDealTalonStack(l.XM, self.height - l.YS, self) l.defaultAll()
def createGame(self): # create layout l, s = Layout(self), self.s Layout.bakersDozenLayout(l, rows=13) self.setSize(l.size[0], l.size[1]) # create stacks s.talon = Cruel_Talon(l.s.talon.x, l.s.talon.y, self, max_rounds=-1) for r in l.s.foundations: s.foundations.append(SS_FoundationStack(r.x, r.y, self, suit=r.suit)) for r in l.s.rows: s.rows.append(SS_RowStack(r.x, r.y, self, base_rank=NO_RANK)) # default l.defaultAll()
def createGame(self, max_rounds=-1, num_deal=1, **layout): l, s = Layout(self), self.s l.klondikeLayout(rows=7, waste=1, texts=1, playcards=20) self.setSize(l.size[0], l.size[1]) s.talon = WasteTalonStack(l.s.talon.x, l.s.talon.y, self, max_rounds=1) s.waste = WasteStack(l.s.waste.x, l.s.waste.y, self) for r in l.s.foundations: s.foundations.append(SS_FoundationStack(r.x, r.y, self, suit=r.suit)) for r in l.s.rows: s.rows.append(Yukon_SS_RowStack(r.x, r.y, self, base_rank=KING)) l.defaultAll()
def createGame(self): # create layout l, s = Layout(self), self.s Layout.bakersDozenLayout(l, rows=13) self.setSize(l.size[0], l.size[1]) # create stacks s.talon = Cruel_Talon(l.s.talon.x, l.s.talon.y, self, max_rounds=-1) for r in l.s.foundations: s.foundations.append( SS_FoundationStack(r.x, r.y, self, suit=r.suit)) for r in l.s.rows: s.rows.append(SS_RowStack(r.x, r.y, self, base_rank=NO_RANK)) # default l.defaultAll()
def createGame(self, rows=7): # create layout l, s = Layout(self), self.s l.yukonLayout(rows=rows, texts=0, playcards=25) self.setSize(l.size[0], l.size[1]) # create stacks s.talon = self.Talon_Class(l.s.talon.x, l.s.talon.y, self) for r in l.s.foundations: s.foundations.append(self.Foundation_Class(r.x, r.y, self, suit=ANY_SUIT, max_move=0)) for r in l.s.rows: s.rows.append(self.RowStack_Class(r.x, r.y, self)) # default l.defaultAll()
def createGame(self, playcards=13, reserves=0, texts=False): # 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+(playcards-1)*l.XOFFSET) x0 = l.XM x1 = x0 + w + 2*l.XM x2 = x1 + l.XS + 2*l.XM x3 = x2 + w + l.XM h = l.YM + (4+int(reserves != 0))*l.YS + int(texts)*l.TEXT_HEIGHT self.setSize(x3, h) # create stacks y = l.YM if reserves: x = x1 - int(l.XS*(reserves-1)/2) for i in range(reserves): s.reserves.append(ReserveStack(x, y, self)) x += l.XS y += l.YS x = x1 for i in range(4): s.foundations.append( self.Foundation_Class(x, y, self, suit=i, max_move=0)) y += l.YS if texts: tx, ty, ta, tf = l.getTextAttr(None, "ss") tx, ty = x+tx, y-l.YS+ty font = self.app.getFont("canvas_default") self.texts.info = MfxCanvasText(self.canvas, tx, ty, anchor=ta, font=font) for x in (x0, x2): y = l.YM+l.YS*int(reserves != 0) for i in range(4): stack = self.RowStack_Class(x, y, self) stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0 s.rows.append(stack) y += l.YS x, y = self.width - l.XS, self.height - l.YS s.talon = InitialDealTalonStack(x, y, self) if reserves: l.setRegion( s.rows[:4], (-999, l.YM+l.YS-l.CH//2, x1-l.CW//2, 999999)) else: l.setRegion(s.rows[:4], (-999, -999, x1-l.CW//2, 999999)) # default l.defaultAll()
def createGame(self, **layout): # create layout l, s = Layout(self), self.s kwdefault(layout, rows=13, playcards=9) self.Layout_Method(l, **layout) self.setSize(l.size[0], l.size[1]) # create stacks s.talon = self.Talon_Class(l.s.talon.x, l.s.talon.y, self) for r in l.s.foundations: s.foundations.append(self.Foundation_Class(r.x, r.y, self, suit=r.suit)) for r in l.s.rows: s.rows.append(self.RowStack_Class(r.x, r.y, self)) # default l.defaultAll() return l
def createGame(self, rows=7): # create layout l, s = Layout(self), self.s l.yukonLayout(rows=rows, texts=0, playcards=25) self.setSize(l.size[0], l.size[1]) # create stacks s.talon = self.Talon_Class(l.s.talon.x, l.s.talon.y, self) for r in l.s.foundations: s.foundations.append( self.Foundation_Class( r.x, r.y, self, suit=ANY_SUIT, max_move=0)) for r in l.s.rows: s.rows.append(self.RowStack_Class(r.x, r.y, self)) # default l.defaultAll()
def createGame(self, **layout): # create layout l, s = Layout(self), self.s kwdefault(layout, rows=8, waste=0, texts=1) self.Layout_Method(l, **layout) self.setSize(l.size[0], l.size[1]) # create stacks s.talon = self.Talon_Class(l.s.talon.x, l.s.talon.y, self) if l.s.waste: s.waste = WasteStack(l.s.waste.x, l.s.waste.y, self) for r in l.s.foundations: s.foundations.append(self.Foundation_Class(r.x, r.y, self, suit=r.suit)) for r in l.s.rows: s.rows.append(self.RowStack_Class(r.x, r.y, self)) # default l.defaultAll()
def createGame(self): layout, s = Layout(self), self.s self.setSize( layout.XM+13*layout.XS, layout.YM+2*layout.YS+15*layout.YOFFSET) x, y = layout.XM+6*layout.XS, layout.YM s.foundations.append(SS_FoundationStack(x, y, self, base_rank=ANY_RANK, suit=DIAMOND, mod=13)) x, y = layout.XM, layout.YM+layout.YS for i in range(13): s.rows.append(DiamondMine_RowStack(x, y, self)) x += layout.XS s.talon = InitialDealTalonStack(layout.XM, self.height-layout.YS, self) layout.defaultAll()
def createGame(self, **layout): # create layout l, s = Layout(self), self.s kwdefault(layout, rows=7, texts=0, playcards=25) self.Layout_Method(l, **layout) self.setSize(l.size[0], l.size[1]) # create stacks s.talon = self.Talon_Class(l.s.talon.x, l.s.talon.y, self) for r in l.s.foundations: s.foundations.append( self.Foundation_Class(r.x, r.y, self, suit=r.suit, max_move=0)) for r in l.s.rows: s.rows.append(self.RowStack_Class(r.x, r.y, self)) # default l.defaultAll() return l
def createGame(self, **layout): # create layout l, s = Layout(self), self.s kwdefault(layout, rows=10, waste=0, texts=1, playcards=23) self.Layout_Method(l, **layout) self.setSize(l.size[0], l.size[1]) # create stacks s.talon = self.Talon_Class(l.s.talon.x, l.s.talon.y, self) if l.s.waste: s.waste = WasteStack(l.s.waste.x, l.s.waste.y, self) for r in l.s.foundations: s.foundations.append(self.Foundation_Class(r.x, r.y, self, suit=ANY_SUIT)) for r in l.s.rows: s.rows.append(self.RowStack_Class(r.x, r.y, self)) # default l.defaultAll()
def createGame(self, **layout): # create layout l, s = Layout(self), self.s kwdefault(layout, rows=10, reserves=2, texts=0) self.Layout_Method(l, **layout) self.setSize(l.size[0], l.size[1]) # create stacks s.talon = InitialDealTalonStack(l.s.talon.x, l.s.talon.y, self) for r in l.s.foundations: self.s.foundations.append(self.Foundation_Class(r.x, r.y, self, suit=r.suit)) for r in l.s.rows: s.rows.append(self.RowStack_Class(r.x, r.y, self)) for r in l.s.reserves: self.s.reserves.append(ReserveStack(r.x, r.y, self)) # default l.defaultAll()
def createGame(self): # create layout l, s = Layout(self), self.s # set window w, h = 3 * l.XM + 6 * l.XS, 3 * l.YM + 4 * l.YS self.setSize(w, h) # create stacks lay = ( (2, 1, 1, 0), (2, 2, 1, 0), (2, 3, 1, 0), (2, 4, 1, 0), (3, 5, 2, 1), (3, 5, 2, 2), (2, 4, 3, 3), (2, 3, 3, 3), (2, 2, 3, 3), (2, 1, 3, 3), (1, 0, 2, 2), (1, 0, 2, 1), ) for xm, xs, ym, ys in lay: x, y = xm * l.XM + xs * l.XS, ym * l.YM + ys * l.YS stack = self.RowStack_Class(x, y, self, max_move=1, max_accept=1) stack.CARD_XOFFSET = stack.CARD_YOFFSET = 0 s.rows.append(stack) x, y = 2 * l.XM + l.XS, 2 * l.YM + l.YS for i in range(4): s.foundations.append( self.Foundation_Class(x, y, self, suit=i, base_rank=KING, dir=-1)) x = x + l.XS x, y = 2 * l.XM + l.XS, 2 * l.YM + 2 * l.YS for i in range(4): s.foundations.append(self.Foundation_Class(x, y, self, suit=i)) x = x + l.XS s.talon = self.Talon_Class(l.XM, l.YM, self) # default l.defaultAll()
def createGame(self): # create layout l, s = Layout(self), self.s # set window dx = l.XS + 3*l.XOFFSET w = max(5.25*dx + l.XS, 5.5*dx) self.setSize(l.XM + w, l.YM + 4*l.YS) # create stacks for xx, yy in ( (3.25, 0.15), (4.25, 0.5), (4.5, 1.5), (4.25, 2.5), (3.25, 2.85), (2.25, 3), (1.25, 2.85), (0.25, 2.5), (0, 1.5), (0.25, 0.5), (1.25, 0.15), (2.25, 0), ): x = l.XM + xx*dx y = l.YM + yy*l.YS stack = Clock_RowStack(x, y, self, max_move=0) stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0 stack.SHRINK_FACTOR = 1 s.rows.append(stack) x, y = l.XM + 2.25*dx, l.YM + 1.5*l.YS stack = Clock_RowStack(x, y, self, max_move=1) stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0 stack.SHRINK_FACTOR = 1 s.rows.append(stack) x, y = self.width - l.XS, self.height - l.YS s.talon = InitialDealTalonStack(x, y, self) # create an invisible stacks s.internals.append(InvisibleStack(self)) s.internals.append(InvisibleStack(self)) # default l.defaultAll()
def createGame(self, **layout): # create layout l, s = Layout(self), self.s kwdefault(layout, rows=8, reserves=4, texts=0) self.Layout_Method(l, **layout) self.setSize(l.size[0], l.size[1]) # create stacks s.talon = self.Talon_Class(l.s.talon.x, l.s.talon.y, self) for r in l.s.foundations: s.foundations.append( self.Foundation_Class(r.x, r.y, self, suit=ANY_SUIT)) for r in l.s.rows: s.rows.append(self.RowStack_Class(r.x, r.y, self)) for r in l.s.reserves: s.reserves.append(ReserveStack(r.x, r.y, self)) # default l.defaultAll()
def createGame(self, **layout): # create layout lay, s = Layout(self), self.s kwdefault(layout, rows=10, reserves=2, texts=0) self.Layout_Method(lay, **layout) self.setSize(lay.size[0], lay.size[1]) # create stacks s.talon = InitialDealTalonStack(lay.s.talon.x, lay.s.talon.y, self) for r in lay.s.foundations: self.s.foundations.append( self.Foundation_Class(r.x, r.y, self, suit=r.suit)) for r in lay.s.rows: s.rows.append(self.RowStack_Class(r.x, r.y, self)) for r in lay.s.reserves: self.s.reserves.append(ReserveStack(r.x, r.y, self)) # default lay.defaultAll()