本文整理匯總了Python中pysollib.stack.BasicRowStack.CARD_XOFFSET方法的典型用法代碼示例。如果您正苦於以下問題:Python BasicRowStack.CARD_XOFFSET方法的具體用法?Python BasicRowStack.CARD_XOFFSET怎麽用?Python BasicRowStack.CARD_XOFFSET使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pysollib.stack.BasicRowStack
的用法示例。
在下文中一共展示了BasicRowStack.CARD_XOFFSET方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: createGame
# 需要導入模塊: from pysollib.stack import BasicRowStack [as 別名]
# 或者: from pysollib.stack.BasicRowStack import CARD_XOFFSET [as 別名]
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()
示例2: createGame
# 需要導入模塊: from pysollib.stack import BasicRowStack [as 別名]
# 或者: from pysollib.stack.BasicRowStack import CARD_XOFFSET [as 別名]
def createGame(self):
l, s = Layout(self), self.s
w0 = l.XS+5*l.XOFFSET
self.setSize(l.XM+5*w0, l.YM+5*l.YS)
x, y = l.XM, l.YM
for i in range(3):
s.reserves.append(TripleAlliance_Reserve(x, y, self))
x += l.XS
x, y = self.width-l.XS, l.YM
s.foundations.append(AbstractFoundationStack(x, y, self, suit=ANY_SUIT,
max_move=0, max_accept=0, max_cards=52))
l.createText(s.foundations[0], 'nw')
y = l.YM+l.YS
nstacks = 0
for i in range(4):
x = l.XM
for j in range(5):
stack = BasicRowStack(x, y, self, max_accept=0)
s.rows.append(stack)
stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0
x += w0
nstacks += 1
if nstacks >= 18:
break
y += l.YS
x, y = self.width-l.XS, self.height-l.YS
s.talon = InitialDealTalonStack(x, y, self)
l.defaultStackGroups()
示例3: createGame
# 需要導入模塊: from pysollib.stack import BasicRowStack [as 別名]
# 或者: from pysollib.stack.BasicRowStack import CARD_XOFFSET [as 別名]
def createGame(self, rows=(7, 7, 7, 5)):
# create layout
l, s = Layout(self), self.s
# set window
w, h = l.XM+max(
max(rows)*(l.XS+3*l.XOFFSET), 9*l.XS), l.YM+(len(rows)+2)*l.YS
self.setSize(w, h)
# create stacks
x, y = l.XM+(w-l.XM-8*l.XS)//2, l.YM
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,
base_rank=KING, suit=i, dir=-1))
x += l.XS
n = 0
y = l.YM+l.YS
for i in rows:
x = l.XM
for j in range(i):
stack = BasicRowStack(x, y, self, max_move=1, max_accept=0)
stack.CARD_XOFFSET, stack.CARD_YOFFSET = l.XOFFSET, 0
s.rows.append(stack)
x += l.XS+3*l.XOFFSET
n += 1
y += l.YS
x, y = l.XM+(w-l.XM-8*l.XS)//2, h-l.YS
for i in range(8):
s.reserves.append(ReserveStack(x, y, self))
x += l.XS
s.talon = InitialDealTalonStack(w-l.XS, h-l.YS, self)
# default
l.defaultAll()