First step in refactoring to allow for multiple levels. Next is to clean up the APIs and sort out how things will be notified that they have to switch levels.
This commit is contained in:
parent
3344181a47
commit
c14efee9ea
9 changed files with 100 additions and 96 deletions
22
main.cpp
22
main.cpp
|
@ -10,6 +10,7 @@
|
|||
#include "save.hpp"
|
||||
#include "lights.hpp"
|
||||
#include "worldbuilder.hpp"
|
||||
#include "levelmanager.hpp"
|
||||
#include "ftxui/screen/terminal.hpp" // for SetColorSupport, Color, TrueColor
|
||||
#include <filesystem>
|
||||
#include <fcntl.h>
|
||||
|
@ -20,25 +21,8 @@ using namespace components;
|
|||
using lighting::LightSource;
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
DinkyECS::World world;
|
||||
Map game_map(GAME_MAP_X, GAME_MAP_Y);
|
||||
save::load_configs(world);
|
||||
|
||||
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 {
|
||||
WorldBuilder builder(game_map);
|
||||
builder.generate(world);
|
||||
}
|
||||
|
||||
SpatialMap collider;
|
||||
world.set_the<SpatialMap>(collider);
|
||||
System::init_positions(world);
|
||||
|
||||
GUI gui(world, game_map);
|
||||
int main() {
|
||||
GUI gui;
|
||||
|
||||
return gui.main();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue