Functions

pathutils.cpp File Reference

Various pathfinding functions and utilities. More...

#include "global.hpp"
#include "pathutils.hpp"
#include "map.hpp"
Include dependency graph for pathutils.cpp:

Go to the source code of this file.

Functions

void get_tile_ring (const map_location &a, const int r, std::vector< map_location > &res)
 Function which, given a location, will place all locations in a ring of distance r in res.
void get_tiles_in_radius (const map_location &a, const int r, std::vector< map_location > &res)
 Function which, given a location, will place all locations in the radius of r in res res must be a std::vector of location.
static void get_tiles_radius_internal (const map_location &a, size_t radius, std::set< map_location > &res, std::map< map_location, int > &visited)
void get_tiles_radius (const map_location &a, size_t radius, std::set< map_location > &res)
 Function which, given a location, will find all tiles within 'radius' of that tile.
void get_tiles_radius (gamemap const &map, std::vector< map_location > const &locs, size_t radius, std::set< map_location > &res, bool with_border, xy_pred *pred)
 Function which, given a set of locations, will find all tiles within 'radius' of those tiles.

Detailed Description

Various pathfinding functions and utilities.

Definition in file pathutils.cpp.


Function Documentation

void get_tile_ring ( const map_location a,
const int  r,
std::vector< map_location > &  res 
)

Function which, given a location, will place all locations in a ring of distance r in res.

res must be a std::vector of location

Definition at line 27 of file pathutils.cpp.

References map_location::get_direction(), and map_location::SOUTH_WEST.

Referenced by get_tiles_in_radius().

Here is the call graph for this function:

Here is the caller graph for this function:

void get_tiles_in_radius ( const map_location a,
const int  r,
std::vector< map_location > &  res 
)

Function which, given a location, will place all locations in the radius of r in res res must be a std::vector of location.

Definition at line 44 of file pathutils.cpp.

References get_tile_ring().

Referenced by editor::brush::brush().

Here is the call graph for this function:

Here is the caller graph for this function:

void get_tiles_radius ( const map_location a,
size_t  radius,
std::set< map_location > &  res 
)

Function which, given a location, will find all tiles within 'radius' of that tile.

Definition at line 70 of file pathutils.cpp.

References get_tiles_radius_internal().

Referenced by terrain_filter::get_locations(), terrain_filter::match(), and place_village().

Here is the call graph for this function:

Here is the caller graph for this function:

void get_tiles_radius ( gamemap const &  map,
std::vector< map_location > const &  locs,
size_t  radius,
std::set< map_location > &  res,
bool  with_border,
xy_pred pred 
)

Function which, given a set of locations, will find all tiles within 'radius' of those tiles.

Definition at line 77 of file pathutils.cpp.

References get_adjacent_tiles(), gamemap::on_board(), and gamemap::on_board_with_border().

Here is the call graph for this function:

static void get_tiles_radius_internal ( const map_location a,
size_t  radius,
std::set< map_location > &  res,
std::map< map_location, int > &  visited 
) [static]

Definition at line 51 of file pathutils.cpp.

References get_adjacent_tiles().

Referenced by get_tiles_radius().

Here is the call graph for this function:

Here is the caller graph for this function:

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:08:38 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs