Almost working save sytem but the data I store is totally wrong. I need to also save the entity IDs being used and map them to the components.
This commit is contained in:
parent
babc190525
commit
d113dba42f
15 changed files with 213 additions and 64 deletions
21
save.hpp
Normal file
21
save.hpp
Normal file
|
@ -0,0 +1,21 @@
|
|||
#pragma once
|
||||
|
||||
#include "components.hpp"
|
||||
#include "dinkyecs.hpp"
|
||||
#include "tser.hpp"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace save {
|
||||
struct SaveData {
|
||||
components::Player player;
|
||||
std::vector<components::Position> position;
|
||||
std::vector<components::Motion> motion;
|
||||
std::vector<components::Combat> combat;
|
||||
|
||||
DEFINE_SERIALIZABLE(SaveData, player, position, motion, combat);
|
||||
};
|
||||
|
||||
void to_file(std::string path, DinkyECS::World &world);
|
||||
void from_file(std::string path, DinkyECS::World &world_out);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue