示例#1
0
 def win_test(self):
     """ Testing a white player win. """
     game.Game.reload_variables()
     chessboard.clear_chessboard()
     test_3()
     score.points_load()
     moves.check_available_moves(game.Game.path_list, game.Game.path_points)
     rules.player_move(6, 5, 4, 7)
     if not game.Game.black_score:
         print("White wins test passed.")
示例#2
0
 def promotion_test(self):
     """ Testing a promotion. """
     game.Game.reload_variables()
     chessboard.clear_chessboard()
     test_2()
     score.points_load()
     moves.check_available_moves(game.Game.path_list, game.Game.path_points)
     rules.player_move(1, 2, 0, 3)
     if game.Game.board[0][3] == con.WHITE_QUEEN and \
             game.Game.board[1][2] == con.EMPTY_FIELD:
         print("Promotion test passed.")
示例#3
0
    def service_of_tests(start_x, start_y):
        """ SERVICING TESTS. """
        # PRZYCISK RESTARTU
        if Look.restart_button.is_over(start_x, start_y):
            game.Game.reload_variables()
            chessboard.clear_chessboard()
            chessboard.set_game()
            chessboard.show_board()
            score.points_load()

        # PRZYCISKI TESTOW
        if Look.test_hit_button.is_over(start_x, start_y):
            game.Game.reload_variables()
            chessboard.clear_chessboard()
            tests.test_1()
            chessboard.show_board()
            score.points_load()

        if Look.test_promo_button.is_over(start_x, start_y):
            game.Game.reload_variables()
            chessboard.clear_chessboard()
            tests.test_2()
            chessboard.show_board()
            score.points_load()

        if Look.test_win_button.is_over(start_x, start_y):
            game.Game.reload_variables()
            chessboard.clear_chessboard()
            tests.test_3()
            chessboard.show_board()
            score.points_load()
示例#4
0
 def multi_hit_test(self):
     """ Testing a multi hit by pawn. """
     game.Game.reload_variables()
     chessboard.clear_chessboard()
     test_1()
     score.points_load()
     moves.check_available_moves(game.Game.path_list, game.Game.path_points)
     rules.player_move(5, 4, 3, 2)
     rules.player_move(3, 2, 1, 0)
     for i in [2, 3, 4, 5]:
         if not game.Game.board[i][i - 1] == con.EMPTY_FIELD:
             break
     if game.Game.board[1][0] == con.WHITE_PAWN:
         print("Multi-hit test passed.")
示例#5
0
 def reset_game(self):
     game.Game.reload_variables()
     chessboard.clear_chessboard()
     chessboard.set_game()
     score.points_load()