#include "global.hpp"
#include "pathutils.hpp"
#include "util.hpp"
Go to the source code of this file.
Functions | |
size_t | distance_between (const gamemap::location &a, const gamemap::location &b) |
Function which gives the number of hexes between two tiles (i.e. | |
void | get_adjacent_tiles (const gamemap::location &a, gamemap::location *res) |
Function which, given a location, will place all adjacent locations in res. | |
void | get_tile_ring (const gamemap::location &a, const int r, std::vector< gamemap::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 gamemap::location &a, const int r, std::vector< gamemap::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. | |
bool | tiles_adjacent (const gamemap::location &a, const gamemap::location &b) |
Function which tells if two locations are adjacent. |
Definition in file pathutils.cpp.
size_t distance_between | ( | const gamemap::location & | a, | |
const gamemap::location & | b | |||
) |
Function which gives the number of hexes between two tiles (i.e.
the minimum number of hexes that have to be traversed to get from one hex to the other).
Definition at line 23 of file pathutils.cpp.
References is_even(), is_odd(), gamemap::location::x, and gamemap::location::y.
Referenced by ai::access_points(), ai::attack_close(), soundsource::positional_source::calculate_volume(), ai::choose_move(), ai::do_move(), sample_ai::do_moves(), ai::do_recruitment(), ai::find_threats(), gamemap::get_weighted_terrain_frequencies(), a_star_node::heuristic(), map_editor::insert_selection_in_clipboard(), ai::move_leader_after_recruit(), ai::move_leader_to_keep(), dfool::dfool_ai::moveto(), ai::nearest_keep(), rank_castle_location(), events::mouse_handler::show_attack_options(), and dfool::distance_evaluator::value().
void get_adjacent_tiles | ( | const gamemap::location & | a, | |
gamemap::location * | res | |||
) |
Function which, given a location, will place all adjacent locations in res.
res must point to an array of 6 location objects.
Definition at line 39 of file pathutils.cpp.
References is_even(), is_odd(), gamemap::location::x, and gamemap::location::y.
Referenced by a_star_explore_neighbours(), unit::ability_active(), ai::attack_analysis::analyze(), ai::analyze_targets(), backstab_check(), cave_map_generator::build_chamber(), clear_shroud_loc(), events::mouse_handler::current_unit_attacks_from(), default_generate_map(), ai::desperate_attack(), ai::do_attack_analysis(), sample_ai::do_attacks(), ai::enemies_along_path(), enemy_zoc(), find_routes(), ai::find_targets(), find_vacant(), generate_river_internal(), unit::get_abilities(), unit::get_ability_bool(), display::get_fog_shroud_graphics(), formula_ai::get_keeps(), gamemap::get_terrain(), get_tiles_radius(), get_tiles_radius_internal(), location_callable::get_value(), unit::internal_matches_filter(), game_display::invalidate(), ai::is_accessible(), ai::keeps(), terrain_filter::match_internal(), ai::move_group(), ai::move_leader_after_recruit(), ai::move_to_targets(), ai::move_unit(), move_unit(), move_unit_between(), ai_interface::move_unit_partial(), unit::overlaps(), cave_map_generator::place_castle(), place_village(), ai::power_projection(), ai::retreat_units(), unit::set_standing(), gamemap::set_terrain(), attack_type::special_active(), timeofday_at(), and unit_can_move().
void get_tile_ring | ( | const gamemap::location & | a, | |
const int | r, | |||
std::vector< gamemap::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 60 of file pathutils.cpp.
References gamemap::location::get_direction(), loc, and gamemap::location::SOUTH_WEST.
Referenced by get_tiles_in_radius().
void get_tiles_in_radius | ( | const gamemap::location & | a, | |
const int | r, | |||
std::vector< gamemap::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 77 of file pathutils.cpp.
References get_tile_ring().
bool tiles_adjacent | ( | const gamemap::location & | a, | |
const gamemap::location & | b | |||
) |
Function which tells if two locations are adjacent.
Definition at line 84 of file pathutils.cpp.
References is_even(), gamemap::location::x, and gamemap::location::y.
Referenced by game_display::footsteps_images(), unit::invisible(), unit_display::move_unit(), and move_unit().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |