本文整理汇总了Python中pysollib.stack.AC_RowStack.CARD_XOFFSET方法的典型用法代码示例。如果您正苦于以下问题:Python AC_RowStack.CARD_XOFFSET方法的具体用法?Python AC_RowStack.CARD_XOFFSET怎么用?Python AC_RowStack.CARD_XOFFSET使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pysollib.stack.AC_RowStack
的用法示例。
在下文中一共展示了AC_RowStack.CARD_XOFFSET方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createGame
# 需要导入模块: from pysollib.stack import AC_RowStack [as 别名]
# 或者: from pysollib.stack.AC_RowStack import CARD_XOFFSET [as 别名]
def createGame(self):
# create layout
l, s = Layout(self), self.s
# set window
self.setSize(l.XM+10*l.XS, max(l.YM+2*l.YS+12*l.YOFFSET,
l.YM+5*l.YS))
# create stacks
x = l.XM
for i in range(2):
y = l.YM+l.YS
for j in range(4):
s.foundations.append(SS_FoundationStack(x, y, self, suit=j))
y += l.YS
x += l.XS
x, y = l.XM+2*l.XS, l.YM
for i in range(8):
stack = AC_RowStack(x, y, self, max_move=1)
stack.getBottomImage = stack._getReserveBottomImage
stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, 0
s.rows.append(stack)
x += l.XS
x, y = l.XM+2*l.XS, l.YM+l.YS
for i in range(8):
stack = OpenStack(x, y, self, max_accept=0)
stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, l.YOFFSET
s.reserves.append(stack)
x += l.XS
s.talon = KingsdownEights_Talon(l.XM, l.YM, self, max_rounds=1)
l.createText(s.talon, "se")
# define stack-groups
l.defaultStackGroups()
示例2: createGame
# 需要导入模块: from pysollib.stack import AC_RowStack [as 别名]
# 或者: from pysollib.stack.AC_RowStack import CARD_XOFFSET [as 别名]
def createGame(self, max_rounds=2):
l, s = Layout(self), self.s
self.setSize(l.XM+8*l.XS, l.YM+4*l.YS)
self.base_card = None
i = 0
for x, y in ((l.XM, l.YM),
(l.XM+7*l.XS, l.YM),
(l.XM, l.YM+3*l.YS),
(l.XM+7*l.XS, l.YM+3*l.YS),
):
s.foundations.append(
SS_FoundationStack(x, y, self, suit=i, mod=13))
i += 1
y = l.YM+l.YS
for i in range(2):
x = l.XM+l.XS
for j in range(6):
stack = AC_RowStack(x, y, self, max_move=1, mod=13)
stack.CARD_XOFFSET, stack.CARD_YOFFSET = 0, 0
s.rows.append(stack)
x += l.XS
y += l.YS
x, y = l.XM+3*l.XS, l.YM
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()