#include <map.hpp>
Public Types | |
enum | DIRECTION { NORTH, NORTH_EAST, SOUTH_EAST, SOUTH, SOUTH_WEST, NORTH_WEST, NDIRECTIONS } |
Valid directions which can be moved in our hexagonal world. More... | |
Public Member Functions | |
location () | |
location (int x, int y) | |
location (const config &cfg, const variable_set *variables) | |
void | write (config &cfg) const |
bool | valid () const |
bool | valid (const int parWidth, const int parHeight) const |
bool | matches_range (const std::string &xloc, const std::string &yloc) const |
bool | operator< (const location &a) const |
bool | operator== (const location &a) const |
bool | operator!= (const location &a) const |
location | operator- () const |
location | operator+ (const location &a) const |
location & | operator+= (const location &a) |
location | operator- (const location &a) const |
location & | operator-= (const location &a) |
location | get_direction (DIRECTION d, int n=1) const |
DIRECTION | get_relative_dir (location loc) const |
Static Public Member Functions | |
static DIRECTION | parse_direction (const std::string &str) |
static std::vector< DIRECTION > | parse_directions (const std::string &str) |
Parse_directions takes a comma-separated list, and filters out any invalid directions. | |
static std::string | write_direction (DIRECTION dir) |
static DIRECTION | get_opposite_dir (DIRECTION d) |
Public Attributes | |
int | x |
int | y |
Static Public Attributes | |
static const location | null_location |
Definition at line 62 of file map.hpp.
gamemap::location::location | ( | ) | [inline] |
Definition at line 73 of file map.hpp.
Referenced by display::create_buttons(), and get_relative_dir().
gamemap::location::location | ( | const config & | cfg, | |
const variable_set * | variables | |||
) |
Definition at line 158 of file map.cpp.
References utils::interpolate_variables_into_string(), x, and y.
gamemap::location::DIRECTION gamemap::location::parse_direction | ( | const std::string & | str | ) | [static] |
Definition at line 98 of file map.cpp.
References get_opposite_dir(), NDIRECTIONS, NORTH, NORTH_EAST, NORTH_WEST, SOUTH, SOUTH_EAST, and SOUTH_WEST.
Referenced by unit::ability_active(), parse_directions(), unit::read(), attack_type::special_active(), and unit_animation::unit_animation().
std::vector< gamemap::location::DIRECTION > gamemap::location::parse_directions | ( | const std::string & | str | ) | [static] |
Parse_directions takes a comma-separated list, and filters out any invalid directions.
Definition at line 121 of file map.cpp.
References NDIRECTIONS, parse_direction(), and utils::split().
Referenced by unit::internal_matches_filter(), and terrain_filter::match_internal().
std::string gamemap::location::write_direction | ( | DIRECTION | dir | ) | [static] |
Definition at line 137 of file map.cpp.
References NORTH, NORTH_EAST, NORTH_WEST, SOUTH, SOUTH_EAST, and SOUTH_WEST.
Referenced by game_display::attack_indicator_direction(), and unit::write().
void gamemap::location::write | ( | config & | cfg | ) | const |
Definition at line 177 of file map.cpp.
Referenced by replay::add_advancement(), replay::add_event(), replay::add_pos(), replay::add_recall(), replay::add_recruit(), replay::add_rename(), replay::add_unit_checksum(), and terrain_label::write().
bool gamemap::location::valid | ( | ) | const [inline] |
Definition at line 79 of file map.hpp.
Referenced by a_star_explore_neighbours(), a_star_search(), replay::add_event(), ai::choose_move(), events::mouse_handler::current_unit_attacks_from(), events::menu_handler::do_search(), map_editor::edit_rotate_selection(), play_controller::execute_command(), play_controller::expand_wml_commands(), get_player_info(), a_star_world::getNodeFromLocation(), unit::has_goto(), unit::internal_matches_filter(), ai::leader_can_reach_keep(), map_editor::left_button_down(), events::mouse_handler::left_click(), unit::matches_filter(), map_editor::middle_button_down(), events::mouse_handler::mouse_motion(), events::mouse_handler::mouse_press(), ai::move_group(), ai::move_leader_after_recruit(), ai::move_leader_to_goals(), gamemap::on_board(), terrain_builder::parse_config(), ai::power_projection(), map_editor::recalculate_starting_pos_labels(), unit::redraw_unit(), ai::retreat_units(), terrain_builder::rule_matches(), events::menu_handler::search(), events::mouse_handler::select_hex(), game_display::select_hex(), timeofday_at(), unit_display::unit_attack(), and battle_context::unit_stats::unit_stats().
bool gamemap::location::valid | ( | const int | parWidth, | |
const int | parHeight | |||
) | const [inline] |
bool gamemap::location::matches_range | ( | const std::string & | xloc, | |
const std::string & | yloc | |||
) | const |
Definition at line 670 of file map.cpp.
References boost::foreach_detail_::end(), size, utils::split(), x, and y.
Referenced by unit::internal_matches_filter(), and terrain_filter::match_internal().
bool gamemap::location::operator< | ( | const location & | a | ) | const [inline] |
bool gamemap::location::operator== | ( | const location & | a | ) | const [inline] |
bool gamemap::location::operator!= | ( | const location & | a | ) | const [inline] |
gamemap::location gamemap::location::operator- | ( | ) | const |
gamemap::location gamemap::location::operator+ | ( | const location & | a | ) | const |
gamemap::location & gamemap::location::operator+= | ( | const location & | a | ) |
gamemap::location gamemap::location::operator- | ( | const location & | a | ) | const |
gamemap::location & gamemap::location::operator-= | ( | const location & | a | ) |
gamemap::location gamemap::location::get_direction | ( | DIRECTION | d, | |
int | n = 1 | |||
) | const |
Definition at line 227 of file map.cpp.
References get_opposite_dir(), is_even(), is_odd(), NORTH, NORTH_EAST, NORTH_WEST, SOUTH, SOUTH_EAST, SOUTH_WEST, x, and y.
Referenced by map_editor::edit_rotate_selection(), get_tile_ring(), map_editor::get_tiles(), unit_animation::matches(), unit::overlaps(), unit::redraw_unit(), unit::start_animation(), and unit_display::unit_die().
gamemap::location::DIRECTION gamemap::location::get_relative_dir | ( | gamemap::location | loc | ) | const |
Definition at line 247 of file map.cpp.
References location(), NDIRECTIONS, NORTH, NORTH_EAST, NORTH_WEST, SOUTH, SOUTH_EAST, SOUTH_WEST, x, and y.
Referenced by game_display::attack_indicator_direction(), events::mouse_handler::current_unit_attacks_from(), unit_frame::invalidate(), move_unit_between(), unit_frame::redraw(), and unit_display::unit_attack().
gamemap::location::DIRECTION gamemap::location::get_opposite_dir | ( | DIRECTION | d | ) | [static] |
Definition at line 264 of file map.cpp.
References NDIRECTIONS, NORTH, NORTH_EAST, NORTH_WEST, SOUTH, SOUTH_EAST, and SOUTH_WEST.
Referenced by get_direction(), unit::overlaps(), and parse_direction().
Definition at line 86 of file map.hpp.
Referenced by terrain_builder::add_constraints(), check_checksums(), team::clear_fog(), team::clear_shroud(), clear_shroud_loc(), passage_path_calculator::cost(), default_generate_map(), distance_between(), location_callable::do_compare(), events::menu_handler::do_search(), terrain_label::draw(), display::draw_border(), display::draw_init(), map_editor::edit_rotate_selection(), formula_ai::execute_variant(), play_controller::expand_wml_commands(), team::fogged(), generate_river_internal(), get_adjacent_tiles(), get_direction(), gamemap::get_drawing_order(), gui::menu::get_item_rect_internal(), display::get_location_x(), display::get_location_y(), get_player_info(), display::get_rect_hex_bounds(), get_relative_dir(), gamemap::get_terrain(), terrain_callable::get_value(), unit_callable::get_value(), location_callable::get_value(), a_star_world::getNodeFromLocation(), game_display::invalidate_animations(), display::invalidate_locations_in_rect(), display::invalidate_rectangle(), is_shrouded(), image::locator::load_image_sub_file(), location(), unit::matches_filter(), matches_range(), display::minimap_location_on(), ai::move_group(), unit::move_interrupted(), ai::move_leader_after_recruit(), dfool::dfool_ai::moveto(), gamemap::on_board(), cave_map_generator::on_board(), terrain_builder::tilemap::on_map(), display::ordered_draw::operator()(), operator+=(), operator-(), operator<(), operator<<(), operator==(), gamemap::operator[](), terrain_builder::tilemap::operator[](), terrain_builder::parse_config(), cave_map_generator::place_castle(), team::place_shroud(), place_village(), placing_score(), help::help_menu::process(), game_display::process_reachmap_changes(), unit::read(), editormap::resize(), terrain_builder::rotate(), terrain_builder::rule_matches(), location_callable::serialize_to_string(), gamemap::set_terrain(), cave_map_generator::set_terrain(), team::shrouded(), tiles_adjacent(), valid(), dfool::distance_evaluator::value(), unit::write(), gamemap::write(), and write().
Definition at line 86 of file map.hpp.
Referenced by terrain_builder::add_constraints(), check_checksums(), team::clear_fog(), team::clear_shroud(), clear_shroud_loc(), passage_path_calculator::cost(), default_generate_map(), distance_between(), location_callable::do_compare(), events::menu_handler::do_search(), terrain_label::draw(), display::draw_border(), display::draw_init(), map_editor::edit_rotate_selection(), formula_ai::execute_variant(), play_controller::expand_wml_commands(), team::fogged(), generate_river_internal(), get_adjacent_tiles(), get_direction(), gamemap::get_drawing_order(), gui::menu::get_item_rect_internal(), display::get_location_y(), get_player_info(), display::get_rect_hex_bounds(), get_relative_dir(), gamemap::get_terrain(), terrain_callable::get_value(), unit_callable::get_value(), location_callable::get_value(), a_star_world::getNodeFromLocation(), game_display::invalidate_animations(), display::invalidate_locations_in_rect(), display::invalidate_rectangle(), is_shrouded(), image::locator::load_image_sub_file(), location(), unit::matches_filter(), matches_range(), display::minimap_location_on(), ai::move_group(), unit::move_interrupted(), ai::move_leader_after_recruit(), dfool::dfool_ai::moveto(), gamemap::on_board(), cave_map_generator::on_board(), terrain_builder::tilemap::on_map(), display::ordered_draw::operator()(), operator+=(), operator-(), operator<(), operator<<(), operator==(), gamemap::operator[](), terrain_builder::tilemap::operator[](), terrain_builder::parse_config(), cave_map_generator::place_castle(), team::place_shroud(), place_village(), placing_score(), game_display::process_reachmap_changes(), unit::read(), editormap::resize(), terrain_builder::rotate(), terrain_builder::rule_matches(), location_callable::serialize_to_string(), gamemap::set_terrain(), cave_map_generator::set_terrain(), team::shrouded(), tiles_adjacent(), valid(), dfool::distance_evaluator::value(), unit::write(), gamemap::write(), and write().
const gamemap::location gamemap::location::null_location [static] |
Definition at line 106 of file map.hpp.
Referenced by game_display::clear_attack_indicator(), ai::get_villages(), unit_ability_list::highest(), play_controller::init_side(), unit_ability_list::lowest(), remove_unit(), unit_animation::particule::start_animation(), under_leadership(), and unit_display::unit_attack().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |