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:
parent
da63f006c2
commit
6add24fed2
2 changed files with 13 additions and 10 deletions
6
save.hpp
6
save.hpp
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue