Kind of working save now, but does have problems with dead things.

This commit is contained in:
Zed A. Shaw 2024-11-06 15:06:10 -05:00
parent 99d56b246c
commit b2ed598c1f
5 changed files with 24 additions and 7 deletions

View file

@ -8,8 +8,10 @@
#include "render.hpp"
#include "save.hpp"
#include "ftxui/screen/terminal.hpp" // for SetColorSupport, Color, TrueColor
#include <filesystem>
using namespace ftxui;
namespace fs = std::filesystem;
/*
* This needs to be turned into a real world generator
@ -48,14 +50,21 @@ void configure_world(DinkyECS::World &world, Map &game_map) {
}
int main() {
int main(int argc, char *argv[]) {
DinkyECS::World world;
Map game_map(GAME_MAP_X, GAME_MAP_Y);
game_map.generate();
save::load_configs(world);
configure_world(world, game_map);
if(argc == 2) {
fmt::println("Loading save file {}", argv[1]);
fs::path save_path{argv[1]};
save::from_file(save_path, world, game_map);
} else {
game_map.generate();
configure_world(world, game_map);
}
spatial_map collider;
world.set_the<spatial_map>(collider);