Defines | Functions | Variables

pathfind/pathfind.cpp File Reference

Various pathfinding functions and utilities. More...

#include "global.hpp"
#include "pathfind/pathfind.hpp"
#include "pathfind/teleport.hpp"
#include "foreach.hpp"
#include "game_display.hpp"
#include "gettext.hpp"
#include "log.hpp"
#include "map.hpp"
#include "resources.hpp"
#include "team.hpp"
#include "unit.hpp"
#include "unit_map.hpp"
#include "wml_exception.hpp"
#include <iostream>
#include <vector>
#include <algorithm>
Include dependency graph for pathfind.cpp:

Go to the source code of this file.

Defines

#define ERR_PF   LOG_STREAM(err, log_engine)

Functions

static void find_routes (const gamemap &map, const unit &u, const map_location &loc, int move_left, pathfind::paths::dest_vect &destinations, std::set< map_location > *edges, const team &current_team, bool force_ignore_zocs, bool allow_teleport, int turns_left, const team &viewing_team, bool see_all, bool ignore_units, pathfind::PATH_TYPE type, const std::map< map_location, int > *jamming_map)
 Creates a list of routes that a unit can traverse from the provided location.
static
pathfind::paths::dest_vect::iterator 
lower_bound (pathfind::paths::dest_vect &v, const map_location &loc)

Variables

static lg::log_domain log_engine ("engine")
static unsigned search_counter

Detailed Description

Various pathfinding functions and utilities.

Definition in file pathfind.cpp.


Define Documentation

#define ERR_PF   LOG_STREAM(err, log_engine)

Definition at line 43 of file pathfind.cpp.


Function Documentation

static void find_routes ( const gamemap map,
const unit u,
const map_location loc,
int  move_left,
pathfind::paths::dest_vect destinations,
std::set< map_location > *  edges,
const team current_team,
bool  force_ignore_zocs,
bool  allow_teleport,
int  turns_left,
const team viewing_team,
bool  see_all,
bool  ignore_units,
pathfind::PATH_TYPE  type,
const std::map< map_location, int > *  jamming_map 
) [static]

Creates a list of routes that a unit can traverse from the provided location.

(This is called when creating pathfind::paths and descendant classes.)

Parameters:
map[in] The gamemap to use (for identifying terrain).
units[in] Currently unused.
u[in] The unit whose moves and movement type will be used.
loc[in] The location at which to begin the routes.
move_left[in] The number of movement points left for the current turn.
destinations[out] The traversable routes.
edges[out] The hexes (possibly off-map) adjacent to those in destinations. (It is permissible for this to contain some hexes that are also in destinations.)
teams[in] The teams of the game (for recognizing enemies).
force_ignore_zoc[in] Set to true to completely ignore zones of control.
allow_teleport[in] Set to true to consider teleportation abilities.
turns_left[in] The number of additional turns of movement to use, in addition to the current turn.
viewing_team[in] Usually the current team, except for "show enemy moves", etc. Relevant if allowing teleports or if not ignoring units.
see_all[in] Set to true to remove unit visibility from consideration.
ignore_units[in] Set to true if units should never obstruct paths (implies ignoring ZoC as well).
vision[in] Set if the move_costs or the vision_costs are used.

Definition at line 206 of file pathfind.cpp.

References pathfind::enemy_zoc(), gui2::event::find(), unit::get_ability_bool(), get_adjacent_tiles(), pathfind::teleport_map::get_adjacents(), pathfind::get_teleport_locations(), get_visible_unit(), gamemap::h(), team::is_enemy(), pathfind::JAMMING, pathfind::MOVE, unit::movement_cost(), next, nodes, map_location::null_location, search_counter, unit::side(), schema_validation::valid, pathfind::VISION, unit::vision_cost(), gamemap::w(), map_location::x, and map_location::y.

Referenced by pathfind::jamming_path::jamming_path(), pathfind::paths::paths(), and pathfind::vision_path::vision_path().

Here is the call graph for this function:

Here is the caller graph for this function:

static pathfind::paths::dest_vect::iterator lower_bound ( pathfind::paths::dest_vect v,
const map_location loc 
) [static]

Definition at line 351 of file pathfind.cpp.

References pos.

Referenced by pathfind::paths::dest_vect::find(), pathfind::paths::dest_vect::insert(), and metrics::record_sample().

Here is the caller graph for this function:


Variable Documentation

lg::log_domain log_engine("engine") [static]
unsigned search_counter [static]

Definition at line 123 of file pathfind.cpp.

Referenced by pathfind::a_star_search(), and find_routes().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

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