Exemple #1
0
    def inicio(self, album, cromo, aplazamiento=None):

        if aplazamiento:
            album = aplazamiento["ALBUM"]
            cromo = aplazamiento["CROMO"]
            self.reinicio = aplazamiento
        else:
            self.reinicio = {"ALBUM": album, "CROMO": cromo}

        siBlancas = cromo.siBlancas

        self.tipoJuego = kJugAlbum

        self.album = album
        self.cromo = cromo

        self.resultado = None
        self.siJuegaHumano = False
        self.estado = kJugando

        self.siJugamosConBlancas = siBlancas
        self.siRivalConBlancas = not siBlancas

        self.siTutorActivado = False
        self.pantalla.ponActivarTutor(False)
        self.ayudasPGN = self.ayudas = 0

        # -Aplazamiento 1/2--------------------------------------------------
        if aplazamiento:
            self.partida.recuperaDeTexto(aplazamiento["JUGADAS"])
            self.listaAperturasStd.asignaApertura(self.partida)

        self.xrival = Albums.GestorMotorAlbum(self, self.cromo)
        self.pantalla.ponToolBar(
            (k_rendirse, k_aplazar, k_configurar, k_utilidades))

        self.pantalla.activaJuego(True, False, siAyudas=False)
        self.ponMensajero(self.mueveHumano)
        self.ponPosicion(self.partida.ultPosicion)
        self.ponPiezasAbajo(siBlancas)
        self.quitaAyudas(True, siQuitarAtras=True)
        self.mostrarIndicador(True)

        self.pantalla.base.lbRotulo1.ponImagen(self.cromo.pixmap_level())
        self.pantalla.base.lbRotulo2.ponImagen(self.cromo.pixmap())
        self.pgnRefresh(True)
        self.ponCapInfoPorDefecto()

        # -Aplazamiento 2/2--------------------------------------------------
        if aplazamiento:
            self.mueveJugada(kMoverFinal)
            self.siPrimeraJugadaHecha = True
        else:
            self.siPrimeraJugadaHecha = False

        self.ponPosicionDGT()

        self.siguienteJugada()
Exemple #2
0
    def base_inicio(self, album, cromo):
        self.reinicio = {
            "ALBUM": album,
            "CROMO": cromo,
            "ISWHITE": cromo.is_white
        }

        is_white = cromo.is_white

        self.game_type = GT_ALBUM

        self.album = album
        self.cromo = cromo

        self.resultado = None
        self.human_is_playing = False
        self.state = ST_PLAYING

        self.is_human_side_white = is_white
        self.is_engine_side_white = not is_white

        self.is_tutor_enabled = False
        self.main_window.ponActivarTutor(False)
        self.ayudas_iniciales = self.ayudas = 0

        self.xrival = Albums.GestorMotorAlbum(self, self.cromo)
        self.main_window.pon_toolbar(
            (TB_RESIGN, TB_ADJOURN, TB_CONFIG, TB_UTILITIES))

        self.main_window.activaJuego(True, False, siAyudas=False)
        self.set_dispatcher(self.mueve_humano)
        self.setposition(self.game.last_position)
        self.ponPiezasAbajo(is_white)
        self.quitaAyudas(True, siQuitarAtras=True)
        self.mostrarIndicador(True)

        self.main_window.base.lbRotulo1.ponImagen(self.cromo.pixmap_level())
        self.main_window.base.lbRotulo2.ponImagen(self.cromo.pixmap())
        self.pgnRefresh(True)
        self.ponCapInfoPorDefecto()

        self.dgt_setposition()

        player = self.configuracion.nom_player()
        other = self.cromo.name
        w, b = (player, other) if self.is_human_side_white else (_F(other),
                                                                 player)

        self.game.add_tag("White", w)
        self.game.add_tag("Black", b)