Big revelation is that anytime you're doing file I/O you _must_ use std::filesystem. It simplifies so much about working with files.

This commit is contained in:
Zed A. Shaw 2024-11-06 02:40:29 -05:00
parent da63f006c2
commit 6add24fed2
2 changed files with 13 additions and 10 deletions

View file

@ -3,10 +3,12 @@
#include "components.hpp"
#include "dinkyecs.hpp"
#include "tser.hpp"
#include <filesystem>
#include <string>
#include <map>
namespace save {
namespace fs = std::filesystem;
struct Facts {
components::Player player;
@ -24,7 +26,7 @@ namespace save {
DEFINE_SERIALIZABLE(SaveData, facts, position, motion, combat);
};
void to_file(std::string path, DinkyECS::World &world);
void from_file(std::string path, DinkyECS::World &world_out);
void to_file(fs::path path, DinkyECS::World &world);
void from_file(fs::path path, DinkyECS::World &world_out);
void load_configs(DinkyECS::World &world);
}