Exploring raycasters and possibly make a little "doom like" game based on it.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
raycaster/levelmanager.hpp

44 lines
1.0 KiB

#pragma once
#include "dinkyecs.hpp"
#include "lights.hpp"
#include "map.hpp"
#include <vector>
#include <memory>
#include "spatialmap.hpp"
#include "components.hpp"
#include "boss_fight_ui.hpp"
using std::shared_ptr;
struct GameLevel {
size_t index;
DinkyECS::Entity player;
shared_ptr<Map> map = nullptr;
shared_ptr<DinkyECS::World> world = nullptr;
shared_ptr<lighting::LightRender> lights = nullptr;
shared_ptr<SpatialMap> collision = nullptr;
};
struct LevelScaling {
int map_width=20;
int map_height=20;
};
class LevelManager {
public:
components::ComponentMap $components;
std::vector<GameLevel> $levels;
size_t $current_level = 0;
LevelManager();
shared_ptr<gui::BossFightUI> create_bossfight(shared_ptr<DinkyECS::World> prev_world);
size_t create_level(shared_ptr<DinkyECS::World> prev_world = nullptr);
GameLevel &next();
GameLevel &previous();
GameLevel &current();
size_t current_index() { return $current_level; }
GameLevel &get(size_t index);
LevelScaling scale_level();
};