本文整理匯總了Python中pysollib.stack.BasicRowStack.CARD_YOFFSET方法的典型用法代碼示例。如果您正苦於以下問題:Python BasicRowStack.CARD_YOFFSET方法的具體用法?Python BasicRowStack.CARD_YOFFSET怎麽用?Python BasicRowStack.CARD_YOFFSET使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pysollib.stack.BasicRowStack
的用法示例。
在下文中一共展示了BasicRowStack.CARD_YOFFSET方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: createGame
# 需要導入模塊: from pysollib.stack import BasicRowStack [as 別名]
# 或者: from pysollib.stack.BasicRowStack import CARD_YOFFSET [as 別名]
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()
示例2: createGame
# 需要導入模塊: from pysollib.stack import BasicRowStack [as 別名]
# 或者: from pysollib.stack.BasicRowStack import CARD_YOFFSET [as 別名]
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()
示例3: createGame
# 需要導入模塊: from pysollib.stack import BasicRowStack [as 別名]
# 或者: from pysollib.stack.BasicRowStack import CARD_YOFFSET [as 別名]
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()