示例#1
0
    def __init__(self,
                 owner,
                 xtutor,
                 jg,
                 siBlancas,
                 cPuntosBase,
                 maxRecursion=100000):

        self.owner = owner
        self.xtutor = xtutor
        self.jg = jg
        self.siBlancas = siBlancas
        self.posicionBase = jg.posicionBase
        self.siMoviendoTiempo = False

        self.rm = None

        if self.xtutor.motorTiempoJugada:
            segundosPensando = self.xtutor.motorTiempoJugada / 1000  # esta en milesimas
            if self.xtutor.motorTiempoJugada % 1000 > 0:
                segundosPensando += 1
        else:
            segundosPensando = 3

        self.w = PantallaAnalisis.WAnalisisVariantes(self, self.owner,
                                                     segundosPensando,
                                                     self.siBlancas,
                                                     cPuntosBase, maxRecursion)
        self.reset()
        self.w.exec_()
示例#2
0
def muestraAnalisis(procesador,
                    xtutor,
                    jg,
                    siBlancas,
                    maxRecursion,
                    posJugada,
                    pantalla=None,
                    siGrabar=True):
    pantalla = procesador.pantalla if pantalla is None else pantalla

    ma = MuestraAnalisis(procesador, jg, maxRecursion, posJugada)
    if xtutor is None:
        xtutor = procesador.XTutor()
    um0 = ma.creaMuestraInicial(pantalla, xtutor)
    if not um0:
        return
    siLibre = maxRecursion > 0
    wa = PantallaAnalisis.WAnalisis(ma, pantalla, siBlancas, siLibre, siGrabar,
                                    um0)
    wa.exec_()

    busca = True
    for uno in ma.liMuestras:
        if busca:
            if uno.siActiva:
                jg.analisis = uno.mrm, uno.posElegida

                busca = False
        xmotor = uno.xmotor
        if not xtutor or xmotor.clave != xtutor.clave:
            xmotor.terminar()
示例#3
0
def show_analysis(procesador,
                  xtutor,
                  move,
                  is_white,
                  max_recursion,
                  pos_move,
                  main_window=None,
                  must_save=True):
    main_window = procesador.main_window if main_window is None else main_window

    ma = MuestraAnalisis(procesador, move, max_recursion, pos_move)
    if xtutor is None:
        xtutor = procesador.XTutor()
    um0 = ma.create_initial_show(main_window, xtutor)
    if not um0:
        return
    si_libre = max_recursion > 0
    wa = PantallaAnalisis.WAnalisis(ma, main_window, is_white, si_libre,
                                    must_save, um0)
    wa.exec_()

    busca = True
    for uno in ma.li_tabs_analysis:
        if busca:
            if uno.is_active:
                move.analysis = uno.mrm, uno.pos_selected

                busca = False
        xengine = uno.xengine
        if not xtutor or xengine.clave != xtutor.clave:
            xengine.terminar()
示例#4
0
    def __init__(self,
                 owner,
                 xtutor,
                 move,
                 is_white,
                 cbase_points,
                 max_recursion=100000):

        self.owner = owner
        self.xtutor = xtutor
        self.move = move
        self.is_white = is_white
        self.position_before = move.position_before
        self.is_moving_time = False

        self.time_function = None
        self.time_pos_max = None
        self.time_pos = None
        self.time_others_tb = None
        self.rm = None
        self.pos_tutor = None
        self.max_tutor = None
        self.game_tutor = None

        if self.xtutor.motorTiempoJugada:
            segundos_pensando = self.xtutor.motorTiempoJugada / 1000  # esta en milesimas
            if self.xtutor.motorTiempoJugada % 1000 > 0:
                segundos_pensando += 1
        else:
            segundos_pensando = 3

        self.w = PantallaAnalisis.WAnalisisVariantes(self, self.owner,
                                                     segundos_pensando,
                                                     self.is_white,
                                                     cbase_points,
                                                     max_recursion)
        self.reset()
        self.w.exec_()