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:
Zed A. Shaw 2025-01-24 06:22:43 -05:00
parent 3344181a47
commit c14efee9ea
9 changed files with 100 additions and 96 deletions

View file

@ -5,6 +5,7 @@
#include "map.hpp"
#include <vector>
#include <memory>
#include "spatialmap.hpp"
struct GameLevel {
@ -12,6 +13,7 @@ struct GameLevel {
std::shared_ptr<Map> map;
std::shared_ptr<DinkyECS::World> world;
std::shared_ptr<lighting::LightRender> lights;
std::shared_ptr<SpatialMap> collision;
};
class LevelManager {
@ -25,6 +27,6 @@ class LevelManager {
GameLevel &next();
GameLevel &previous();
GameLevel &current();
size_t current_index();
size_t current_index() { return $current_level; }
GameLevel &get(size_t index);
};