#include #include "backend/Dungeon.h" #include "backend/print.h" #include "backend/Exception.h" #include "rl.h" #include "generate_dungeon.h" #include "GameData.h" using namespace std; unique_ptr generate_dungeon() { unique_ptr dungeon = make_unique(); GameData & gd = GameData::get_instance(); lprtf("Hoeveel locaties moet de kerker hebben?\n"); unsigned location_count = 1; try { string filename = rl(); location_count = stoul(filename); } catch (...) { throw Exception("geen geldig aantal ingevoerd"); } if (location_count < 1) throw Exception("meer dan 1 locatie nodig"); vector locations = gd.random_locations(location_count); for (const string & name : locations) { Location * location = gd.create_location(name); dungeon->add_location(location); } // TODO: connect locations // TODO: optionally add enemy // TODO: generate items return dungeon; }