la till .get<std::string>() för constructor problem med clang
authorLukel495 <lukas.eliasson@live.se>
Wed, 6 Dec 2023 22:45:42 +0000 (23:45 +0100)
committerLukel495 <lukas.eliasson@live.se>
Wed, 6 Dec 2023 22:45:42 +0000 (23:45 +0100)
src/GameOver_menu.cc
src/Scoreboard_menu.cc

index c55f2cb0fff0c0bbca9fbc9c3d0a4c087fa8fec1..b54de21e93485cd96764ac50b8c55dbfc892ccce 100644 (file)
@@ -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::string>()};
     std::vector<std::string> lines_read;
     std::vector<std::string> 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<std::string>()};
     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
index b8c5dcc4d212bc211db02978371c0dc395d87421..b402cc993b23383de96421f04f5dc9758e6da32f 100644 (file)
@@ -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>()};
 
     std::string csv_content{};
     int index{0};