Пример #1
0
    def __init__(self, wowner, configuration, recno):
        expedition = Everest.Expedition(configuration, recno)
        self.li_routes, self.current, svg, label = expedition.gen_routes()

        titulo = _("Everest")
        icono = Iconos.Trekking()
        extparam = "expedition"
        QTVarios.WDialogo.__init__(self, wowner, titulo, icono, extparam)

        self.selected = False

        wsvg = QtSvg.QSvgWidget()
        wsvg.load(QtCore.QByteArray(svg))
        wsvg.setFixedSize(762, int(762.0 * 520.0 / 1172.0))
        lySVG = Colocacion.H().relleno(1).control(wsvg).relleno(1)

        li_acciones = (
            (_("Climb"), Iconos.Empezar(), self.climb),
            None,
            (_("Close"), Iconos.MainMenu(), self.cancel),
            None,
        )
        tb = Controles.TBrutina(self, li_acciones).vertical()
        if self.current is None:
            tb.setAccionVisible(self.climb, False)

        lyRot = Colocacion.H()
        for elem in label:
            lb_rotulo = Controles.LB(self, elem).align_center()
            lb_rotulo.setStyleSheet(
                "QWidget { border-style: groove; border-width: 2px; border-color: LightSlateGray ;}"
            )
            lb_rotulo.ponTipoLetra(puntos=12, peso=700)
            lyRot.control(lb_rotulo)

        o_columns = Columnas.ListaColumnas()
        o_columns.nueva("ROUTE", _("Route"), 240, centered=True)
        o_columns.nueva("GAMES", _("Games"), 80, centered=True)
        o_columns.nueva("DONE", _("Done"), 80, centered=True)
        o_columns.nueva("TIME", _("Time"), 80, centered=True)
        o_columns.nueva("MTIME", _("Average time"), 80, centered=True)
        o_columns.nueva("MPOINTS", _("Av. lost points"), 80, centered=True)
        o_columns.nueva("TRIES", _("Max tries"), 80, centered=True)
        o_columns.nueva("TOLERANCE", _("Tolerance"), 80, centered=True)
        grid = Grid.Grid(self,
                         o_columns,
                         siSelecFilas=True,
                         siSeleccionMultiple=False)
        grid.setMinimumWidth(grid.anchoColumnas() + 20)
        grid.coloresAlternados()

        lyG = Colocacion.V().otro(lyRot).control(grid).margen(0)

        lyR = Colocacion.H().control(tb).otro(lyG).margen(0)

        ly = Colocacion.V().otro(lySVG).otro(lyR).margen(3)

        self.setLayout(ly)

        self.restore_video(siTam=True, anchoDefecto=784, altoDefecto=670)
Пример #2
0
    def start(self, recno):

        self.expedition = Everest.Expedition(self.configuration, recno)
        self.expedition.run()

        self.dic_analysis = {}

        self.is_competitive = True
        self.resultado = None
        self.human_is_playing = False
        self.analysis = None
        self.comment = None
        self.siAnalizando = False
        self.human_side = self.expedition.is_white
        self.is_engine_side_white = not self.expedition.is_white
        self.gameObj = self.expedition.game
        self.game.set_tags(self.gameObj.li_tags)
        self.numJugadasObj = self.gameObj.num_moves()
        self.posJugadaObj = 0
        self.nombreObj = self.expedition.name

        self.xanalyzer.maximize_multipv()

        self.puntos = 0
        self.vtime = 0.0

        self.book = Opening.OpeningPol(999)

        self.main_window.pon_toolbar((TB_CANCEL, TB_REINIT, TB_CONFIG))

        self.main_window.activaJuego(True, False, siAyudas=False)
        self.remove_hints(True, True)

        self.set_dispatcher(self.player_has_moved)
        self.set_position(self.game.last_position)
        self.put_pieces_bottom(self.human_side)
        self.show_side_indicator(True)
        self.set_label1(self.expedition.label())
        self.set_label2("")

        self.pgnRefresh(True)
        self.ponCapInfoPorDefecto()
        self.check_boards_setposition()

        self.state = ST_PLAYING
        self.play_next_move()
Пример #3
0
    def inicio(self, recno):

        self.expedition = Everest.Expedition(self.configuracion, recno)
        self.expedition.run()

        self.dic_analysis = {}

        self.siCompetitivo = True
        self.resultado = None
        self.human_is_playing = False
        self.analysis = None
        self.comment = None
        self.siAnalizando = False
        self.is_human_side_white = self.expedition.is_white
        self.is_engine_side_white = not self.expedition.is_white
        self.partidaObj = self.expedition.game
        self.game.set_tags(self.partidaObj.li_tags)
        self.numJugadasObj = self.partidaObj.num_moves()
        self.posJugadaObj = 0
        self.nombreObj = self.expedition.name

        self.xanalyzer.maximizaMultiPV()

        self.puntos = 0
        self.vtime = 0.0

        self.book = Apertura.AperturaPol(999)

        self.main_window.pon_toolbar((TB_CANCEL, TB_REINIT, TB_CONFIG))

        self.main_window.activaJuego(True, False, siAyudas=False)
        self.quitaAyudas(True, True)

        self.set_dispatcher(self.mueve_humano)
        self.setposition(self.game.last_position)
        self.ponPiezasAbajo(self.is_human_side_white)
        self.mostrarIndicador(True)
        self.ponRotulo1(self.expedition.label())
        self.ponRotulo2("")

        self.pgnRefresh(True)
        self.ponCapInfoPorDefecto()
        self.dgt_setposition()

        self.state = ST_PLAYING
        self.siguiente_jugada()
Пример #4
0
    def inicio(self, recno):

        self.expedition = Everest.Expedition(self.configuracion, recno)
        self.expedition.run()

        self.dic_analysis = {}

        self.siCompetitivo = True
        self.resultado = None
        self.siJuegaHumano = False
        self.analisis = None
        self.comentario = None
        self.siAnalizando = False
        self.siJugamosConBlancas = self.expedition.is_white
        self.siRivalConBlancas = not self.expedition.is_white
        self.partidaObj = self.expedition.partida
        self.numJugadasObj = self.partidaObj.numJugadas()
        self.posJugadaObj = 0
        self.nombreObj = self.expedition.nombre

        self.xanalyzer.maximizaMultiPV()

        self.puntos = 0
        self.tiempo = 0.0

        self.book = Apertura.AperturaPol(999)

        self.pantalla.ponToolBar((k_cancelar, k_reiniciar, k_configurar))

        self.pantalla.activaJuego(True, False, siAyudas=False)
        self.quitaAyudas(True, True)

        self.ponMensajero(self.mueveHumano)
        self.ponPosicion(self.partida.ultPosicion)
        self.ponPiezasAbajo(self.siJugamosConBlancas)
        self.mostrarIndicador(True)
        self.ponRotulo1(self.expedition.label())
        self.ponRotulo2("")

        self.pgnRefresh(True)
        self.ponCapInfoPorDefecto()
        self.ponPosicionDGT()

        self.estado = kJugando
        self.siguienteJugada()