当前位置: 首页>>代码示例>>Python>>正文


Python SS_FoundationStack.CARD_YOFFSET方法代码示例

本文整理汇总了Python中pysollib.stack.SS_FoundationStack.CARD_YOFFSET方法的典型用法代码示例。如果您正苦于以下问题:Python SS_FoundationStack.CARD_YOFFSET方法的具体用法?Python SS_FoundationStack.CARD_YOFFSET怎么用?Python SS_FoundationStack.CARD_YOFFSET使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pysollib.stack.SS_FoundationStack的用法示例。


在下文中一共展示了SS_FoundationStack.CARD_YOFFSET方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: createGame

# 需要导入模块: from pysollib.stack import SS_FoundationStack [as 别名]
# 或者: from pysollib.stack.SS_FoundationStack import CARD_YOFFSET [as 别名]
    def createGame(self):
        # create layout
        l, s = Layout(self), self.s

        # set window
        self.setSize(l.XM + 5.5*l.XS, l.YM + 4*l.YS)

        # extra settings
        self.base_card = None

        # create stacks
        for i in range(4):
            dx, dy = ((0, 0), (2, 0), (0, 2), (2, 2))[i]
            x, y = l.XM + (2*dx+5)*l.XS//2, l.YM + (2*dy+1)*l.YS//2
            stack = SS_FoundationStack(x, y, self, i, mod=13, max_move=0)
            stack.CARD_YOFFSET = 0
            s.foundations.append(stack)
        for i in range(5):
            dx, dy = ((1, 0), (0, 1), (1, 1), (2, 1), (1, 2))[i]
            x, y = l.XM + (2*dx+5)*l.XS//2, l.YM + (2*dy+1)*l.YS//2
            stack = RK_RowStack(x, y, self, mod=13, max_move=1)
            stack.CARD_YOFFSET = 0
            s.rows.append(stack)
        x, y = l.XM, l.YM + 3*l.YS//2
        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")

        # define stack-groups
        l.defaultStackGroups()
开发者ID:jimsize,项目名称:PySolFC,代码行数:34,代码来源:royaleast.py

示例2: createGame

# 需要导入模块: from pysollib.stack import SS_FoundationStack [as 别名]
# 或者: from pysollib.stack.SS_FoundationStack import CARD_YOFFSET [as 别名]
    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()
开发者ID:shlomif,项目名称:PySolFC,代码行数:42,代码来源:sultan.py


注:本文中的pysollib.stack.SS_FoundationStack.CARD_YOFFSET方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。