mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-05 00:02:29 -04:00
Configure highlight matching for more games
This commit is contained in:
parent
a57f1eae38
commit
72386af5e6
2 changed files with 35 additions and 0 deletions
|
@ -299,6 +299,9 @@ class Quatorze(MonteCarlo):
|
||||||
return (stack1.id // 5 == stack2.id // 5 or
|
return (stack1.id // 5 == stack2.id // 5 or
|
||||||
stack1.id % 5 == stack2.id % 5)
|
stack1.id % 5 == stack2.id % 5)
|
||||||
|
|
||||||
|
def shallHighlightMatch(self, stack1, card1, stack2, card2):
|
||||||
|
return card1.rank + card2.rank == 12
|
||||||
|
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# * Simple Pairs
|
# * Simple Pairs
|
||||||
|
@ -364,6 +367,10 @@ class BlockTen(SimplePairs):
|
||||||
def isGameWon(self):
|
def isGameWon(self):
|
||||||
return len(self.s.foundations[0].cards) == 48
|
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):
|
class SimpleTens(BlockTen):
|
||||||
def isGameWon(self):
|
def isGameWon(self):
|
||||||
|
@ -1108,6 +1115,10 @@ class AcesSquare(MonteCarlo):
|
||||||
return (stack1.id // 4 == stack2.id // 4 or
|
return (stack1.id // 4 == stack2.id // 4 or
|
||||||
stack1.id % 4 == stack2.id % 4)
|
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
|
# register the game
|
||||||
registerGame(GameInfo(89, MonteCarlo, "Monte Carlo",
|
registerGame(GameInfo(89, MonteCarlo, "Monte Carlo",
|
||||||
|
|
|
@ -861,6 +861,9 @@ class Fifteens(Elevens):
|
||||||
self._dropReserve()
|
self._dropReserve()
|
||||||
self.leaveState(old_state)
|
self.leaveState(old_state)
|
||||||
|
|
||||||
|
def shallHighlightMatch(self, stack1, card1, stack2, card2):
|
||||||
|
return card1.rank + card2.rank == 13
|
||||||
|
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# * Eighteens
|
# * Eighteens
|
||||||
|
@ -953,6 +956,9 @@ class Eighteens(Fifteens):
|
||||||
self._dropReserve()
|
self._dropReserve()
|
||||||
self.leaveState(old_state)
|
self.leaveState(old_state)
|
||||||
|
|
||||||
|
def shallHighlightMatch(self, stack1, card1, stack2, card2):
|
||||||
|
return False # How?
|
||||||
|
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# * Neptune
|
# * Neptune
|
||||||
|
@ -982,6 +988,10 @@ class Neptune(Thirteens):
|
||||||
def isGameWon(self):
|
def isGameWon(self):
|
||||||
return len(self.s.talon.cards) == 0
|
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
|
# * Eight Cards
|
||||||
|
@ -1074,6 +1084,9 @@ class EightCards(Thirteens):
|
||||||
# save vars (for undo/redo)
|
# save vars (for undo/redo)
|
||||||
return [self.draws]
|
return [self.draws]
|
||||||
|
|
||||||
|
def shallHighlightMatch(self, stack1, card1, stack2, card2):
|
||||||
|
return card1.rank + card2.rank == 9
|
||||||
|
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# * Triple Alliance
|
# * Triple Alliance
|
||||||
|
@ -1402,6 +1415,10 @@ class ElevenTriangle(Apophis):
|
||||||
INVERT = True
|
INVERT = True
|
||||||
MAX_ROUNDS = 1
|
MAX_ROUNDS = 1
|
||||||
|
|
||||||
|
def shallHighlightMatch(self, stack1, card1, stack2, card2):
|
||||||
|
return (card1.rank + card2.rank == 9 or
|
||||||
|
(9 < card1.rank == card2.rank > 9))
|
||||||
|
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# * Cheops
|
# * Cheops
|
||||||
|
@ -1828,6 +1845,9 @@ class Hurricane(Pyramid):
|
||||||
self.s.talon.moveMove(1, stack)
|
self.s.talon.moveMove(1, stack)
|
||||||
self.leaveState(old_state)
|
self.leaveState(old_state)
|
||||||
|
|
||||||
|
def shallHighlightMatch(self, stack1, card1, stack2, card2):
|
||||||
|
return card1.rank + card2.rank == 12
|
||||||
|
|
||||||
|
|
||||||
# ************************************************************************
|
# ************************************************************************
|
||||||
# * Ides of March
|
# * Ides of March
|
||||||
|
@ -1860,6 +1880,10 @@ class IdesOfMarch(Hurricane):
|
||||||
RowStack_Class = IdesOfMarch_RowStack
|
RowStack_Class = IdesOfMarch_RowStack
|
||||||
Reserve_Class = IdesOfMarch_Reserve
|
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
|
# register the game
|
||||||
registerGame(GameInfo(38, Pyramid, "Pyramid",
|
registerGame(GameInfo(38, Pyramid, "Pyramid",
|
||||||
|
|
Loading…
Add table
Reference in a new issue