1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-04-05 00:02:29 -04:00

Well: show the height of stacks of the rows

Without this hint, tracking the height of the rows stacks gets very hard and
uncomfortable. Note that this information doesn't expose any undesirable
secrets because the player knows the base card of each row right after the
dealing the cards. This change will let the player track all the 4 rows base
cards easily during the game.

(cherry picked from commit a04f60833c)
This commit is contained in:
Alexey Radkov 2023-04-28 20:40:10 +04:00 committed by Joe R
parent eaae284140
commit 5402486d1c

View file

@ -1,4 +1,3 @@
#!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# ---------------------------------------------------------------------------
#
@ -545,14 +544,14 @@ class Well(Game):
l, s = Layout(self), self.s
# set window
self.setSize(l.XM+6*l.XS, l.YM+6*l.YS+l.TEXT_HEIGHT)
self.setSize(3*l.XM+6*l.XS, l.YM+6*l.YS+3*l.TEXT_HEIGHT)
# register extra stack variables
s.addattr(wastes=[])
# foundations
suit = 0
x0, y0 = l.XM+1.5*l.XS, l.YM+1.5*l.YS+l.TEXT_HEIGHT
x0, y0 = l.XM+1.5*l.XS, l.YM+1.5*l.YS+2*l.TEXT_HEIGHT
for xx, yy in ((3, 0),
(0, 3),
(3, 3),
@ -564,19 +563,20 @@ class Well(Game):
suit += 1
# rows
x0, y0 = l.XM+l.XS, l.YM+l.YS+l.TEXT_HEIGHT
for xx, yy in ((0, 2),
(2, 0),
(4, 2),
(2, 4)):
x0, y0 = l.XM+l.XS, l.YM+l.YS+2*l.TEXT_HEIGHT
for xx, yy, anchor in ((0, 2, 'w'),
(2, 0, 'n'),
(4, 2, 'e'),
(2, 4, 's')):
x, y = x0+xx*l.XS, y0+yy*l.YS
stack = SS_RowStack(x, y, self, dir=1, mod=13, max_move=1)
stack.getBottomImage = stack._getReserveBottomImage
stack.CARD_YOFFSET = 0
l.createText(stack, anchor)
s.rows.append(stack)
# left stack
x, y = l.XM, l.YM+l.YS+l.TEXT_HEIGHT
x, y = l.XM, l.YM+l.YS+2*l.TEXT_HEIGHT
stack = SS_RowStack(
x, y, self, base_rank=ACE, dir=1, mod=13, max_move=1)
stack.getBottomImage = stack._getReserveBottomImage
@ -584,7 +584,7 @@ class Well(Game):
s.rows.append(stack)
# reserves
x0, y0 = l.XM+2*l.XS, l.YM+2*l.YS+l.TEXT_HEIGHT
x0, y0 = l.XM+2*l.XS, l.YM+2*l.YS+2*l.TEXT_HEIGHT
for xx, yy, anchor in ((0, 1, 'e'),
(1, 0, 's'),
(2, 1, 'w'),