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

Define canMoveCards() for Hanafuda sequence stacks

Any stack of Hanafuda cards is always deemed movable, even if it is out
of sequence.  The effect can easily be seen a game such as Firecracker,
where:

 - Any stack can be dragged as a whole (but not released)
 - "Highlight piles" will highlight everything
 - Asking for a hint will ignore most valid moves

This is due to Hanafuda_SequenceStack lacking a canMoveCards() method.
This commit is contained in:
Frédéric Brière 2017-03-29 13:02:38 -04:00 committed by Shlomi Fish
parent 26631a7a22
commit 0abb801203

View file

@ -286,6 +286,9 @@ class Hanafuda_SequenceStack(Flower_OpenStack):
return cards[0].rank == 0 or self.cap.base_rank == ANY_RANK
return self.isHanafudaSequence([stackcards[-1], cards[0]])
def canMoveCards(self, cards):
return self.basicCanMoveCards(cards) and self.isHanafudaSequence(cards)
class Oonsoo_SequenceStack(Flower_OpenStack):
@ -298,6 +301,9 @@ class Oonsoo_SequenceStack(Flower_OpenStack):
return cards[0].rank == 0 or self.cap.base_rank == ANY_RANK
return self.isHanafudaSequence([stackcards[-1], cards[0]], 0)
def canMoveCards(self, cards):
return self.basicCanMoveCards(cards) and self.isHanafudaSequence(cards, 0)
class FlowerClock_RowStack(Flower_OpenStack):