diff --git a/pysollib/game.py b/pysollib/game.py index 95ee00f1..aa5a8d57 100644 --- a/pysollib/game.py +++ b/pysollib/game.py @@ -3412,6 +3412,10 @@ in the current implementation.''') % version) def _startAndDealRow(self): self._startDealNumRowsAndDealSingleRow(0) + def _startDealNumRowsAndDealRowAndCards(self, n): + self._startDealNumRowsAndDealSingleRow(n) + self.s.talon.dealCards() + def _startAndDealRowAndCards(self): self._startAndDealRow() self.s.talon.dealCards() diff --git a/pysollib/games/beleagueredcastle.py b/pysollib/games/beleagueredcastle.py index 474df78a..c63afc93 100644 --- a/pysollib/games/beleagueredcastle.py +++ b/pysollib/games/beleagueredcastle.py @@ -527,9 +527,7 @@ class Zerline(Game): # def startGame(self): - self._startDealNumRows(4) - self.s.talon.dealRow() - self.s.talon.dealCards() + self._startDealNumRowsAndDealRowAndCards(4) shallHighlightMatch = Game._shallHighlightMatch_RK @@ -850,9 +848,7 @@ class Soother(Game): l.defaultStackGroups() def startGame(self): - self._startDealNumRows(4) - self.s.talon.dealRow() - self.s.talon.dealCards() + self._startDealNumRowsAndDealRowAndCards(4) shallHighlightMatch = Game._shallHighlightMatch_RK diff --git a/pysollib/games/bisley.py b/pysollib/games/bisley.py index b94e4863..8d42dbd4 100644 --- a/pysollib/games/bisley.py +++ b/pysollib/games/bisley.py @@ -402,9 +402,7 @@ class Cringle(Game): l.defaultStackGroups() def startGame(self): - self._startDealNumRows(4) - self.s.talon.dealRow() - self.s.talon.dealCards() + self._startDealNumRowsAndDealRowAndCards(4) shallHighlightMatch = Game._shallHighlightMatch_AC diff --git a/pysollib/games/canfield.py b/pysollib/games/canfield.py index 5723394f..7d927654 100644 --- a/pysollib/games/canfield.py +++ b/pysollib/games/canfield.py @@ -805,9 +805,7 @@ class Skippy(Canfield): for s in self.s.rows: s.cap.base_rank = row_base_rank # - self._startDealNumRows(3) - self.s.talon.dealRow() - self.s.talon.dealCards() + self._startDealNumRowsAndDealRowAndCards(3) shallHighlightMatch = Game._shallHighlightMatch_RKW diff --git a/pysollib/games/fortythieves.py b/pysollib/games/fortythieves.py index c8d58077..46f6f328 100644 --- a/pysollib/games/fortythieves.py +++ b/pysollib/games/fortythieves.py @@ -1038,9 +1038,7 @@ class FortyNine(Interchange): RowStack_Class = FortyNine_RowStack def startGame(self): - self._startDealNumRows(6) - self.s.talon.dealRow() - self.s.talon.dealCards() + self._startDealNumRowsAndDealRowAndCards(6) shallHighlightMatch = Game._shallHighlightMatch_AC @@ -1137,9 +1135,7 @@ class Floradora(Game): l.defaultStackGroups() def startGame(self): - self._startDealNumRows(5) - self.s.talon.dealRow() - self.s.talon.dealCards() + self._startDealNumRowsAndDealRowAndCards(5) shallHighlightMatch = Game._shallHighlightMatch_RK diff --git a/pysollib/games/golf.py b/pysollib/games/golf.py index 41d8ea20..34db8a40 100644 --- a/pysollib/games/golf.py +++ b/pysollib/games/golf.py @@ -1007,9 +1007,7 @@ class NapoleonTakesMoscow(Game, FirTree_GameMethods): def startGame(self): self.s.talon.dealRow(rows=self.s.reserves, frames=0) - self._startDealNumRows(3) - self.s.talon.dealRow() - self.s.talon.dealCards() + self._startDealNumRowsAndDealRowAndCards(3) shallHighlightMatch = Game._shallHighlightMatch_SS @@ -1020,9 +1018,7 @@ class NapoleonLeavesMoscow(NapoleonTakesMoscow): def startGame(self): self.s.talon.dealRow(rows=self.s.reserves, frames=0) - self._startDealNumRows(4) - self.s.talon.dealRow() - self.s.talon.dealCards() + self._startDealNumRowsAndDealRowAndCards(4) # ************************************************************************ diff --git a/pysollib/games/gypsy.py b/pysollib/games/gypsy.py index d028ea47..af4e646a 100644 --- a/pysollib/games/gypsy.py +++ b/pysollib/games/gypsy.py @@ -859,9 +859,7 @@ class LockedCards(Game): def startGame(self, rows=5): self.s.talon.dealRow(rows=self.s.reserves, flip=0, frames=0) - self._startDealNumRows(rows-1) - self.s.talon.dealRow() - self.s.talon.dealCards() + self._startDealNumRowsAndDealRowAndCards(rows-1) shallHighlightMatch = Game._shallHighlightMatch_AC diff --git a/pysollib/games/klondike.py b/pysollib/games/klondike.py index 80d9620b..cd4f19d5 100644 --- a/pysollib/games/klondike.py +++ b/pysollib/games/klondike.py @@ -1099,9 +1099,7 @@ class BigForty(Klondike): Klondike.createGame(self, rows=10) def startGame(self): - self._startDealNumRows(3) - self.s.talon.dealRow() - self.s.talon.dealCards() + self._startDealNumRowsAndDealRowAndCards(3) shallHighlightMatch = Game._shallHighlightMatch_SS diff --git a/pysollib/games/royalcotillion.py b/pysollib/games/royalcotillion.py index 7bc45486..b010039f 100644 --- a/pysollib/games/royalcotillion.py +++ b/pysollib/games/royalcotillion.py @@ -700,9 +700,7 @@ class ThreePirates(Game): l.defaultStackGroups() def startGame(self): - self._startDealNumRows(3) - self.s.talon.dealRow() - self.s.talon.dealCards() + self._startDealNumRowsAndDealRowAndCards(3) shallHighlightMatch = Game._shallHighlightMatch_SS diff --git a/pysollib/games/terrace.py b/pysollib/games/terrace.py index 4e0a7f23..3bf397b1 100644 --- a/pysollib/games/terrace.py +++ b/pysollib/games/terrace.py @@ -342,9 +342,7 @@ class MamySusan(Terrace): for i in range(6): self.s.talon.dealRow(rows=self.s.reserves, flip=0, frames=0) self.flipMove(self.s.reserves[0]) - self._startDealNumRows(3) - self.s.talon.dealRow() - self.s.talon.dealCards() + self._startDealNumRowsAndDealRowAndCards(3) def fillStack(self, stack): pass diff --git a/pysollib/games/ultra/hanafuda.py b/pysollib/games/ultra/hanafuda.py index 33561e91..fac146b9 100644 --- a/pysollib/games/ultra/hanafuda.py +++ b/pysollib/games/ultra/hanafuda.py @@ -683,9 +683,7 @@ class Sumo(AbstractFlowerGame): def startGame(self): assert len(self.s.talon.cards) == 48 - self._startDealNumRows(5) - self.s.talon.dealRow() - self.s.talon.dealCards() + self._startDealNumRowsAndDealRowAndCards(5) # ************************************************************************ diff --git a/pysollib/games/ultra/mughal.py b/pysollib/games/ultra/mughal.py index 2124bf08..fa086f7c 100644 --- a/pysollib/games/ultra/mughal.py +++ b/pysollib/games/ultra/mughal.py @@ -357,9 +357,7 @@ class MughalCircles(AbstractMughalGame): def startGame(self): assert len(self.s.talon.cards) == 96 - self._startDealNumRows(3) - self.s.talon.dealRow() - self.s.talon.dealCards() + self._startDealNumRowsAndDealRowAndCards(3) def shallHighlightMatch(self, stack1, card1, stack2, card2): return ((card1.suit == card2.suit) and diff --git a/pysollib/games/yukon.py b/pysollib/games/yukon.py index bf904fbb..ef711168 100644 --- a/pysollib/games/yukon.py +++ b/pysollib/games/yukon.py @@ -482,9 +482,7 @@ class AustralianPatience(RussianSolitaire): l.defaultAll() def startGame(self): - self._startDealNumRows(3) - self.s.talon.dealRow() - self.s.talon.dealCards() + self._startDealNumRowsAndDealRowAndCards(3) class RawPrawn(AustralianPatience): @@ -498,9 +496,7 @@ class BimBom(AustralianPatience): AustralianPatience.createGame(self, rows=8) def startGame(self): - self._startDealNumRows(4) - self.s.talon.dealRow() - self.s.talon.dealCards() + self._startDealNumRowsAndDealRowAndCards(4) # ************************************************************************