First cut of pulling out the relevant parts of my original game to make a little framework.
This commit is contained in:
commit
6a0c9e8d46
177 changed files with 18197 additions and 0 deletions
34
src/game/level.hpp
Normal file
34
src/game/level.hpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#pragma once
|
||||
|
||||
#include "algos/dinkyecs.hpp"
|
||||
#include "graphics/lights.hpp"
|
||||
#include "game/map.hpp"
|
||||
#include <memory>
|
||||
#include "algos/spatialmap.hpp"
|
||||
|
||||
namespace components {
|
||||
struct Position;
|
||||
}
|
||||
|
||||
namespace GameDB {
|
||||
struct Level {
|
||||
size_t index = 0;
|
||||
DinkyECS::Entity player = DinkyECS::NONE;
|
||||
std::shared_ptr<Map> map = nullptr;
|
||||
std::shared_ptr<DinkyECS::World> world = nullptr;
|
||||
std::shared_ptr<lighting::LightRender> lights = nullptr;
|
||||
std::shared_ptr<SpatialMap> collision = nullptr;
|
||||
};
|
||||
|
||||
Level& create_level();
|
||||
|
||||
void init();
|
||||
Level ¤t_level();
|
||||
std::shared_ptr<DinkyECS::World> current_world();
|
||||
components::Position& player_position();
|
||||
DinkyECS::Entity the_player();
|
||||
|
||||
std::shared_ptr<DinkyECS::World> clone_load_world(std::shared_ptr<DinkyECS::World> prev_world);
|
||||
void load_configs(DinkyECS::World &world);
|
||||
void register_level(Level level);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue