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:
parent
26631a7a22
commit
0abb801203
1 changed files with 6 additions and 0 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue