Skip to content

Commit

Permalink
EightCards:
Browse files Browse the repository at this point in the history
- index error on click to empty talon fixed.
- move pair when second click goes to reserve stack too.
  • Loading branch information
lufebe16 committed Jan 11, 2024
1 parent 7dd7252 commit d3067f2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pysollib/games/pyramid.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,16 @@ def clickHandler(self, event):

return False

# second selection to reserves stack: should also move the
# pair - not ?
def moveMove(self, ncards, to_stack, frames=-1, shadow=-1):
if to_stack in self.game.s.rows + self.game.s.reserves:
self._dropPairMove(ncards, to_stack, frames=-1, shadow=shadow)
else:
self.game.moveMove(ncards, self, to_stack,
frames=frames, shadow=shadow)
self.fillStack()


class EightCards_Foundation(AbstractFoundationStack):
def acceptsCards(self, from_stack, cards):
Expand All @@ -899,6 +909,7 @@ def acceptsCards(self, from_stack, cards):

class EightCards_Talon(AutoDealTalonStack):
def canDealCards(self):
if len(self.cards) < 1: return False # noqa E701
return self.game.draws > 0 and len(self.game.s.reserves[0].cards) < 1

def dealCards(self, sound=False):
Expand Down

0 comments on commit d3067f2

Please sign in to comment.