From: Lukel495 Date: Wed, 6 Dec 2023 22:45:42 +0000 (+0100) Subject: la till .get() för constructor problem med clang X-Git-Url: https://gitweb.forssennils.se/?a=commitdiff_plain;h=d87972909c42f730b45380b8b4f44b7a9b362f25;p=TDDC76_proj.git la till .get() för constructor problem med clang --- diff --git a/src/GameOver_menu.cc b/src/GameOver_menu.cc index c55f2cb..b54de21 100644 --- a/src/GameOver_menu.cc +++ b/src/GameOver_menu.cc @@ -319,7 +319,7 @@ void GameOver_menu::load_to_csv(sf::Text playertext) std::string current_line{playerText.getString() + ", " + std::to_string(points)}; - std::ifstream highscore_file_r{data["game_constants"]["highscore_file"]}; + std::ifstream highscore_file_r{data["game_constants"]["highscore_file"].get()}; std::vector lines_read; std::vector lines_write; for (std::string one_line; std::getline(highscore_file_r, one_line);lines_read.push_back(one_line)); @@ -345,7 +345,7 @@ void GameOver_menu::load_to_csv(sf::Text playertext) highscore_file_r.close(); - std::ofstream highscore_file_w{data["game_constants"]["highscore_file"]}; + std::ofstream highscore_file_w{data["game_constants"]["highscore_file"].get()}; for (std::string::size_type line_count{0}; line_count < lines_write.size(); highscore_file_w << lines_write[line_count++] << std::endl); highscore_file_w.close(); } \ No newline at end of file diff --git a/src/Scoreboard_menu.cc b/src/Scoreboard_menu.cc index b8c5dcc..b402cc9 100644 --- a/src/Scoreboard_menu.cc +++ b/src/Scoreboard_menu.cc @@ -48,7 +48,7 @@ Scoreboard_menu::Scoreboard_menu(json& params) : texture{}, texture2{}, sprite{} // Scorelist // ----------------------------------------------------------------------- - std::ifstream highscore_file_r{data["game_constants"]["highscore_file"]}; + std::ifstream highscore_file_r{data["game_constants"]["highscore_file"].get()}; std::string csv_content{}; int index{0};