From aa7284204227e7fb44161e5b0054c76d23d20b1e Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Thu, 9 Nov 2017 18:48:59 +0200 Subject: [PATCH] Refactoring more into _dealNumRows. --- pysollib/games/auldlangsyne.py | 3 +-- pysollib/games/bisley.py | 15 +++++-------- pysollib/games/calculation.py | 6 ++---- pysollib/games/curdsandwhey.py | 6 ++---- pysollib/games/fan.py | 18 ++++++---------- pysollib/games/fortythieves.py | 12 ++++------- pysollib/games/glenwood.py | 3 +-- pysollib/games/golf.py | 36 +++++++++++--------------------- pysollib/games/harp.py | 6 ++---- pysollib/games/klondike.py | 15 +++++-------- pysollib/games/napoleon.py | 6 ++---- pysollib/games/numerica.py | 3 +-- pysollib/games/osmosis.py | 3 +-- pysollib/games/pileon.py | 9 +++----- pysollib/games/sanibel.py | 3 +-- pysollib/games/special/tarock.py | 9 +++----- pysollib/games/takeaway.py | 3 +-- pysollib/games/terrace.py | 3 +-- pysollib/games/ultra/hanafuda.py | 15 +++++-------- pysollib/games/ultra/hexadeck.py | 3 +-- pysollib/games/ultra/mughal.py | 9 +++----- pysollib/games/yukon.py | 18 ++++++---------- 22 files changed, 68 insertions(+), 136 deletions(-) diff --git a/pysollib/games/auldlangsyne.py b/pysollib/games/auldlangsyne.py index 0976778f..6c358823 100644 --- a/pysollib/games/auldlangsyne.py +++ b/pysollib/games/auldlangsyne.py @@ -368,8 +368,7 @@ class Primrose(Interregnum): Interregnum.createGame(self, playcards=16, texts=True) def startGame(self): - for i in range(11): - self.s.talon.dealRow(frames=0) + self._dealNumRows(11) Interregnum.startGame(self) diff --git a/pysollib/games/bisley.py b/pysollib/games/bisley.py index 99054655..ea1e1c80 100644 --- a/pysollib/games/bisley.py +++ b/pysollib/games/bisley.py @@ -90,8 +90,7 @@ class Bisley(Game): # def startGame(self): - for i in range(3): - self.s.talon.dealRow(frames=0) + self._dealNumRows(3) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRow(rows=self.s.foundations[::2]) @@ -191,8 +190,7 @@ class Gloria(Game): l.defaultAll() def startGame(self): - for i in range(3): - self.s.talon.dealRow(frames=0) + self._dealNumRows(3) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRow(rows=self.s.foundations[1::2]) @@ -240,8 +238,7 @@ class Realm(Game): l.defaultAll() def startGame(self): - for i in range(5): - self.s.talon.dealRow(frames=0) + self._dealNumRows(5) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRowAvail() @@ -345,8 +342,7 @@ class BoardPatience(Game): self.flipMove(self.s.talon) self.moveMove(1, self.s.talon, self.s.foundations[n], frames=0) # deal to rows - for i in range(4): - self.s.talon.dealRow(frames=0) + self._dealNumRows(4) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRowAvail() @@ -410,8 +406,7 @@ class Cringle(Game): l.defaultStackGroups() def startGame(self): - for i in range(4): - self.s.talon.dealRow(frames=0) + self._dealNumRows(4) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealCards() diff --git a/pysollib/games/calculation.py b/pysollib/games/calculation.py index 6c15b6a0..0a5dbdf1 100644 --- a/pysollib/games/calculation.py +++ b/pysollib/games/calculation.py @@ -323,8 +323,7 @@ class One234(Calculation): return cards def startGame(self): - for i in range(4): - self.s.talon.dealRow(frames=0) + self._dealNumRows(4) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRow() @@ -411,8 +410,7 @@ class SeniorWrangler(Game): def startGame(self): self.s.talon.dealRow(rows=self.s.foundations[:8], frames=0) - for i in range(11): - self.s.talon.dealRow(frames=0) + self._dealNumRows(11) self.startDealSample() self.s.talon.dealRow() diff --git a/pysollib/games/curdsandwhey.py b/pysollib/games/curdsandwhey.py index 2c6d9f41..98a62949 100644 --- a/pysollib/games/curdsandwhey.py +++ b/pysollib/games/curdsandwhey.py @@ -115,8 +115,7 @@ class CurdsAndWhey(Game): # def startGame(self): - for i in range(3): - self.s.talon.dealRow(frames=0) + self._dealNumRows(3) self.startDealSample() self.s.talon.dealRow() @@ -138,8 +137,7 @@ class MissMuffet(CurdsAndWhey): CurdsAndWhey.createGame(self, rows=10) def startGame(self): - for i in range(4): - self.s.talon.dealRow(frames=0) + self._dealNumRows(4) self.s.talon.dealRow(rows=[self.s.rows[0], self.s.rows[-1]], frames=0) self.startDealSample() self.s.talon.dealRow() diff --git a/pysollib/games/fan.py b/pysollib/games/fan.py index 8bdd889f..cb791043 100644 --- a/pysollib/games/fan.py +++ b/pysollib/games/fan.py @@ -384,8 +384,7 @@ class Trefoil(LaBelleLucie): cards, lambda c: (c.rank == 0, c.suit)) def startGame(self): - for i in range(2): - self.s.talon.dealRow(frames=0) + self._dealNumRows(2) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRow(rows=self.s.foundations) @@ -568,8 +567,7 @@ class CloverLeaf(Game): # def startGame(self): - for i in range(2): - self.s.talon.dealRow(frames=0) + self._dealNumRows(2) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRow(rows=self.s.foundations) @@ -609,8 +607,7 @@ class BoxFan(Fan): Fan.createGame(self, rows=(4, 4, 4, 4)) def startGame(self): - for i in range(2): - self.s.talon.dealRow(frames=0) + self._dealNumRows(2) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRow(rows=self.s.foundations) @@ -789,8 +786,7 @@ class Crescent(Game): def startGame(self): self.s.talon.dealRow(rows=self.s.foundations, frames=0) - for i in range(5): - self.s.talon.dealRow(frames=0) + self._dealNumRows(5) self.startDealSample() self.s.talon.dealRow() @@ -810,8 +806,7 @@ class School(Fan): Fan.createGame(self, rows=(4, 4, 4, 4), playcards=10, texts=True) def startGame(self): - for i in range(2): - self.s.talon.dealRow(frames=0) + self._dealNumRows(2) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRow(rows=self.s.foundations) @@ -942,8 +937,7 @@ class ForestGlade(Game): l.defaultStackGroups() def startGame(self): - for i in range(2): - self.s.talon.dealRow(frames=0) + self._dealNumRows(2) self.startDealSample() self.s.talon.dealRow() diff --git a/pysollib/games/fortythieves.py b/pysollib/games/fortythieves.py index 382dd48c..df652c34 100644 --- a/pysollib/games/fortythieves.py +++ b/pysollib/games/fortythieves.py @@ -616,8 +616,7 @@ class Octave(Game): def startGame(self): self.s.talon.dealRow(rows=self.s.foundations, frames=0) - for i in range(2): - self.s.talon.dealRow(frames=0) + self._dealNumRows(2) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealCards() # deal first card to WasteStack @@ -806,8 +805,7 @@ class Squadron(FortyThieves): def startGame(self): self.s.talon.dealRow(rows=self.s.reserves, frames=0) - for i in range(3): - self.s.talon.dealRow(frames=0) + self._dealNumRows(3) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealCards() # deal first card to WasteStack @@ -1048,8 +1046,7 @@ class FortyNine(Interchange): RowStack_Class = FortyNine_RowStack def startGame(self): - for i in range(6): - self.s.talon.dealRow(frames=0) + self._dealNumRows(6) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealCards() @@ -1149,8 +1146,7 @@ class Floradora(Game): l.defaultStackGroups() def startGame(self): - for i in range(5): - self.s.talon.dealRow(frames=0) + self._dealNumRows(5) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealCards() diff --git a/pysollib/games/glenwood.py b/pysollib/games/glenwood.py index f2208a6b..b4b40c11 100644 --- a/pysollib/games/glenwood.py +++ b/pysollib/games/glenwood.py @@ -325,8 +325,7 @@ class DoubleFives(Glenwood): def startGame(self): self.base_rank = None - for i in range(4): - self.s.talon.dealRow(frames=0) + self._dealNumRows(4) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRow(rows=self.s.reserves[-2:]) diff --git a/pysollib/games/golf.py b/pysollib/games/golf.py index a4959069..864f05ff 100644 --- a/pysollib/games/golf.py +++ b/pysollib/games/golf.py @@ -180,8 +180,7 @@ class Golf(Game): # def startGame(self): - for i in range(4): - self.s.talon.dealRow(frames=0) + self._dealNumRows(4) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealCards() # deal first card to WasteStack @@ -379,8 +378,7 @@ class BlackHole(Game): cards, lambda c: (c.id == 13, c.suit), 1) def startGame(self): - for i in range(2): - self.s.talon.dealRow(frames=0) + self._dealNumRows(2) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRow(rows=self.s.foundations) @@ -451,8 +449,7 @@ class FourLeafClovers(Game): l.defaultStackGroups() def startGame(self): - for i in range(3): - self.s.talon.dealRow(frames=0) + self._dealNumRows(3) self.startDealSample() self.s.talon.dealRow() @@ -501,8 +498,7 @@ class AllInARow(BlackHole): l.defaultStackGroups() def startGame(self): - for i in range(3): - self.s.talon.dealRow(frames=0) + self._dealNumRows(3) self.startDealSample() self.s.talon.dealRow() @@ -636,8 +632,7 @@ class Dolphin(Game): l.defaultAll() def startGame(self): - for i in range(5): - self.s.talon.dealRow(frames=0) + self._dealNumRows(5) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRowAvail() @@ -649,8 +644,7 @@ class DoubleDolphin(Dolphin): Dolphin.createGame(self, rows=10, reserves=5, playcards=10) def startGame(self): - for i in range(9): - self.s.talon.dealRow(frames=0) + self._dealNumRows(9) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRowAvail() @@ -703,8 +697,7 @@ class Waterfall(Game): l.defaultStackGroups() def startGame(self): - for i in range(3): - self.s.talon.dealRow(frames=0) + self._dealNumRows(3) self.startDealSample() self.s.talon.dealRow() @@ -1028,8 +1021,7 @@ class NapoleonTakesMoscow(Game, FirTree_GameMethods): def startGame(self): self.s.talon.dealRow(rows=self.s.reserves, frames=0) - for i in range(3): - self.s.talon.dealRow(frames=0) + self._dealNumRows(3) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealCards() @@ -1043,8 +1035,7 @@ class NapoleonLeavesMoscow(NapoleonTakesMoscow): def startGame(self): self.s.talon.dealRow(rows=self.s.reserves, frames=0) - for i in range(4): - self.s.talon.dealRow(frames=0) + self._dealNumRows(4) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealCards() @@ -1086,8 +1077,7 @@ class Flake(Game): l.defaultStackGroups() def startGame(self): - for i in range(7): - self.s.talon.dealRow(frames=0) + self._dealNumRows(7) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRowAvail() @@ -1100,8 +1090,7 @@ class Flake2Decks(Flake): Flake.createGame(self, rows=8, playcards=22) def startGame(self): - for i in range(12): - self.s.talon.dealRow(frames=0) + self._dealNumRows(12) self.startDealSample() self.s.talon.dealRow() @@ -1140,8 +1129,7 @@ class Beacon(Game): l.defaultStackGroups() def startGame(self): - for i in range(3): - self.s.talon.dealRow(frames=0) + self._dealNumRows(3) self.startDealSample() self.s.talon.dealRow() diff --git a/pysollib/games/harp.py b/pysollib/games/harp.py index 288af651..b93f8532 100644 --- a/pysollib/games/harp.py +++ b/pysollib/games/harp.py @@ -275,8 +275,7 @@ class Delivery(BigDeal): shallHighlightMatch = Game._shallHighlightMatch_SS def startGame(self): - for i in range(2): - self.s.talon.dealRow(frames=0) + self._dealNumRows(2) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealCards() # deal first card to WasteStack @@ -330,8 +329,7 @@ class Brush(DoubleKlondike): DoubleKlondike.createGame(self, rows=10, max_rounds=1) def startGame(self): - for i in range(3): - self.s.talon.dealRow(frames=0) + self._dealNumRows(3) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealCards() # deal first card to WasteStack diff --git a/pysollib/games/klondike.py b/pysollib/games/klondike.py index 02ce2765..cff5e772 100644 --- a/pysollib/games/klondike.py +++ b/pysollib/games/klondike.py @@ -620,8 +620,7 @@ class Brigade(Raglan): RESERVES = (4, 4, 4, 1) def startGame(self): - for i in range(4): - self.s.talon.dealRow(frames=0) + self._dealNumRows(4) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRow(rows=self.s.reserves) @@ -834,8 +833,7 @@ class Phoenix(Klondike): lay.defaultStackGroups() def startGame(self): - for i in range(6): - self.s.talon.dealRow(frames=0) + self._dealNumRows(6) self.startDealSample() self.s.talon.dealRow(rows=self.s.reserves) @@ -867,8 +865,7 @@ class Lanes(Klondike): def startGame(self): self.s.talon.dealRow(rows=self.s.foundations, frames=0) - for i in range(2): - self.s.talon.dealRow(frames=0) + self._dealNumRows(2) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealCards() # deal first card to WasteStack @@ -923,8 +920,7 @@ class Q_C_(Klondike): lay.createRoundText(self.s.talon, 'sss') def startGame(self): - for i in range(3): - self.s.talon.dealRow(frames=0) + self._dealNumRows(3) self.startDealSample() self.s.talon.dealRow() while self.s.talon.cards: @@ -1340,8 +1336,7 @@ class BigBertha(Game): lay.defaultStackGroups() def startGame(self): - for i in range(5): - self.s.talon.dealRow(frames=0) + self._dealNumRows(5) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRow(rows=self.s.reserves) diff --git a/pysollib/games/napoleon.py b/pysollib/games/napoleon.py index bac50400..f2c14410 100644 --- a/pysollib/games/napoleon.py +++ b/pysollib/games/napoleon.py @@ -343,8 +343,7 @@ class Bonaparte(TheLittleCorporal): TheLittleCorporal.createGame(self, rows=8) def startGame(self): - for i in range(5): - self.s.talon.dealRow(frames=0) + self._dealNumRows(5) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealBaseCards(ncards=4) @@ -406,8 +405,7 @@ class BusyCards(Game): def startGame(self): self.s.talon.dealRow(rows=self.s.foundations, frames=0) - for i in range(7): - self.s.talon.dealRow(frames=0) + self._dealNumRows(7) self.startDealSample() self.s.talon.dealRow() diff --git a/pysollib/games/numerica.py b/pysollib/games/numerica.py index 3943fe70..0a95af17 100644 --- a/pysollib/games/numerica.py +++ b/pysollib/games/numerica.py @@ -979,8 +979,7 @@ class Aglet(Game): def startGame(self): self.s.talon.dealRow(rows=self.s.foundations, frames=0) - for i in range(4): - self.s.talon.dealRow(frames=0) + self._dealNumRows(4) self.startDealSample() self.s.talon.dealRowAvail() self.s.talon.dealRowAvail() diff --git a/pysollib/games/osmosis.py b/pysollib/games/osmosis.py index 7e64ef47..210203a7 100644 --- a/pysollib/games/osmosis.py +++ b/pysollib/games/osmosis.py @@ -243,8 +243,7 @@ class OpenPeek(Game): # def startGame(self): - for i in range(5): - self.s.talon.dealRow(frames=0) + self._dealNumRows(5) self.startDealSample() self.s.talon.dealRow(rows=self.s.reserves) diff --git a/pysollib/games/pileon.py b/pysollib/games/pileon.py index 1eb2a733..e7e1037d 100644 --- a/pysollib/games/pileon.py +++ b/pysollib/games/pileon.py @@ -202,8 +202,7 @@ class Quartets(Foursome): Foursome.createGame(self, rows=8, texts=False) def startGame(self): - for i in range(5): - self.s.talon.dealRow(frames=0) + self._dealNumRows(5) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRowAvail() @@ -368,8 +367,7 @@ class Footling(FourByFour): l.defaultStackGroups() def startGame(self): - for i in range(5): - self.s.talon.dealRow(frames=0) + self._dealNumRows(5) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRowAvail() @@ -382,8 +380,7 @@ class DoubleFootling(Footling): Footling.createGame(self, rows=10, reserves=5, playcards=18) def startGame(self): - for i in range(9): - self.s.talon.dealRow(frames=0) + self._dealNumRows(9) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRowAvail() diff --git a/pysollib/games/sanibel.py b/pysollib/games/sanibel.py index 6d338627..013a591b 100644 --- a/pysollib/games/sanibel.py +++ b/pysollib/games/sanibel.py @@ -54,8 +54,7 @@ class Sanibel(Gypsy): def startGame(self): for i in range(3): self.s.talon.dealRow(flip=0, frames=0) - for i in range(6): - self.s.talon.dealRow(frames=0) + self._dealNumRows(6) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealCards() # deal first card to WasteStack diff --git a/pysollib/games/special/tarock.py b/pysollib/games/special/tarock.py index fb254f14..af42636f 100644 --- a/pysollib/games/special/tarock.py +++ b/pysollib/games/special/tarock.py @@ -424,8 +424,7 @@ class Pagat(AbstractTarockGame): def startGame(self): assert len(self.s.talon.cards) == 78 - for i in range(6): - self.s.talon.dealRow(frames=0) + self._dealNumRows(6) self.startDealSample() self.s.talon.dealRow(rows=self.s.rows[3:9]) @@ -494,8 +493,7 @@ class Skiz(AbstractTarockGame): def startGame(self): assert len(self.s.talon.cards) == 78 - for i in range(6): - self.s.talon.dealRow(frames=0) + self._dealNumRows(6) self.startDealSample() self.s.talon.dealRow(rows=self.s.rows[3:9]) @@ -642,8 +640,7 @@ class Excuse(AbstractTarockGame): def startGame(self): assert len(self.s.talon.cards) == 78 - for i in range(3): - self.s.talon.dealRow(frames=0) + self._dealNumRows(3) self.s.talon.dealRow(rows=self.s.rows[:15], frames=0) self.startDealSample() self.s.talon.dealRow(rows=self.s.rows[:15]) diff --git a/pysollib/games/takeaway.py b/pysollib/games/takeaway.py index d9fc2e06..48a9580f 100644 --- a/pysollib/games/takeaway.py +++ b/pysollib/games/takeaway.py @@ -103,8 +103,7 @@ class TakeAway(Game): # def startGame(self): - for i in range(10): - self.s.talon.dealRow(frames=0) + self._dealNumRows(10) self.startDealSample() for i in range(3): self.s.talon.dealRow() diff --git a/pysollib/games/terrace.py b/pysollib/games/terrace.py index 32ddc44a..0d540616 100644 --- a/pysollib/games/terrace.py +++ b/pysollib/games/terrace.py @@ -342,8 +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]) - for i in range(3): - self.s.talon.dealRow(frames=0) + self._dealNumRows(3) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealCards() diff --git a/pysollib/games/ultra/hanafuda.py b/pysollib/games/ultra/hanafuda.py index 56b3fb36..d0e06a71 100644 --- a/pysollib/games/ultra/hanafuda.py +++ b/pysollib/games/ultra/hanafuda.py @@ -114,8 +114,7 @@ class FlowerClock(AbstractFlowerGame): def startGame(self): assert len(self.s.talon.cards) == 48 - for i in range(5): - self.s.talon.dealRow(frames=0) + self._dealNumRows(5) self.startDealSample() self.s.talon.dealRow() assert len(self.s.talon.cards) == 0 @@ -195,8 +194,7 @@ class Gaji(AbstractFlowerGame): def startGame(self): assert len(self.s.talon.cards) == 48 - for i in range(4): - self.s.talon.dealRow(frames=0) + self._dealNumRows(4) self.startDealSample() r = self.s.rows self.s.talon.dealRow(rows=(r[0], r[1], r[2], r[5], r[6], r[7])) @@ -456,8 +454,7 @@ class MatsuKiri(AbstractFlowerGame): def startGame(self): assert len(self.s.talon.cards) == 48 - for i in range(5): - self.s.talon.dealRow(frames=0) + self._dealNumRows(5) self.startDealSample() self.s.talon.dealRow() assert len(self.s.talon.cards) == 0 @@ -690,8 +687,7 @@ class Sumo(AbstractFlowerGame): def startGame(self): assert len(self.s.talon.cards) == 48 - for i in range(5): - self.s.talon.dealRow(frames=0) + self._dealNumRows(5) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealCards() @@ -736,8 +732,7 @@ class BigSumo(AbstractFlowerGame): def startGame(self): assert len(self.s.talon.cards) == 48 * 2 - for i in range(9): - self.s.talon.dealRow(frames=0) + self._dealNumRows(9) self.startDealSample() self.s.talon.dealRow(rows=self.s.rows[2:8]) self.s.talon.dealCards() diff --git a/pysollib/games/ultra/hexadeck.py b/pysollib/games/ultra/hexadeck.py index a7ad156d..8a756fd9 100644 --- a/pysollib/games/ultra/hexadeck.py +++ b/pysollib/games/ultra/hexadeck.py @@ -1312,8 +1312,7 @@ class MagesGame(Game): def startGame(self): assert len(self.s.talon.cards) == 68 - for i in range(4): - self.s.talon.dealRow(frames=0) + self._dealNumRows(4) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRow(rows=self.s.rows[2:10]) diff --git a/pysollib/games/ultra/mughal.py b/pysollib/games/ultra/mughal.py index 3a501be8..9ba771b5 100644 --- a/pysollib/games/ultra/mughal.py +++ b/pysollib/games/ultra/mughal.py @@ -357,8 +357,7 @@ class MughalCircles(AbstractMughalGame): def startGame(self): assert len(self.s.talon.cards) == 96 - for i in range(3): - self.s.talon.dealRow(frames=0) + self._dealNumRows(3) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealCards() @@ -419,8 +418,7 @@ class EightLegions(AbstractMughalGame): def startGame(self): assert len(self.s.talon.cards) == 96 - for i in range(4): - self.s.talon.dealRow(frames=0) + self._dealNumRows(4) self.startDealSample() self.s.talon.dealCards() @@ -484,8 +482,7 @@ class Shamsher(AbstractMughalGame): def startGame(self): assert len(self.s.talon.cards) == 96 - for i in range(6): - self.s.talon.dealRow(frames=0) + self._dealNumRows(6) self.startDealSample() self.s.talon.dealRow(rows=self.s.rows[:12]) self.s.talon.dealCards() diff --git a/pysollib/games/yukon.py b/pysollib/games/yukon.py index a1496a27..73a941b4 100644 --- a/pysollib/games/yukon.py +++ b/pysollib/games/yukon.py @@ -132,8 +132,7 @@ class Odessa(RussianSolitaire): def startGame(self): for i in range(3): self.s.talon.dealRow(flip=0, frames=0) - for i in range(2): - self.s.talon.dealRow(frames=0) + self._dealNumRows(2) for i in range(2): self.s.talon.dealRow(rows=self.s.rows[1:6], frames=0) self.startDealSample() @@ -489,8 +488,7 @@ class AustralianPatience(RussianSolitaire): l.defaultAll() def startGame(self): - for i in range(3): - self.s.talon.dealRow(frames=0) + self._dealNumRows(3) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealCards() @@ -507,8 +505,7 @@ class BimBom(AustralianPatience): AustralianPatience.createGame(self, rows=8) def startGame(self): - for i in range(4): - self.s.talon.dealRow(frames=0) + self._dealNumRows(4) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealCards() @@ -550,8 +547,7 @@ class Queensland(Yukon): def startGame(self): for i in range(1, len(self.s.rows)): self.s.talon.dealRow(rows=self.s.rows[i:], flip=0, frames=0) - for i in range(3): - self.s.talon.dealRow(frames=0) + self._dealNumRows(3) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRowAvail() @@ -623,8 +619,7 @@ class Brisbane(Yukon): def startGame(self): for i in range(1, len(self.s.rows)): self.s.talon.dealRow(rows=self.s.rows[i:], flip=0, frames=0) - for i in range(3): - self.s.talon.dealRow(frames=0) + self._dealNumRows(3) self.startDealSample() self.s.talon.dealRow() self.s.talon.dealRowAvail() @@ -666,8 +661,7 @@ class Hawaiian(Game): def startGame(self): for i in range(104-5*10): self.s.talon.dealRow(rows=self.s.reserves, frames=0) - for i in range(4): - self.s.talon.dealRow(frames=0) + self._dealNumRows(4) self.startDealSample() self.s.talon.dealRow()