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
32
src/game/worldbuilder.hpp
Normal file
32
src/game/worldbuilder.hpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#pragma once
|
||||
|
||||
#include "game/map.hpp"
|
||||
#include "algos/dinkyecs.hpp"
|
||||
#include "game/components.hpp"
|
||||
#include "algos/spatialmap.hpp"
|
||||
|
||||
class WorldBuilder {
|
||||
public:
|
||||
Map& $map;
|
||||
SpatialMap& $collision;
|
||||
|
||||
WorldBuilder(Map &map, SpatialMap& collision) :
|
||||
$map(map),
|
||||
$collision(collision)
|
||||
{ }
|
||||
|
||||
void generate_map();
|
||||
|
||||
DinkyECS::Entity configure_entity_in_map(DinkyECS::World &world, nlohmann::json &entity_data, Point pos);
|
||||
|
||||
DinkyECS::Entity configure_entity_in_room(DinkyECS::World &world, nlohmann::json &entity_data, int in_room);
|
||||
|
||||
bool find_open_spot(Point& pos_out);
|
||||
void place_entities(DinkyECS::World &world);
|
||||
void generate(DinkyECS::World &world);
|
||||
void randomize_entities(DinkyECS::World &world, components::GameConfig &config);
|
||||
void place_stairs(DinkyECS::World& world, components::GameConfig& config);
|
||||
void place_doors(DinkyECS::World& world, components::GameConfig& config);
|
||||
void configure_starting_items(DinkyECS::World &world);
|
||||
void stylize_rooms();
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue