Various pathfinding functions and utilities. More...
Go to the source code of this file.
Functions | |
void | get_tile_ring (const map_location ¢er, const int radius, std::vector< map_location > &result) |
Function that will add to result all locations exactly radius tiles from center (or nothing if radius is not positive). More... | |
void | get_tiles_in_radius (const map_location ¢er, const int radius, std::vector< map_location > &result) |
Function that will add to result all locations within radius tiles of center (excluding center itself). More... | |
void | get_tiles_radius (const map_location ¢er, std::size_t radius, std::set< map_location > &result) |
Function that will add to result all locations within radius tiles of center (including center itself). More... | |
void | get_tiles_radius (const gamemap &map, const std::vector< map_location > &locs, std::size_t radius, std::set< map_location > &result, bool with_border) |
Function that will add to result all elements of locs, plus all on-board locations that are within radius tiles of an element of locs. More... | |
void | get_tiles_radius (const gamemap &map, const std::vector< map_location > &locs, std::size_t radius, std::set< map_location > &result, bool with_border, const xy_pred &pred) |
Function that will add to result all elements of locs, plus all on-board locations matching pred that are connected to elements of locs by a chain of at most radius tiles, each of which matches pred. More... | |
Various pathfinding functions and utilities.
Definition in file pathutils.cpp.
void get_tile_ring | ( | const map_location & | center, |
const int | radius, | ||
std::vector< map_location > & | result | ||
) |
Function that will add to result all locations exactly radius tiles from center (or nothing if radius is not positive).
result must be a std::vector of locations.
Definition at line 32 of file pathutils.cpp.
References map_location::get_direction(), i, n, and map_location::south_west.
Referenced by get_tiles_in_radius(), and lua_map_location::intf_get_tile_ring().
void get_tiles_in_radius | ( | const map_location & | center, |
const int | radius, | ||
std::vector< map_location > & | result | ||
) |
Function that will add to result all locations within radius tiles of center (excluding center itself).
result must be a std::vector of locations.
Definition at line 56 of file pathutils.cpp.
References get_tile_ring(), and n.
Referenced by editor::brush::brush(), wfl::builtins::DEFINE_WFL_FUNCTION(), wfl::gamestate::DEFINE_WFL_FUNCTION(), get_tiles_radius(), lua_map_location::intf_get_tiles_in_radius(), ai::default_recruitment::recruitment::is_enemy_in_radius(), and ai::default_recruitment::recruitment::update_important_hexes().
void get_tiles_radius | ( | const gamemap & | map, |
const std::vector< map_location > & | locs, | ||
std::size_t | radius, | ||
std::set< map_location > & | result, | ||
bool | with_border | ||
) |
Function that will add to result all elements of locs, plus all on-board locations that are within radius tiles of an element of locs.
result must be a std::set of locations.
Definition at line 203 of file pathutils.cpp.
References border, gamemap_base::border_size(), gamemap_base::h(), and gamemap_base::w().
void get_tiles_radius | ( | const gamemap & | map, |
const std::vector< map_location > & | locs, | ||
std::size_t | radius, | ||
std::set< map_location > & | result, | ||
bool | with_border, | ||
const xy_pred & | pred | ||
) |
Function that will add to result all elements of locs, plus all on-board locations matching pred that are connected to elements of locs by a chain of at most radius tiles, each of which matches pred.
result must be a std::set of locations.
Definition at line 242 of file pathutils.cpp.
References get_tiles_radius(), gamemap_base::on_board(), and gamemap_base::on_board_with_border().
void get_tiles_radius | ( | const map_location & | center, |
std::size_t | radius, | ||
std::set< map_location > & | result | ||
) |
Function that will add to result all locations within radius tiles of center (including center itself).
result must be a std::set of locations.
Definition at line 70 of file pathutils.cpp.
References get_tiles_in_radius().
Referenced by terrain_filter::get_locs_impl(), get_tiles_radius(), intf_mg_get_tiles_radius(), terrain_filter::match_impl(), and place_village().