Looks like this is _possibly_ working but the last step of actually loading a save needs to be figured out.
This commit is contained in:
parent
6add24fed2
commit
99d56b246c
5 changed files with 37 additions and 9 deletions
16
save.hpp
16
save.hpp
|
@ -10,6 +10,15 @@
|
|||
namespace save {
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
struct MapData {
|
||||
std::vector<Room> rooms;
|
||||
Matrix input_map;
|
||||
Matrix walls;
|
||||
int limit;
|
||||
|
||||
DEFINE_SERIALIZABLE(MapData, rooms, input_map, walls);
|
||||
};
|
||||
|
||||
struct Facts {
|
||||
components::Player player;
|
||||
|
||||
|
@ -18,15 +27,16 @@ namespace save {
|
|||
|
||||
struct SaveData {
|
||||
Facts facts;
|
||||
MapData map;
|
||||
|
||||
std::map<DinkyECS::Entity, components::Position> position;
|
||||
std::map<DinkyECS::Entity, components::Motion> motion;
|
||||
std::map<DinkyECS::Entity, components::Combat> combat;
|
||||
|
||||
DEFINE_SERIALIZABLE(SaveData, facts, position, motion, combat);
|
||||
DEFINE_SERIALIZABLE(SaveData, facts, map, position, motion, combat);
|
||||
};
|
||||
|
||||
void to_file(fs::path path, DinkyECS::World &world);
|
||||
void from_file(fs::path path, DinkyECS::World &world_out);
|
||||
void to_file(fs::path path, DinkyECS::World &world, Map &map);
|
||||
void from_file(fs::path path, DinkyECS::World &world_out, Map &map);
|
||||
void load_configs(DinkyECS::World &world);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue