Various pathfinding functions and utilities. More...
#include "pathfind/pathfind.hpp"
#include "pathfind/teleport.hpp"
#include "display.hpp"
#include "game_board.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 <vector>
#include <algorithm>
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 (const team ¤t_team, const map_location &loc, const team &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, bool check_vision=false) |
Creates a list of routes that a unit can traverse from the provided location. More... | |
static bool | pathfind::step_compare (const paths::step &a, const map_location &b) |
marked_route | pathfind::mark_route (const plain_route &rt, bool update_move_cost=false) |
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") |
Various pathfinding functions and utilities.
Definition in file pathfind.cpp.
#define ERR_PF LOG_STREAM(err, log_engine) |
Definition at line 40 of file pathfind.cpp.
int h |
Definition at line 188 of file pathfind.cpp.
|
static |
int moves_left |
Definition at line 156 of file pathfind.cpp.
Referenced by pathfind::find_routes(), and unit_helper::format_movement_string().
const std::vector<findroute_node>& nodes |
Definition at line 220 of file pathfind.cpp.
Referenced by pathfind::a_star_search(), pathfind::find_routes(), and gui2::tree_view_node::replace_children().
map_location prev |
Definition at line 157 of file pathfind.cpp.
unsigned search_num |
Definition at line 161 of file pathfind.cpp.
int turns_left |
Definition at line 156 of file pathfind.cpp.
Referenced by pathfind::find_routes().
int w |
Definition at line 188 of file pathfind.cpp.
Referenced by display_chat_manager::add_chat_message(), gui2::group< T >::add_member(), gui::textbox::add_text_line(), gui2::dialogs::generator_settings::adjust_minimum_size_by_players(), display::announce(), rect::area(), array_to_surface(), t_string_base::base_str(), gui2::dialogs::gamestate_inspector::controller::bind(), display::bounds_check_position(), gui2::implementation::builder_drawing::build(), gui2::event::implementation::build_event_chain(), wb::move::calculate_new_route(), font::pango_text::calculate_size(), rect::center(), rect::contains(), wb::manager::create_temp_move(), gui2::round_rectangle_shape::draw(), gui2::image_shape::draw(), gui2::text_shape::draw(), game_display::draw_hex(), game_display::draw_movement_info(), events::menu_handler::execute_gotos(), gui2::scrollbar_container::find_at(), find_child_by_index(), find_child_by_name(), find_widget_impl(), gui2::event::implementation::fire_event(), gui2::event::fire_event(), gui2::event::fire_event_double_click(), spirit_po::catalog< hashmap_type, pf_compiler >::from_istream(), spirit_po::catalog< hashmap_type, pf_compiler >::from_iterators(), spirit_po::catalog< hashmap_type, pf_compiler >::from_range(), t_string_base::from_serialized(), gui2::listbox::get_active_sorter(), gui2::grid::get_child(), terrain_filter::get_locs_impl(), sdl::window::get_logical_size(), t_translation::get_map_size(), unit_frame::get_overlaped_hex(), gui2::rich_label::get_parsed_text(), gui2::implementation::get_status_label(), wfl::gamemap_callable::get_value(), image::pixel_callable::get_value(), gui2::gui_definition::gui_definition(), editor::editor_palette< Item >::hide(), editor::location_palette::hide(), gui2::minimap::impl_draw_background(), impl_terrainmap_iter(), impl_widget_collect(), lua_widget::impl_widget_dir(), lua_widget::impl_widget_get(), impl_widget_length(), lua_widget::impl_widget_set(), gui2::lobby_player_list_helper::init(), video::init_window(), gui2::dialogs::preferences_dialog::initialize_callbacks(), gui2::listbox::initialize_sorter(), gui2::dialogs::preferences_dialog::initialize_sound_option_group(), intf_add_dialog_item(), intf_add_item_of_type(), intf_clear_items(), intf_dialog_close(), intf_find_widget(), intf_remove_dialog_item(), intf_set_dialog_callback(), intf_set_dialog_canvas(), intf_set_dialog_focus(), intf_terrainmap_create(), gui2::event::distributor::keyboard_remove_from_chain(), ai_testing::log_victory(), luaW_pushwidget(), gui2::listbox::mark_as_unsorted(), display::minimap_location_on(), editor::context_manager::new_map_dialog(), editor::context_manager::new_scenario_dialog(), gui2::dialogs::units_dialog::on_modified(), gui2::text_box_base::on_modified(), gui2::group< T >::on_modified(), rect::operator*(), rect::operator*=(), rect::operator/(), rect::operator/=(), gui2::listbox::order_by_column(), rect::padded_by(), gui2::implementation::parse_list_data(), image::pixel_callable::pixel_callable(), gui2::grid::place(), rect::point_at(), register_widget_attribute(), terrain_builder::reload_map(), game_display::render(), editor::context_manager::resize_map_dialog(), scale_surface(), scale_surface_legacy(), scale_surface_sharp(), display::scroll_to_tiles(), gui2::listbox::set_active_sorter(), gui2::grid::set_child(), sdl::window::set_logical_size(), gui::widget::set_measurements(), gui2::group< T >::set_members_enabled(), sdl::window::set_size(), display::set_viewing_team_index(), spirit_po::catalog< hashmap_type, pf_compiler >::set_warning_channel(), font::floating_label::set_width(), gui::widget::set_width(), gui2::dialogs::team_mode_controller::show_ai_components(), gui2::dialogs::variable_mode_controller::show_array(), gui2::dialogs::unit_mode_controller::show_array(), gui2::dialogs::team_mode_controller::show_array(), gui2::dialogs::variable_mode_controller::show_var(), gui2::dialogs::unit_mode_controller::show_var(), gui2::dialogs::team_mode_controller::show_var(), gui2::event::distributor::signal_handler_notify_removal(), rect::size(), t_string_base::str(), surface::surface(), gui2::grid::swap_child(), play_controller::tab(), draw::tiled_highres(), t_string_base::to_serialized(), try_invalidate_layout(), halo::halo_impl::effect::update(), game_display::update(), video::update_framebuffer(), gui::scrollarea::update_location(), video::update_test_framebuffer(), gui::textbox::update_text_cache(), WIDGET_GETTER(), and WIDGET_SETTER().