private static Checkers_piece[,] Simulate_a_move(Color moving_player_color, Draughts_checkers original_game, Coordinates origin, Coordinates destination)//does nor change original_board { //Console.WriteLine("Ruch probuje wykonac gracz " + moving_player_color); Draughts_checkers simulate_game = new Draughts_checkers(original_game.Number_of_fields_in_row, original_game.Number_of_pieces_per_player); var white_key = simulate_game.Generate_player_key(Color.White); var black_key = simulate_game.Generate_player_key(Color.Black); simulate_game.Set_board(original_game.Check_active_player(), original_game.Get_copy_of_board(original_game.Check_active_player())); simulate_game.Last_moved_piece_coords = original_game.Last_moved_piece_coords; simulate_game.Last_moved_piece_coords_color = original_game.Last_moved_piece_coords_color; //Console.WriteLine("Aktywny gracz to " + simulate_game.Check_active_player()); int active_simulation_player_key = 0; if (moving_player_color == Color.Black) { active_simulation_player_key = black_key; } else { active_simulation_player_key = white_key; } simulate_game.Make_move(active_simulation_player_key, origin, destination); //Console.WriteLine("Tu sie powiodlo."); return(simulate_game.Get_copy_of_board(moving_player_color)); }
public static void Make_move_and_display_boards(ref Draughts_checkers game, int player_secret_key, Coordinates origin, Coordinates destination) { Console.WriteLine("\n" + origin.ToString() + " -> " + destination.ToString()); game.Make_move(player_secret_key, origin, destination); Display_Board.Display_board_of_game(game, game.Check_player_color(player_secret_key)); Display_Board.Display_board_of_game(game, game.Check_active_player()); }