The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Namespaces | Macros | Functions | Variables
pathfind.cpp File Reference

Various pathfinding functions and utilities. More...

#include "global.hpp"
#include "pathfind/pathfind.hpp"
#include "pathfind/teleport.hpp"
#include "game_board.hpp"
#include "game_display.hpp"
#include "gettext.hpp"
#include "log.hpp"
#include "map/map.hpp"
#include "resources.hpp"
#include "team.hpp"
#include "units/unit.hpp"
#include "units/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.

Namespaces

 pathfind
 

Macros

#define ERR_PF   LOG_STREAM(err, log_engine)
 

Functions

map_location pathfind::find_vacant_tile (const map_location &loc, VACANT_TILE_TYPE vacancy, const unit *pass_check, const team *shroud_check, const game_board *board)
 Function that will find a location on the board that is as near to loc as possible, but which is unoccupied by any units. More...
 
map_location pathfind::find_vacant_castle (const unit &leader)
 Wrapper for find_vacant_tile() when looking for a vacant castle tile near a leader. More...
 
bool pathfind::enemy_zoc (team const &current_team, map_location const &loc, team const &viewing_team, bool see_all)
 Determines if a given location is in an enemy zone of control. More...
 
static void pathfind::find_routes (const map_location &origin, const movetype::terrain_costs &costs, bool slowed, int moves_left, int max_moves, int turns_left, paths::dest_vect &destinations, std::set< map_location > *edges, const unit *teleporter, const team *current_team, const unit *skirmisher, const team *viewing_team, const std::map< map_location, int > *jamming_map=nullptr, std::vector< std::pair< int, int > > *full_cost_map=nullptr)
 Creates a list of routes that a unit can traverse from the provided location. More...
 
static paths::dest_vect::iterator pathfind::lower_bound (paths::dest_vect &v, const map_location &loc)
 
marked_route pathfind::mark_route (const plain_route &rt)
 Add marks on a route rt assuming that the unit located at the first hex of rt travels along it. More...
 

Variables

static lg::log_domain log_engine ("engine")
 

Detailed Description

Various pathfinding functions and utilities.

Definition in file pathfind.cpp.

Macro Definition Documentation

#define ERR_PF   LOG_STREAM(err, log_engine)

Definition at line 42 of file pathfind.cpp.

Variable Documentation

int h

Definition at line 195 of file pathfind.cpp.

lg::log_domain log_engine("engine")
static
int moves_left

Definition at line 163 of file pathfind.cpp.

const std::vector<findroute_node>& nodes

Definition at line 219 of file pathfind.cpp.

Referenced by pathfind::find_routes().

Definition at line 164 of file pathfind.cpp.

unsigned search_num

Definition at line 168 of file pathfind.cpp.

int turns_left

Definition at line 163 of file pathfind.cpp.

Referenced by campaign_controller::show_carryover_message().

int w

Definition at line 195 of file pathfind.cpp.