Classes | |
struct | chamber |
struct | passage |
Public Member Functions | |
cave_map_generator_job (const cave_map_generator ¶ms, utils::optional< uint32_t > randomseed={}) | |
void | generate_chambers () |
void | build_chamber (map_location loc, std::set< map_location > &locs, std::size_t size, std::size_t jagged) |
void | place_chamber (const chamber &c) |
void | place_passage (const passage &p) |
void | set_terrain (map_location loc, const t_translation::terrain_code &t) |
void | place_castle (int starting_position, const map_location &loc) |
std::size_t | translate_x (std::size_t x) const |
std::size_t | translate_y (std::size_t y) const |
Public Attributes | |
const cave_map_generator & | params |
bool | flipx_ |
bool | flipy_ |
t_translation::ter_map | map_ |
t_translation::starting_positions | starting_positions_ |
std::map< std::string, std::size_t > | chamber_ids_ |
std::vector< chamber > | chambers_ |
std::vector< passage > | passages_ |
config | res_ |
std::mt19937 | rng_ |
Definition at line 39 of file cave_map_generator.hpp.
cave_map_generator::cave_map_generator_job::cave_map_generator_job | ( | const cave_map_generator & | params, |
utils::optional< uint32_t > | randomseed = {} |
||
) |
Definition at line 84 of file cave_map_generator.cpp.
References config::add_child(), c, chambers_, flipx_, cave_map_generator::flipx_chance_, flipy_, cave_map_generator::flipy_chance_, generate_chambers(), LOG_NG, map_, seed_rng::next_seed(), p, params, passages_, place_chamber(), place_passage(), res_, rng_, starting_positions_, and t_translation::write_game_map().
void cave_map_generator::cave_map_generator_job::build_chamber | ( | map_location | loc, |
std::set< map_location > & | locs, | ||
std::size_t | size, | ||
std::size_t | jagged | ||
) |
Definition at line 128 of file cave_map_generator.cpp.
References get_adjacent_tiles(), and utf8::size().
void cave_map_generator::cave_map_generator_job::generate_chambers | ( | ) |
Definition at line 142 of file cave_map_generator.cpp.
References cave_map_generator::cave_map_generator_job::chamber::center, config::child_range(), dst, ERR_WML, id, cave_map_generator::cave_map_generator_job::chamber::items, cave_map_generator::cave_map_generator_job::chamber::locs, lg::log_to_chat(), p, and utils::split().
Referenced by cave_map_generator_job().
void cave_map_generator::cave_map_generator_job::place_castle | ( | int | starting_position, |
const map_location & | loc | ||
) |
Definition at line 353 of file cave_map_generator.cpp.
References gamemap_base::default_border, get_adjacent_tiles(), map_location::x, and map_location::y.
void cave_map_generator::cave_map_generator_job::place_chamber | ( | const chamber & | c | ) |
Definition at line 218 of file cave_map_generator.cpp.
References config::add_child(), c, i, utf8::index(), and config::optional_child().
Referenced by cave_map_generator_job().
void cave_map_generator::cave_map_generator_job::place_passage | ( | const passage & | p | ) |
Definition at line 311 of file cave_map_generator.cpp.
References pathfind::a_star_search(), i, p, and pathfind::plain_route::steps.
Referenced by cave_map_generator_job().
void cave_map_generator::cave_map_generator_job::set_terrain | ( | map_location | loc, |
const t_translation::terrain_code & | t | ||
) |
Definition at line 337 of file cave_map_generator.cpp.
References c, gamemap_base::default_border, t, map_location::x, and map_location::y.
std::size_t cave_map_generator::cave_map_generator_job::translate_x | ( | std::size_t | x | ) | const |
Definition at line 54 of file cave_map_generator.cpp.
References flipx_, params, and cave_map_generator::width_.
std::size_t cave_map_generator::cave_map_generator_job::translate_y | ( | std::size_t | y | ) | const |
Definition at line 63 of file cave_map_generator.cpp.
std::map<std::string,std::size_t> cave_map_generator::cave_map_generator_job::chamber_ids_ |
Definition at line 83 of file cave_map_generator.hpp.
std::vector<chamber> cave_map_generator::cave_map_generator_job::chambers_ |
Definition at line 84 of file cave_map_generator.hpp.
Referenced by cave_map_generator_job().
bool cave_map_generator::cave_map_generator_job::flipx_ |
Definition at line 79 of file cave_map_generator.hpp.
Referenced by cave_map_generator_job(), and translate_x().
bool cave_map_generator::cave_map_generator_job::flipy_ |
Definition at line 79 of file cave_map_generator.hpp.
Referenced by cave_map_generator_job().
t_translation::ter_map cave_map_generator::cave_map_generator_job::map_ |
Definition at line 81 of file cave_map_generator.hpp.
Referenced by cave_map_generator_job().
const cave_map_generator& cave_map_generator::cave_map_generator_job::params |
Definition at line 78 of file cave_map_generator.hpp.
Referenced by cave_map_generator_job(), and translate_x().
std::vector<passage> cave_map_generator::cave_map_generator_job::passages_ |
Definition at line 85 of file cave_map_generator.hpp.
Referenced by cave_map_generator_job().
config cave_map_generator::cave_map_generator_job::res_ |
Definition at line 86 of file cave_map_generator.hpp.
Referenced by cave_map_generator_job(), and cave_map_generator::create_scenario().
std::mt19937 cave_map_generator::cave_map_generator_job::rng_ |
Definition at line 87 of file cave_map_generator.hpp.
Referenced by cave_map_generator_job().
t_translation::starting_positions cave_map_generator::cave_map_generator_job::starting_positions_ |
Definition at line 82 of file cave_map_generator.hpp.
Referenced by cave_map_generator_job().