mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Fixed error in Beehive demo and other enhancements to the Beehive game.
This commit is contained in:
parent
1086a5b584
commit
8b46d12433
1 changed files with 14 additions and 2 deletions
|
@ -132,7 +132,8 @@ class Canfield(Game):
|
||||||
max_move=0))
|
max_move=0))
|
||||||
else:
|
else:
|
||||||
x += (lay.XS * rows)
|
x += (lay.XS * rows)
|
||||||
s.foundations.append(self.Foundation_Class(x, y, self, -1))
|
s.foundations.append(self.Foundation_Class(x, y, self, -1,
|
||||||
|
max_move=0))
|
||||||
if text:
|
if text:
|
||||||
if rows > 4 * decks:
|
if rows > 4 * decks:
|
||||||
tx, ty, ta, tf = lay.getTextAttr(None, "se")
|
tx, ty, ta, tf = lay.getTextAttr(None, "se")
|
||||||
|
@ -907,6 +908,17 @@ class Lafayette(Game):
|
||||||
# * Beehive
|
# * Beehive
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
|
|
||||||
|
class Beehive_RowStack(RK_RowStack): # Spider_SS_RowStack
|
||||||
|
def canDropCards(self, stacks):
|
||||||
|
if len(self.cards) < 4:
|
||||||
|
return (None, 0)
|
||||||
|
cards = self.cards[-4:]
|
||||||
|
for s in stacks:
|
||||||
|
if s is not self and s.acceptsCards(self, cards):
|
||||||
|
return (s, 4)
|
||||||
|
return (None, 0)
|
||||||
|
|
||||||
|
|
||||||
class Beehive_Foundation(AbstractFoundationStack):
|
class Beehive_Foundation(AbstractFoundationStack):
|
||||||
def acceptsCards(self, from_stack, cards):
|
def acceptsCards(self, from_stack, cards):
|
||||||
if len(cards) < 4:
|
if len(cards) < 4:
|
||||||
|
@ -916,7 +928,7 @@ class Beehive_Foundation(AbstractFoundationStack):
|
||||||
|
|
||||||
class Beehive(Canfield):
|
class Beehive(Canfield):
|
||||||
Foundation_Class = Beehive_Foundation
|
Foundation_Class = Beehive_Foundation
|
||||||
RowStack_Class = StackWrapper(RK_RowStack)
|
RowStack_Class = Beehive_RowStack
|
||||||
|
|
||||||
SEPARATE_FOUNDATIONS = False
|
SEPARATE_FOUNDATIONS = False
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue