예제 #1
0
파일: sthelena.py 프로젝트: shlomif/PySolFC
 def dealCards(self, sound=False):
     if not self.cards:
         RedealTalonStack.redealCards(self, sound=False)
     if sound and not self.game.demo:
         self.game.startDealSample()
     rows = self.game.s.rows
     rows = rows[:1]+rows[4:8]+rows[2:3]+rows[1:2]+rows[8:]+rows[3:4]
     num_cards = self.dealRowAvail(rows=rows)
     if sound and not self.game.demo:
         self.game.stopSamples()
     return num_cards
예제 #2
0
 def dealCards(self, sound=False):
     if not self.cards:
         RedealTalonStack.redealCards(self, sound=False)
     if sound and not self.game.demo:
         self.game.startDealSample()
     rows = self.game.s.rows
     rows = rows[:1] + rows[4:8] + rows[2:3] + rows[1:2] + rows[8:] + rows[
         3:4]
     num_cards = self.dealRowAvail(rows=rows)
     if sound and not self.game.demo:
         self.game.stopSamples()
     return num_cards
예제 #3
0
 def dealCards(self, sound=False):
     rows = self.game.s.rows
     reserves = self.game.s.reserves
     if not self.cards:
         RedealTalonStack.redealCards(self, rows=rows+reserves, sound=False)
     if sound and not self.game.demo:
         self.game.startDealSample()
     num_cards = 0
     if self.round != 4:
         num_cards += self.dealRowAvail(rows=[reserves[0]], flip=0)
     num_cards += self.dealRowAvail()
     if self.round != 4:
         num_cards += self.dealRowAvail(rows=[reserves[1]], flip=0)
     if not self.cards:
         for s in reserves:
             self.game.flipAllMove(s)
     if sound and not self.game.demo:
         self.game.stopSamples()
     return num_cards
 def dealCards(self, sound=False):
     rows = self.game.s.rows
     reserves = self.game.s.reserves
     if not self.cards:
         RedealTalonStack.redealCards(self, rows=rows+reserves, sound=False)
     if sound and not self.game.demo:
         self.game.startDealSample()
     num_cards = 0
     if self.round != 4:
         num_cards += self.dealRowAvail(rows=[reserves[0]], flip=0)
     num_cards += self.dealRowAvail()
     if self.round != 4:
         num_cards += self.dealRowAvail(rows=[reserves[1]], flip=0)
     if not self.cards:
         for s in reserves:
             self.game.flipAllMove(s)
     if sound and not self.game.demo:
         self.game.stopSamples()
     return num_cards
예제 #5
0
 def dealRowAvail(self, rows=None, flip=1, reverse=0,
                  frames=-1, sound=False):
     if rows is None:
         rows = []
         i = 0
         for f in self.game.s.foundations:
             if len(f.cards) < 7:
                 rows.append(self.game.s.rows[i])
             i += 1
     return RedealTalonStack.dealRowAvail(
         self, rows=rows, flip=flip, reverse=reverse, frames=frames,
         sound=sound)
예제 #6
0
 def dealRowAvail(self, rows=None, flip=1, reverse=0,
                  frames=-1, sound=False):
     if rows is None:
         rows = []
         i = 0
         for f in self.game.s.foundations:
             if len(f.cards) < 7:
                 rows.append(self.game.s.rows[i])
             i += 1
     return RedealTalonStack.dealRowAvail(
         self, rows=rows, flip=flip, reverse=reverse, frames=frames,
         sound=sound)
예제 #7
0
    def createGame(self):

        # create layout
        l, s = Layout(self), self.s

        # set window
        self.setSize(l.XM + 9 * l.XS, l.YM + 2 * l.YS + 12 * l.YOFFSET)

        # create stacks
        x, y, = l.XM + l.XS, l.YM
        for i in range(8):
            s.foundations.append(
                DieRussische_Foundation(x, y, self, suit=i % 4, max_cards=8))
            x += l.XS
        x, y, = l.XM + l.XS, l.YM + l.YS
        for i in range(8):
            s.rows.append(AC_RowStack(x, y, self, max_move=1, max_accept=1))
            x += l.XS
        s.talon = RedealTalonStack(l.XM, l.YM + l.YS / 2, self, max_rounds=3)
        l.createRoundText(s.talon, 'nn')

        # define stack-groups
        l.defaultStackGroups()
예제 #8
0
 def dealCards(self, sound=False):
     RedealTalonStack.redealCards(self, shuffle=True, sound=sound)
예제 #9
0
 def dealCards(self, sound=False):
     if not self.cards:
         RedealTalonStack.redealCards(self, frames=4, sound=sound)
     return self.dealRowAvail(sound=sound)
예제 #10
0
 def dealCards(self, sound=False):
     if not self.cards:
         RedealTalonStack.redealCards(self, frames=4, sound=sound)
     return self.dealRowAvail(sound=sound)
예제 #11
0
파일: fan.py 프로젝트: shlomif/PySolFC
 def dealCards(self, sound=False):
     RedealTalonStack.redealCards(self, shuffle=True, sound=sound)