#include "global.hpp"
#include "astarnode.hpp"
#include "log.hpp"
#include "pathfind.hpp"
#include "util.hpp"
#include <cassert>
#include <cmath>
#include <iostream>
Go to the source code of this file.
Defines | |
#define | LOG_PF LOG_STREAM(info, engine) |
#define | DBG_PF LOG_STREAM(debug, engine) |
Typedefs | |
typedef std::vector < gamemap::location > | vector_location |
typedef std::vector < a_star_node * > | vector_a_star_node |
typedef std::set < gamemap::location > | set_location |
Functions | |
static bool | compare_lt_a_star_node (const a_star_node *node1, const a_star_node *node2) |
static void | a_star_init (gamemap::location const &src, gamemap::location const &dst, vector_a_star_node &openList, a_star_world &aStarGameWorld, const size_t parWidth, const size_t parHeight, vector_location &vectLocation, std::set< gamemap::location > const *teleports, size_t &parNbTeleport) |
static void | a_star_explore_neighbours (gamemap::location const &dst, const double stop_at, cost_calculator const *costCalculator, const size_t parWidth, const size_t parHeight, std::set< gamemap::location > const *teleports, vector_location &vectLocation, vector_a_star_node &openList, a_star_world &aStarGameWorld, a_star_node *parCurNode, const size_t parNbTeleport) |
paths::route | a_star_search (gamemap::location const &src, gamemap::location const &dst, double stop_at, cost_calculator const *costCalculator, const size_t parWidth, const size_t parHeight, std::set< gamemap::location > const *teleports) |
static void | get_tiles_radius_internal (const gamemap::location &a, size_t radius, std::set< gamemap::location > &res, std::map< gamemap::location, int > &visited) |
void | get_tiles_radius (const gamemap::location &a, size_t radius, std::set< gamemap::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< gamemap::location > const &locs, size_t radius, std::set< gamemap::location > &res, xy_pred *pred) |
Function which, given a set of locations, will find all tiles within 'radius' of those tiles. |
#define DBG_PF LOG_STREAM(debug, engine) |
#define LOG_PF LOG_STREAM(info, engine) |
typedef std::set<gamemap::location> set_location |
Definition at line 32 of file astarsearch.cpp.
typedef std::vector<a_star_node*> vector_a_star_node |
Definition at line 31 of file astarsearch.cpp.
typedef std::vector<gamemap::location> vector_location |
Definition at line 30 of file astarsearch.cpp.
static void a_star_explore_neighbours | ( | gamemap::location const & | dst, | |
const double | stop_at, | |||
cost_calculator const * | costCalculator, | |||
const size_t | parWidth, | |||
const size_t | parHeight, | |||
std::set< gamemap::location > const * | teleports, | |||
vector_location & | vectLocation, | |||
vector_a_star_node & | openList, | |||
a_star_world & | aStarGameWorld, | |||
a_star_node * | parCurNode, | |||
const size_t | parNbTeleport | |||
) | [static] |
Definition at line 77 of file astarsearch.cpp.
References compare_lt_a_star_node(), cost_calculator::cost(), g, a_star_node::g, get_adjacent_tiles(), a_star_world::getNodeFromLocation(), a_star_node::h, a_star_node::initNode(), a_star_node::isInCloseList, a_star_node::loc, a_star_node::nodeParent, and gamemap::location::valid().
Referenced by a_star_search().
static void a_star_init | ( | gamemap::location const & | src, | |
gamemap::location const & | dst, | |||
vector_a_star_node & | openList, | |||
a_star_world & | aStarGameWorld, | |||
const size_t | parWidth, | |||
const size_t | parHeight, | |||
vector_location & | vectLocation, | |||
std::set< gamemap::location > const * | teleports, | |||
size_t & | parNbTeleport | |||
) | [static] |
Definition at line 40 of file astarsearch.cpp.
References a_star_world::getNodeFromLocation(), a_star_node::h, a_star_node::initNode(), and a_star_world::resize_IFN().
Referenced by a_star_search().
paths::route a_star_search | ( | gamemap::location const & | src, | |
gamemap::location const & | dst, | |||
double | stop_at, | |||
cost_calculator const * | costCalculator, | |||
const size_t | parWidth, | |||
const size_t | parHeight, | |||
std::set< gamemap::location > const * | teleports | |||
) |
Definition at line 143 of file astarsearch.cpp.
References a_star_explore_neighbours(), a_star_init(), a_star_world::clear(), compare_lt_a_star_node(), cost_calculator::cost(), DBG_PF, a_star_node::g, cost_calculator::getNoPathValue(), a_star_node::isInCloseList, a_star_node::loc, LOG_PF, paths::route::move_left, a_star_node::nodeParent, paths::route::steps, and gamemap::location::valid().
Referenced by ai::access_points(), ai::analyze_potential_recruit_movements(), can_recruit_on(), ai::choose_move(), default_generate_map(), events::mouse_handler::get_route(), ai::move_leader_to_goals(), and cave_map_generator::place_passage().
static bool compare_lt_a_star_node | ( | const a_star_node * | node1, | |
const a_star_node * | node2 | |||
) | [static] |
Definition at line 36 of file astarsearch.cpp.
References a_star_node::g, and a_star_node::h.
Referenced by a_star_explore_neighbours(), and a_star_search().
void get_tiles_radius | ( | gamemap const & | map, | |
std::vector< gamemap::location > const & | locs, | |||
size_t | radius, | |||
std::set< gamemap::location > & | res, | |||
xy_pred * | pred | |||
) |
Function which, given a set of locations, will find all tiles within 'radius' of those tiles.
Definition at line 245 of file astarsearch.cpp.
References get_adjacent_tiles(), loc, and gamemap::on_board().
void get_tiles_radius | ( | const gamemap::location & | a, | |
size_t | radius, | |||
std::set< gamemap::location > & | res | |||
) |
Function which, given a location, will find all tiles within 'radius' of that tile.
Definition at line 238 of file astarsearch.cpp.
References get_tiles_radius_internal().
Referenced by terrain_filter::get_locations(), terrain_filter::match(), and place_village().
static void get_tiles_radius_internal | ( | const gamemap::location & | a, | |
size_t | radius, | |||
std::set< gamemap::location > & | res, | |||
std::map< gamemap::location, int > & | visited | |||
) | [static] |
Definition at line 219 of file astarsearch.cpp.
References get_adjacent_tiles().
Referenced by get_tiles_radius().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |