Kind of working save now, but does have problems with dead things.
This commit is contained in:
parent
99d56b246c
commit
b2ed598c1f
5 changed files with 24 additions and 7 deletions
2
save.cpp
2
save.cpp
|
@ -26,6 +26,7 @@ void save::to_file(fs::path path, DinkyECS::World &world, Map &map) {
|
|||
extract<Position>(world, save_data.position);
|
||||
extract<Combat>(world, save_data.combat);
|
||||
extract<Motion>(world, save_data.motion);
|
||||
extract<Tile>(world, save_data.tile);
|
||||
|
||||
archive.save(save_data);
|
||||
std::string_view archive_view = archive.get_buffer();
|
||||
|
@ -66,6 +67,7 @@ void save::from_file(fs::path path, DinkyECS::World &world_out, Map &map_out) {
|
|||
inject<Position>(world_out, save_data.position);
|
||||
inject<Combat>(world_out, save_data.combat);
|
||||
inject<Motion>(world_out, save_data.motion);
|
||||
inject<Tile>(world_out, save_data.tile);
|
||||
|
||||
map_out = Map(save_data.map.input_map,
|
||||
save_data.map.walls, save_data.map.limit);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue