A retro style homage to 80s dungeon crawlers hand crafted in C++.
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
raycaster/worldbuilder.hpp

35 lines
1.1 KiB

#pragma once
#include "map.hpp"
#include "dinkyecs.hpp"
#include "components.hpp"
class WorldBuilder {
public:
Map& $map;
DinkyECS::ComponentMap& $components;
WorldBuilder(Map &map, DinkyECS::ComponentMap& components) :
$map(map),
$components(components)
{ }
void partition_map(Room &cur, int depth);
void make_room(size_t origin_y, size_t origin_x, size_t width, size_t height);
void add_door(Room &room);
void set_door(Room &room, int value);
void place_rooms();
void tunnel_doors(PointList &holes, Room &src, Room &target);
void update_door(Point &at, int wall_or_space);
void stylize_room(int room, string tile_name, float size);
void generate_rooms();
void generate_map();
DinkyECS::Entity configure_entity_in_map(DinkyECS::World &world, nlohmann::json &entity_data, int in_room);
void place_entities(DinkyECS::World &world);
void generate(DinkyECS::World &world);
void random_entity(DinkyECS::World &world, components::GameConfig &config);
void randomize_entities(DinkyECS::World &world, components::GameConfig &config);
void place_stairs(DinkyECS::World& world, components::GameConfig& config);
};