예제 #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)
예제 #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)
예제 #3
0
    def adjourns(self):
        menu = QTVarios.LCMenu(self.main_window)
        li_adjourns = Adjourns.Adjourns().list_menu()
        for key, label, tp in li_adjourns:
            menu.opcion((True, key, tp), label, Iconos.PuntoMagenta())
            menu.addSeparator()
        menu.addSeparator()
        mr = menu.submenu(_("Remove"), Iconos.Borrar())
        for key, label, tp in li_adjourns:
            mr.opcion((False, key, tp), label, Iconos.Delete())

        resp = menu.lanza()
        if resp:
            si_run, key, tp = resp
            if si_run:
                dic = Adjourns.Adjourns().get(key)
                Adjourns.Adjourns().remove(key)
                if tp == GT_AGAINST_ENGINE:
                    self.gestor = GestorPlayAgainstEngine.GestorPlayAgainstEngine(
                        self)
                    self.gestor.run_adjourn(dic)
                elif tp == GT_ALBUM:
                    self.gestor = GestorAlbum.GestorAlbum(self)
                    self.gestor.run_adjourn(dic)
                elif tp == GT_COMPETITION_WITH_TUTOR:
                    self.gestor = GestorCompeticion.GestorCompeticion(self)
                    self.gestor.run_adjourn(dic)
                elif tp == GT_ELO:
                    self.gestor = GestorElo.GestorElo(self)
                    self.gestor.run_adjourn(dic)
                elif tp in (GT_FIDE, GT_FICS, GT_LICHESS):
                    self.gestor = GestorFideFics.GestorFideFics(self)
                    self.gestor.selecciona(tp)
                    self.gestor.run_adjourn(dic)
                return

            else:
                Adjourns.Adjourns().remove(key)

            self.test_opcion_adjourns()
            self.main_window.pon_toolbar(self.li_opciones_inicio, atajos=True)
예제 #4
0
 def fideelo(self, siCompetitivo, nivel):
     self.gestor = GestorFideFics.GestorFideFics(self)
     self.gestor.selecciona("Fide")
     xid = self.gestor.eligeJuego(siCompetitivo, nivel)
     self.gestor.inicio(xid, siCompetitivo)
예제 #5
0
 def lichesselo(self, nivel):
     self.gestor = GestorFideFics.GestorFideFics(self)
     self.gestor.selecciona(GT_LICHESS)
     xid = self.gestor.elige_juego(nivel)
     self.gestor.inicio(xid)
예제 #6
0
 def fideelo(self, nivel):
     self.gestor = GestorFideFics.GestorFideFics(self)
     self.gestor.selecciona(GT_FIDE)
     xid = self.gestor.elige_juego(nivel)
     self.gestor.inicio(xid)
예제 #7
0
 def lichesselo(self, siCompetitivo, nivel):
     self.gestor = GestorFideFics.GestorFideFics(self)
     self.gestor.selecciona(kJugLichess)
     xid = self.gestor.eligeJuego(siCompetitivo, nivel)
     self.gestor.inicio(xid, siCompetitivo)