Example #1
0
    def juegaAplazada(self, aplazamiento):
        self.cpu = CPU.CPU(self.main_window)

        tipoJuego = aplazamiento["TIPOJUEGO"]
        is_white = aplazamiento["ISWHITE"]

        if tipoJuego == GT_COMPETITION_WITH_TUTOR:
            categoria = self.configuracion.rival.categorias.segun_clave(
                aplazamiento["CATEGORIA"])
            nivel = aplazamiento["NIVEL"]
            puntos = aplazamiento["PUNTOS"]
            self.gestor = GestorCompeticion.GestorCompeticion(self)
            self.gestor.inicio(categoria, nivel, is_white, puntos,
                               aplazamiento)
        elif tipoJuego == GT_AGAINST_ENGINE:
            if aplazamiento["MODO"] == "Basic":
                self.entrenaMaquina(None, aplazamiento)
            else:
                self.playPersonAplazada(aplazamiento)
        elif tipoJuego == GT_ELO:
            self.gestor = GestorElo.GestorElo(self)
            self.gestor.inicio(None, aplazamiento)
        elif tipoJuego == GT_MICELO:
            self.gestor = GestorMicElo.GestorMicElo(self)
            self.gestor.inicio(None, 0, 0, aplazamiento)
        elif tipoJuego == GT_ALBUM:
            self.gestor = GestorAlbum.GestorAlbum(self)
            self.gestor.inicio(None, None, aplazamiento)
        elif tipoJuego == GT_AGAINST_PGN:
            self.read_pgn(sys.argv[1])
        elif tipoJuego in (GT_FICS, GT_FIDE, GT_LICHESS):
            self.gestor = GestorFideFics.GestorFideFics(self)
            self.gestor.selecciona(tipoJuego)
            self.gestor.inicio(aplazamiento["IDGAME"],
                               aplazamiento=aplazamiento)
Example #2
0
    def juegaAplazada(self, aplazamiento):
        self.cpu = CPU.CPU(self.pantalla)

        tipoJuego = aplazamiento["TIPOJUEGO"]
        siBlancas = aplazamiento["SIBLANCAS"]

        if tipoJuego == kJugNueva:
            categoria = self.configuracion.rival.categorias.segunClave(aplazamiento["CATEGORIA"])
            nivel = aplazamiento["NIVEL"]
            puntos = aplazamiento["PUNTOS"]
            self.gestor = GestorCompeticion.GestorCompeticion(self)
            self.gestor.inicio(categoria, nivel, siBlancas, puntos, aplazamiento)
        elif tipoJuego == kJugEntMaq:
            if aplazamiento["MODO"] == "Basic":
                self.entrenaMaquina(None, aplazamiento)
            else:
                self.playPersonAplazada(aplazamiento)
        elif tipoJuego == kJugElo:
            self.gestor = GestorElo.GestorElo(self)
            self.gestor.inicio(None, aplazamiento["SICOMPETITIVO"], aplazamiento)
        elif tipoJuego == kJugMicElo:
            self.gestor = GestorMicElo.GestorMicElo(self)
            self.gestor.inicio(None, 0, 0, aplazamiento["SICOMPETITIVO"], aplazamiento)
        elif tipoJuego == kJugAlbum:
            self.gestor = GestorAlbum.GestorAlbum(self)
            self.gestor.inicio(None, None, aplazamiento)
        elif tipoJuego == kJugPGN:
            self.visorPGN("pgn_comandoExterno")
        elif tipoJuego == kJugSolo:
            self.jugarSolo(fichero=sys.argv[1])
        elif tipoJuego in (kJugFics, kJugFide, kJugLichess):
            self.gestor = GestorFideFics.GestorFideFics(self)
            self.gestor.selecciona(tipoJuego)
            self.gestor.inicio(aplazamiento["IDGAME"], aplazamiento["SICOMPETITIVO"], aplazamiento=aplazamiento)
Example #3
0
 def micelo(self, siCompetitivo):
     self.gestor = GestorMicElo.GestorMicElo(self)
     resp = PantallaMotores.eligeMotorMicElo(self.gestor, self.configuracion.miceloActivo(siCompetitivo))
     if resp:
         respT = QTVarios.tiempo(self.pantalla, minMinutos=10 if siCompetitivo else 3, minSegundos=0, maxMinutos=999,
                                 maxSegundos=999)
         if respT:
             minutos, segundos = respT
             self.gestor.inicio(resp, minutos, segundos, siCompetitivo)
Example #4
0
 def micelo(self):
     self.gestor = GestorMicElo.GestorMicElo(self)
     resp = WEngines.select_engine_micelo(self.gestor,
                                          self.configuracion.miceloActivo())
     if resp:
         respT = QTVarios.vtime(self.main_window,
                                minMinutos=3,
                                minSegundos=0,
                                maxMinutos=999,
                                maxSegundos=999)
         if respT:
             minutos, segundos = respT
             self.gestor.inicio(resp, minutos, segundos)