"""
        Get the id of the last move
        """
        
        self.update_games()
        return self.last_movement[0]

    def get_movement_last_move(self):
        """
        Get the movement did on the last move
        """
        
        return self.last_movement[1]

    def define_winner(self):
        """
        Function used to define who wons
        """
        return _define_winner(self.last_turn[0])


def show_dialog_result((name_team_a, name_team_b), winner):
    """
    Simple function that show a dialog with the result of a game
    """
    not_dig = notify_result.notifyResult((name_team_a, name_team_b), winner)
    not_dig.dlg_result.run()

    while gtk.events_pending():
        gtk.main_iteration(False)
        """
        Get the id of the last move
        """

        self.update_games()
        return self.last_movement[0]

    def get_movement_last_move(self):
        """
        Get the movement did on the last move
        """

        return self.last_movement[1]

    def define_winner(self):
        """
        Function used to define who wons
        """
        return _define_winner(self.last_turn[0])


def show_dialog_result((name_team_a, name_team_b), winner):
    """
    Simple function that show a dialog with the result of a game
    """
    not_dig = notify_result.notifyResult((name_team_a, name_team_b), winner)
    not_dig.dlg_result.run()

    while gtk.events_pending():
        gtk.main_iteration(False)
Exemplo n.º 3
0
    return res


def run_from_file(src_file,
                  team_a=('equipoA', xdg_data_path('images/piece-orange.png')),
                  team_b=('equipoB',
                          xdg_data_path('images/piece-violete.png')),
                  path_piece_def=xdg_data_path('images/piece-default.png'),
                  xml_file=xdg_data_path('layouts/alternative-layout.xml')):
    """
    Muestra un juego en pantalla directamente desde un fichero de un juego
    previamente simulado
    """
    name_a, name_b = filenames.extract_names_from_file(src_file)

    team_a = (name_a, team_a[1])
    team_b = (name_b, team_b[1])

    _load_game_from_file(src_file, team_a, team_b, path_piece_def, xml_file)


def show_dialog_result((team_a, team_b), winner):
    """
    Simple function that show a dialog with the result of a game
    """
    _not_dig = notify_result.notifyResult((team_a, team_b), winner)
    _not_dig.dlg_result.run()

    while gtk.events_pending():
        gtk.main_iteration(False)
Exemplo n.º 4
0
def run_from_file(src_file,
                  team_a=('equipoA', xdg_data_path('images/piece-orange.png')),
                  team_b=('equipoB', xdg_data_path('images/piece-violete.png')),
                  path_piece_def=xdg_data_path('images/piece-default.png'),
                  xml_file=xdg_data_path('layouts/alternative-layout.xml')):
    """
    Muestra un juego en pantalla directamente desde un fichero de un juego
    previamente simulado
    """
    name_a, name_b = filenames.extract_names_from_file(src_file)

    team_a = (name_a, team_a[1])
    team_b = (name_b, team_b[1])

    _load_game_from_file(src_file, 
                         team_a, team_b,
                         path_piece_def, xml_file)



def show_dialog_result((team_a, team_b), winner):
    """
    Simple function that show a dialog with the result of a game
    """
    _not_dig = notify_result.notifyResult((team_a, team_b), winner)
    _not_dig.dlg_result.run()

    while gtk.events_pending():
        gtk.main_iteration(False)