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.
39 lines
902 B
39 lines
902 B
1 month ago
|
#pragma once
|
||
|
|
||
|
#include "components.hpp"
|
||
|
#include "map.hpp"
|
||
|
#include "dinkyecs.hpp"
|
||
|
#include <filesystem>
|
||
|
#include <string>
|
||
|
#include <map>
|
||
|
|
||
|
namespace save {
|
||
|
namespace fs = std::filesystem;
|
||
|
|
||
|
struct MapData {
|
||
|
size_t width;
|
||
|
size_t height;
|
||
|
std::vector<Room> rooms;
|
||
|
Matrix walls;
|
||
|
};
|
||
|
|
||
|
struct Facts {
|
||
|
components::Player player;
|
||
|
};
|
||
|
|
||
|
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;
|
||
|
std::map<DinkyECS::Entity, components::Tile> tile;
|
||
|
// std::map<DinkyECS::Entity, components::Inventory> inventory;
|
||
|
};
|
||
|
|
||
|
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);
|
||
|
}
|