- Level level;
- const size_t width = 25;
- const size_t height = 19;
- level.add_sector(Sector::create("main", width, height));
- level.save(filename);
-}
-
-void
-Level::load(const std::string& filename)
-{
- std::string filepath;
- filepath = st_dir + "/levels/" + filename;
- if (access(filepath.c_str(), R_OK) != 0)
- {
- filepath = datadir + "/levels/" + filename;
- if (access(filepath.c_str(), R_OK) != 0)
- {
- std::cerr << "Error: Level: couldn't find level: " << filename << std::endl;
- return;
- }
- }
-