You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
744 B
32 lines
744 B
#pragma once
|
|
|
|
#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;
|
|
|
|
DEFINE_SERIALIZABLE(Facts, player);
|
|
};
|
|
|
|
struct SaveData {
|
|
Facts facts;
|
|
|
|
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);
|
|
};
|
|
|
|
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);
|
|
}
|
|
|