1
0
Fork 0
mirror of https://github.com/shlomif/PySolFC.git synced 2025-03-12 04:07:01 -04:00

Configure highlight matching for more games

This commit is contained in:
Joe R 2025-03-10 22:02:24 -04:00
parent a57f1eae38
commit 72386af5e6
2 changed files with 35 additions and 0 deletions

View file

@ -299,6 +299,9 @@ class Quatorze(MonteCarlo):
return (stack1.id // 5 == stack2.id // 5 or
stack1.id % 5 == stack2.id % 5)
def shallHighlightMatch(self, stack1, card1, stack2, card2):
return card1.rank + card2.rank == 12
# ************************************************************************
# * Simple Pairs
@ -364,6 +367,10 @@ class BlockTen(SimplePairs):
def isGameWon(self):
return len(self.s.foundations[0].cards) == 48
def shallHighlightMatch(self, stack1, card1, stack2, card2):
return (card1.rank + card2.rank == 8 or
(9 < card1.rank == card2.rank > 9))
class SimpleTens(BlockTen):
def isGameWon(self):
@ -1108,6 +1115,10 @@ class AcesSquare(MonteCarlo):
return (stack1.id // 4 == stack2.id // 4 or
stack1.id % 4 == stack2.id % 4)
def shallHighlightMatch(self, stack1, card1, stack2, card2):
return (card1.suit == card2.suit and
card1.rank != card2.rank != 0)
# register the game
registerGame(GameInfo(89, MonteCarlo, "Monte Carlo",

View file

@ -861,6 +861,9 @@ class Fifteens(Elevens):
self._dropReserve()
self.leaveState(old_state)
def shallHighlightMatch(self, stack1, card1, stack2, card2):
return card1.rank + card2.rank == 13
# ************************************************************************
# * Eighteens
@ -953,6 +956,9 @@ class Eighteens(Fifteens):
self._dropReserve()
self.leaveState(old_state)
def shallHighlightMatch(self, stack1, card1, stack2, card2):
return False # How?
# ************************************************************************
# * Neptune
@ -982,6 +988,10 @@ class Neptune(Thirteens):
def isGameWon(self):
return len(self.s.talon.cards) == 0
def shallHighlightMatch(self, stack1, card1, stack2, card2):
return (card1.rank == card2.rank - 1 or
card1.rank == card2.rank + 1)
# ************************************************************************
# * Eight Cards
@ -1074,6 +1084,9 @@ class EightCards(Thirteens):
# save vars (for undo/redo)
return [self.draws]
def shallHighlightMatch(self, stack1, card1, stack2, card2):
return card1.rank + card2.rank == 9
# ************************************************************************
# * Triple Alliance
@ -1402,6 +1415,10 @@ class ElevenTriangle(Apophis):
INVERT = True
MAX_ROUNDS = 1
def shallHighlightMatch(self, stack1, card1, stack2, card2):
return (card1.rank + card2.rank == 9 or
(9 < card1.rank == card2.rank > 9))
# ************************************************************************
# * Cheops
@ -1828,6 +1845,9 @@ class Hurricane(Pyramid):
self.s.talon.moveMove(1, stack)
self.leaveState(old_state)
def shallHighlightMatch(self, stack1, card1, stack2, card2):
return card1.rank + card2.rank == 12
# ************************************************************************
# * Ides of March
@ -1860,6 +1880,10 @@ class IdesOfMarch(Hurricane):
RowStack_Class = IdesOfMarch_RowStack
Reserve_Class = IdesOfMarch_Reserve
def shallHighlightMatch(self, stack1, card1, stack2, card2):
return (card1.rank + card2.rank == 13 or
card1.rank + card2.rank == 0)
# register the game
registerGame(GameInfo(38, Pyramid, "Pyramid",