Encapsulates the map of the game. More...
#include <map.hpp>
Classes | |
struct | overlay_rule |
Public Types | |
enum | { MAX_PLAYERS = 9 } |
Maximum number of players supported. More... | |
using | starting_positions = t_translation::starting_positions |
Public Member Functions | |
const t_translation::ter_list & | underlying_mvt_terrain (const map_location &loc) const |
const t_translation::ter_list & | underlying_def_terrain (const map_location &loc) const |
const t_translation::ter_list & | underlying_union_terrain (const map_location &loc) const |
std::string | get_terrain_string (const map_location &loc) const |
std::string | get_terrain_editor_string (const map_location &loc) const |
bool | is_village (const map_location &loc) const |
int | gives_healing (const map_location &loc) const |
bool | is_castle (const map_location &loc) const |
bool | is_keep (const map_location &loc) const |
const t_translation::ter_list & | underlying_mvt_terrain (const t_translation::terrain_code &terrain) const |
const t_translation::ter_list & | underlying_def_terrain (const t_translation::terrain_code &terrain) const |
const t_translation::ter_list & | underlying_union_terrain (const t_translation::terrain_code &terrain) const |
std::string | get_terrain_string (const t_translation::terrain_code &terrain) const |
std::string | get_terrain_editor_string (const t_translation::terrain_code &terrain) const |
std::string | get_underlying_terrain_string (const t_translation::terrain_code &terrain) const |
bool | is_village (const t_translation::terrain_code &terrain) const |
int | gives_healing (const t_translation::terrain_code &terrain) const |
bool | is_castle (const t_translation::terrain_code &terrain) const |
bool | is_keep (const t_translation::terrain_code &terrain) const |
const terrain_type & | get_terrain_info (const t_translation::terrain_code &terrain) const |
const std::shared_ptr< terrain_type_data > & | tdata () const |
gamemap (const std::string &data) | |
Loads a map. More... | |
virtual | ~gamemap () |
void | read (const std::string &data, const bool allow_invalid=true) |
std::string | write () const |
void | overlay (const gamemap &m, map_location loc, const std::vector< overlay_rule > &rules=std::vector< overlay_rule >(), bool is_odd=false, bool ignore_special_locations=false) |
Overlays another map onto this one at the given position. More... | |
int | w () const |
Effective map width, in hexes. More... | |
int | h () const |
Effective map height, in hexes. More... | |
int | border_size () const |
Size of the map border. More... | |
int | total_width () const |
Real width of the map, including borders. More... | |
int | total_height () const |
Real height of the map, including borders. More... | |
const t_translation::terrain_code | operator[] (const map_location &loc) const |
t_translation::terrain_code | get_terrain (const map_location &loc) const |
Looks up terrain at a particular location. More... | |
void | write_terrain (const map_location &loc, config &cfg) const |
Writes the terrain at loc to cfg. More... | |
void | set_starting_position (int side, const map_location &loc) |
Manipulate starting positions of the different sides. More... | |
map_location | starting_position (int side) const |
void | set_special_location (const std::string &id, const map_location &loc) |
map_location | special_location (const std::string &id) const |
const std::string * | is_starting_position (const map_location &loc) const |
returns the side number of the side starting at position loc, 0 if no such side exists. More... | |
int | num_valid_starting_positions () const |
bool | on_board (const map_location &loc) const |
Tell if a location is on the map. More... | |
bool | on_board_with_border (const map_location &loc) const |
bool | empty () const |
Tell if the map is of 0 size. More... | |
const std::vector< map_location > & | villages () const |
Return a list of the locations of villages on the map. More... | |
const terrain_type & | get_terrain_info (const map_location &loc) const |
Shortcut to get_terrain_info(get_terrain(loc)). More... | |
const t_translation::ter_list & | get_terrain_list () const |
Gets the list of terrains. More... | |
void | set_terrain (const map_location &loc, const t_translation::terrain_code &terrain, const terrain_type_data::merge_mode mode=terrain_type_data::BOTH, bool replace_if_failed=false) |
Clobbers over the terrain at location 'loc', with the given terrain. More... | |
std::vector< map_location > | parse_location_range (const std::string &xvals, const std::string &yvals, bool with_border=false) const |
Parses ranges of locations into a vector of locations, using this map's dimensions as bounds. More... | |
const starting_positions & | special_locations () const |
template<typename F > | |
void | for_each_loc (const F &f) const |
template<typename F > | |
void | for_each_walkable_loc (const F &f) const |
Static Public Member Functions | |
static void | overlay_impl (const t_translation::ter_map &m1, t_translation::starting_positions &m1_st, const t_translation::ter_map &m2, const t_translation::starting_positions &m2_st, std::function< void(const map_location &, const t_translation::terrain_code &, terrain_type_data::merge_mode, bool)> set_terrain, map_location loc, const std::vector< overlay_rule > &rules, bool is_odd, bool ignore_special_locations) |
Static Public Attributes | |
static const int | default_border = 1 |
The default border style for a map. More... | |
Protected Attributes | |
t_translation::ter_map | tiles_ |
starting_positions | starting_positions_ |
std::vector< map_location > | villages_ |
int | w_ |
Sizes of the map area. More... | |
int | h_ |
Private Member Functions | |
t_translation::terrain_code & | operator[] (const map_location &loc) |
int | read_header (const std::string &data) |
Reads the header of a map which is saved in the deprecated map_data format. More... | |
Private Attributes | |
std::shared_ptr< terrain_type_data > | tdata_ |
Encapsulates the map of the game.
Although the game is hexagonal, the map is stored as a grid. Each type of terrain is represented by a multiletter terrain code.
anonymous enum |
gamemap::gamemap | ( | const std::string & | data | ) |
Loads a map.
Data should be a series of lines, with each character representing one hex on the map. Starting locations are represented by numbers.
data | the map data to load. |
Definition at line 104 of file map.cpp.
References DBG_G, game_config_manager::get(), read(), tdata_, and game_config_view::wrap().
Referenced by tdata().
|
inline |
Size of the map border.
Definition at line 127 of file map.hpp.
References default_border.
Referenced by for_each_loc(), get_tiles_radius(), game_lua_kernel::intf_get_map_size(), editor::editor_map::mask_to(), on_board_with_border(), operator[](), parse_location_range(), read(), editor::editor_map::sanity_check(), and write().
|
inline |
Tell if the map is of 0 size.
Definition at line 182 of file map.hpp.
Referenced by team_builder::init().
|
inline |
Definition at line 221 of file map.hpp.
References border_size(), f, h(), and w().
Referenced by preferences::encounter_map_terrain(), and editor::editor_map::resize().
|
inline |
t_translation::terrain_code gamemap::get_terrain | ( | const map_location & | loc | ) | const |
Looks up terrain at a particular location.
Hexes off the map may be looked up, and their 'emulated' terrain will also be returned. This allows proper drawing of the edges of the map.
Definition at line 314 of file map.cpp.
References t_translation::NONE_TERRAIN, map_location::null_location(), and on_board_with_border().
Referenced by terrain_builder::build_terrains(), ai::ai_default_rca::move_to_targets_phase::choose_move(), editor::mouse_action_paint::click_left(), editor::mouse_action_fill::click_left(), editor::mouse_action_paint::click_right(), editor::mouse_action_fill::click_right(), wfl::gamestate::DEFINE_WFL_FUNCTION(), editor::map_context::draw_terrain_actual(), preferences::encounter_map_terrain(), ai::ai_default_rca::get_villages_phase::find_villages(), footsteps_images(), editor::editor_map::get_contiguous_terrain_tiles(), get_terrain_editor_string(), get_terrain_info(), get_terrain_string(), gives_healing(), unit_animation_component::invalidate(), is_castle(), is_keep(), is_village(), editor::editor_map::mask_to(), unit_animation::matches(), ai::ai_default_rca::move_to_targets_phase::move_group(), operator[](), editor::editor_action_shuffle_area::perform_without_undo(), ai::ai_default_rca::move_to_targets_phase::rate_group(), ai::ai_default_rca::aspect_attacks_base::rate_terrain(), ai::default_ai_context_impl::rate_terrain(), unit_drawer::redraw_unit(), REPORT_GENERATOR(), set_terrain(), underlying_def_terrain(), underlying_mvt_terrain(), underlying_union_terrain(), unit_box_at(), and write_terrain().
std::string gamemap::get_terrain_editor_string | ( | const map_location & | loc | ) | const |
Definition at line 61 of file map.cpp.
References get_terrain().
Referenced by editor::terrain_palette::draw_item(), editor::editor_display::draw_sidebar(), and editor::terrain_palette::get_help_string().
std::string gamemap::get_terrain_editor_string | ( | const t_translation::terrain_code & | terrain | ) | const |
const terrain_type & gamemap::get_terrain_info | ( | const t_translation::terrain_code & | terrain | ) | const |
Definition at line 96 of file map.cpp.
References tdata_.
Referenced by editor::terrain_palette::draw_item(), editor::map_context::draw_terrain(), editor::terrain_palette::get_id(), tod_manager::get_illuminated_time_of_day(), unit_animation_component::invalidate(), terrain_builder::rebuild_terrain(), unit_drawer::redraw_unit(), REPORT_GENERATOR(), editor::mouse_action::set_terrain_mouse_overlay(), editor::terrain_palette::setup(), events::menu_handler::terrain_description(), editor::editor_controller::terrain_description(), unit_box_at(), unit_defense(), unit_moves(), and villages().
const terrain_type & gamemap::get_terrain_info | ( | const map_location & | loc | ) | const |
Shortcut to get_terrain_info(get_terrain(loc)).
Definition at line 48 of file map.cpp.
References get_terrain(), and tdata_.
const t_translation::ter_list & gamemap::get_terrain_list | ( | ) | const |
Gets the list of terrains.
Definition at line 42 of file map.cpp.
References tdata_.
Referenced by editor::terrain_palette::setup(), and villages().
std::string gamemap::get_terrain_string | ( | const map_location & | loc | ) | const |
std::string gamemap::get_terrain_string | ( | const t_translation::terrain_code & | terrain | ) | const |
std::string gamemap::get_underlying_terrain_string | ( | const t_translation::terrain_code & | terrain | ) | const |
int gamemap::gives_healing | ( | const map_location & | loc | ) | const |
Definition at line 66 of file map.cpp.
References get_terrain(), and on_board().
Referenced by ai::attack_analysis::analyze(), ai::ai_default_rca::aspect_attacks_base::rate_terrain(), and ai::default_ai_context_impl::rate_terrain().
int gamemap::gives_healing | ( | const t_translation::terrain_code & | terrain | ) | const |
|
inline |
Effective map height, in hexes.
Definition at line 124 of file map.hpp.
References h_.
Referenced by ai::ai_default_rca::move_to_targets_phase::access_points(), display::bounds_check_position(), terrain_builder::build_terrains(), game_state::can_recruit_on(), ai::ai_default_rca::move_to_targets_phase::choose_move(), actions::shroud_clearer::clear_loc(), events::menu_handler::do_search(), display::draw_minimap(), display::draw_minimap_units(), ai::ai_default_rca::goto_phase::evaluate(), ai::ai_default_rca::move_leader_to_goals_phase::evaluate(), ai::ai_default_rca::move_leader_to_keep_phase::evaluate(), actions::find_recruit_location(), pathfind::find_routes(), ai::default_ai_context_impl::find_targets(), for_each_loc(), for_each_walkable_loc(), pathfind::full_cost_map::full_cost_map(), mp::game_info::game_info(), ai::keeps_cache::get(), pathfind::full_cost_map::get_pair_at(), events::mouse_handler::get_route(), get_tiles_radius(), image::getMinimap(), game_lua_kernel::intf_find_path(), game_lua_kernel::intf_get_map_size(), editor::editor_map::invert_selection(), editor::editor_map::mask_to(), display::max_map_area(), display::minimap_location_on(), editor::context_manager::new_map_dialog(), editor::context_manager::new_scenario_dialog(), parse_location_range(), terrain_builder::rebuild_cache_all(), editor::editor_map::resize(), editor::context_manager::resize_map_dialog(), editor::editor_map::same_size_as(), editor::editor_map::sanity_check(), editor::map_context::set_map(), ai::move_result::test_route(), and ai::default_recruitment::recruitment::update_average_local_cost().
bool gamemap::is_castle | ( | const map_location & | loc | ) | const |
Definition at line 68 of file map.cpp.
References get_terrain(), and on_board().
Referenced by game_state::can_recruit_on(), pathfind::find_vacant_tile(), ai::keeps_cache::get(), actions::get_recalls(), actions::get_recruits(), and play_controller::hotkey_handler::in_context_menu().
bool gamemap::is_castle | ( | const t_translation::terrain_code & | terrain | ) | const |
bool gamemap::is_keep | ( | const map_location & | loc | ) | const |
Definition at line 70 of file map.cpp.
References get_terrain(), and on_board().
Referenced by game_state::can_recruit_from(), game_state::can_recruit_on(), ai::keeps_cache::get(), actions::get_recalls(), actions::get_recruits(), play_controller::hotkey_handler::in_context_menu(), and events::mouse_handler::move_unit_along_route().
bool gamemap::is_keep | ( | const t_translation::terrain_code & | terrain | ) | const |
const std::string * gamemap::is_starting_position | ( | const map_location & | loc | ) | const |
returns the side number of the side starting at position loc, 0 if no such side exists.
Definition at line 354 of file map.cpp.
References starting_positions_.
Referenced by editor::mouse_action::key_event(), operator[](), editor::editor_action_starting_position::perform_without_undo(), editor::mouse_action_starting_position::up_left(), and editor::mouse_action_starting_position::up_right().
bool gamemap::is_village | ( | const map_location & | loc | ) | const |
Definition at line 64 of file map.cpp.
References get_terrain(), and on_board().
Referenced by ai::attack_analysis::analyze(), battle_context_unit_stats::battle_context_unit_stats(), team::build(), events::menu_handler::change_side(), ai::ai_default_rca::retreat_phase::evaluate(), ai::ai_default_rca::get_villages_phase::find_villages(), team::fix_villages(), pathfind::mark_route(), unit_creator::post_create(), ai::readonly_context_impl::power_projection(), ai::ai_default_rca::aspect_attacks_base::rate_terrain(), ai::default_ai_context_impl::rate_terrain(), game_board::replace_map(), REPORT_GENERATOR(), editor::editor_map::resize(), set_terrain(), attack_type::special_active_impl(), editor::mouse_action_village::up_left(), and editor::mouse_action_village::up_right().
bool gamemap::is_village | ( | const t_translation::terrain_code & | terrain | ) | const |
int gamemap::num_valid_starting_positions | ( | ) | const |
Definition at line 341 of file map.cpp.
References c, and starting_positions_.
Referenced by operator[](), and game_state::place_sides_in_preferred_locations().
bool gamemap::on_board | ( | const map_location & | loc | ) | const |
Tell if a location is on the map.
Should be called before indexing using [].
Definition at line 382 of file map.cpp.
References h_, map_location::valid(), w_, map_location::x, and map_location::y.
Referenced by playsingle_controller::hotkey_handler::can_execute_command(), ai::ai_default_rca::move_to_targets_phase::choose_move(), actions::shroud_clearer::clear_loc(), editor::mouse_action_item::click_left(), editor::mouse_action_unit::click_left(), pathfind::shortest_path_calculator::cost(), pathfind::move_type_path_calculator::cost(), pathfind::emergency_path_calculator::cost(), events::mouse_handler::current_unit_attacks_from(), ai::ai_default_rca::aspect_attacks_base::do_attack_analysis(), editor::mouse_action_map_label::drag_end_left(), editor::mouse_action_item::drag_end_left(), editor::mouse_action_unit::drag_end_left(), game_display::draw_hex(), display::draw_hex(), ai::ai_default_rca::goto_phase::evaluate(), ai::ai_default_rca::move_to_targets_phase::execute(), events::menu_handler::execute_gotos(), unit_creator::find_location(), ai::default_ai_context_impl::find_targets(), pathfind::find_vacant_tile(), unit_filter::first_match_on_map(), pathfind::full_cost_map::get_pair_at(), get_tiles_radius(), gives_healing(), is_castle(), is_keep(), is_village(), editor::mouse_action::key_event(), events::menu_handler::label_terrain(), events::mouse_handler::mouse_motion(), ai::ai_default_rca::move_to_targets_phase::move_group(), ai::ai_default_rca::remove_wrong_targets::operator()(), operator[](), placing_score(), ai::readonly_context_impl::power_projection(), game_board::replace_map(), REPORT_GENERATOR(), events::mouse_handler::select_or_action(), set_terrain(), events::mouse_handler::show_attack_options(), events::menu_handler::terrain_description(), events::mouse_handler::touch_motion(), display_context::unit_can_move(), unit_defense(), unit_status(), editor::mouse_action_village::up_left(), editor::mouse_action_map_label::up_left(), editor::mouse_action_unit::up_left(), editor::mouse_action_item::up_left(), editor::mouse_action_starting_position::up_left(), editor::mouse_action_village::up_right(), and ai::default_recruitment::recruitment::update_important_hexes().
bool gamemap::on_board_with_border | ( | const map_location & | loc | ) | const |
Definition at line 387 of file map.cpp.
References border_size(), t_translation::ter_map::data, h_, tiles_, w_, map_location::x, and map_location::y.
Referenced by editor::editor_map::add_to_selection(), editor::editor_controller::allow_mouse_wheel_scroll(), actions::shroud_clearer::clear_loc(), events::console_handler::do_layers(), editor::map_context::draw_terrain_actual(), editor::editor_map::get_contiguous_terrain_tiles(), tod_manager::get_illuminated_time_of_day(), get_terrain(), get_tiles_radius(), image::getMinimap(), operator[](), editor::editor_map::sanity_check(), and set_terrain().
|
inline |
Definition at line 135 of file map.hpp.
References border_size(), t_translation::ter_map::get(), tiles_, map_location::x, and map_location::y.
|
inlineprivate |
Definition at line 141 of file map.hpp.
References border_size(), t_translation::ter_map::get(), get_terrain(), is_starting_position(), num_valid_starting_positions(), on_board(), on_board_with_border(), set_special_location(), set_starting_position(), special_location(), starting_position(), tiles_, write_terrain(), map_location::x, and map_location::y.
void gamemap::overlay | ( | const gamemap & | m, |
map_location | loc, | ||
const std::vector< overlay_rule > & | rules = std::vector<overlay_rule>() , |
||
bool | is_odd = false , |
||
bool | ignore_special_locations = false |
||
) |
Overlays another map onto this one at the given position.
Definition at line 215 of file map.cpp.
References overlay_impl(), starting_positions_, and tiles_.
Referenced by gamemap::overlay_rule::overlay_rule().
|
static |
Definition at line 221 of file map.cpp.
References terrain_type_data::BOTH, t_translation::FOGGED, t_translation::ter_map::get(), t_translation::ter_map::h, gamemap::overlay_rule::mode_, gamemap::overlay_rule::replace_if_failed_, set_terrain(), t, gamemap::overlay_rule::terrain_, t_translation::terrain_matches(), gamemap::overlay_rule::use_old_, t_translation::VOID_TERRAIN, t_translation::ter_map::w, map_location::wml_x(), map_location::wml_y(), map_location::x, and map_location::y.
Referenced by mapgen_gamemap::intf_mg_terrain_mask(), overlay(), and gamemap::overlay_rule::overlay_rule().
std::vector< map_location > gamemap::parse_location_range | ( | const std::string & | xvals, |
const std::string & | yvals, | ||
bool | with_border = false |
||
) | const |
Parses ranges of locations into a vector of locations, using this map's dimensions as bounds.
Definition at line 421 of file map.cpp.
References border_size(), h(), i, utils::parse_range(), utils::split(), and w().
Referenced by tod_manager::add_time_area(), and team::build().
void gamemap::read | ( | const std::string & | data, |
const bool | allow_invalid = true |
||
) |
Definition at line 126 of file map.cpp.
References border_size(), e, t_translation::ter_map::get(), h_, game::error::message, t_translation::read_game_map(), read_header(), starting_positions_, t, tdata_, tiles_, total_height(), total_width(), villages_, w_, and t_translation::write_terrain_code().
Referenced by gamemap(), game_lua_kernel::intf_terrain_mask(), read_header(), tdata(), and game_events::WML_HANDLER_FUNCTION().
|
private |
void gamemap::set_special_location | ( | const std::string & | id, |
const map_location & | loc | ||
) |
Definition at line 360 of file map.cpp.
References starting_positions_, and map_location::valid().
Referenced by operator[](), editor::editor_action_starting_position::perform_without_undo(), and set_starting_position().
void gamemap::set_starting_position | ( | int | side, |
const map_location & | loc | ||
) |
Manipulate starting positions of the different sides.
Definition at line 377 of file map.cpp.
References set_special_location().
Referenced by operator[](), and game_state::place_sides_in_preferred_locations().
void gamemap::set_terrain | ( | const map_location & | loc, |
const t_translation::terrain_code & | terrain, | ||
const terrain_type_data::merge_mode | mode = terrain_type_data::BOTH , |
||
bool | replace_if_failed = false |
||
) |
Clobbers over the terrain at location 'loc', with the given terrain.
Uses mode and replace_if_failed like merge_terrains().
Definition at line 394 of file map.cpp.
References DBG_G, get_terrain(), is_village(), t_translation::NONE_TERRAIN, on_board(), on_board_with_border(), gui2::dialogs::tip::remove(), tdata_, and villages_.
Referenced by editor::map_context::draw_terrain_actual(), editor::editor_map::mask_to(), overlay_impl(), gamemap::overlay_rule::overlay_rule(), editor::map_fragment::paste_into(), and villages().
map_location gamemap::special_location | ( | const std::string & | id | ) | const |
Definition at line 324 of file map.cpp.
References starting_positions_, map_location::x, and map_location::y.
Referenced by editor::location_palette::adjust_size(), unit_creator::find_location(), operator[](), and starting_position().
|
inline |
Definition at line 218 of file map.hpp.
References starting_positions_.
Referenced by game_events::WML_HANDLER_FUNCTION().
map_location gamemap::starting_position | ( | int | side | ) | const |
Definition at line 336 of file map.cpp.
References special_location().
Referenced by impl_side_get(), editor::mouse_action::key_event(), operator[](), game_state::place_sides_in_preferred_locations(), and team_builder::place_units().
|
inline |
Definition at line 66 of file map.hpp.
References gamemap(), read(), tdata_, write(), and ~gamemap().
Referenced by wfl::gamestate::DEFINE_WFL_FUNCTION(), image::getMinimap(), and help::load_terrain_types_data().
|
inline |
Real height of the map, including borders.
Definition at line 133 of file map.hpp.
References t_translation::ter_map::h, and tiles_.
Referenced by editor::editor_map::everything_selected(), image::getMinimap(), read(), editor::editor_map::sanity_check(), and game_events::WML_HANDLER_FUNCTION().
|
inline |
Real width of the map, including borders.
Definition at line 130 of file map.hpp.
References tiles_, and t_translation::ter_map::w.
Referenced by editor::editor_map::everything_selected(), image::getMinimap(), read(), editor::editor_map::sanity_check(), and game_events::WML_HANDLER_FUNCTION().
const t_translation::ter_list & gamemap::underlying_def_terrain | ( | const map_location & | loc | ) | const |
const t_translation::ter_list & gamemap::underlying_def_terrain | ( | const t_translation::terrain_code & | terrain | ) | const |
const t_translation::ter_list & gamemap::underlying_mvt_terrain | ( | const map_location & | loc | ) | const |
Definition at line 53 of file map.cpp.
References get_terrain().
const t_translation::ter_list & gamemap::underlying_mvt_terrain | ( | const t_translation::terrain_code & | terrain | ) | const |
const t_translation::ter_list & gamemap::underlying_union_terrain | ( | const map_location & | loc | ) | const |
Definition at line 57 of file map.cpp.
References get_terrain().
Referenced by preferences::encounter_map_terrain(), REPORT_GENERATOR(), and unit_box_at().
const t_translation::ter_list & gamemap::underlying_union_terrain | ( | const t_translation::terrain_code & | terrain | ) | const |
|
inline |
Return a list of the locations of villages on the map.
Definition at line 188 of file map.hpp.
References terrain_type_data::BOTH, get_terrain_info(), get_terrain_list(), set_terrain(), and villages_.
Referenced by ai::default_ai_context_impl::find_targets(), ai::default_recruitment::recruitment::get_estimated_village_gain(), gui2::dialogs::game_stats::pre_show(), campaign_controller::show_carryover_message(), and ai::default_recruitment::recruitment::update_important_hexes().
|
inline |
Effective map width, in hexes.
Definition at line 121 of file map.hpp.
References w_.
Referenced by ai::ai_default_rca::move_to_targets_phase::access_points(), display::bounds_check_position(), terrain_builder::build_terrains(), game_state::can_recruit_on(), ai::ai_default_rca::move_to_targets_phase::choose_move(), actions::shroud_clearer::clear_loc(), events::menu_handler::do_search(), display::draw_minimap(), display::draw_minimap_units(), ai::ai_default_rca::goto_phase::evaluate(), ai::ai_default_rca::move_leader_to_goals_phase::evaluate(), ai::ai_default_rca::move_leader_to_keep_phase::evaluate(), actions::find_recruit_location(), pathfind::find_routes(), ai::default_ai_context_impl::find_targets(), for_each_loc(), for_each_walkable_loc(), pathfind::full_cost_map::full_cost_map(), mp::game_info::game_info(), ai::keeps_cache::get(), pathfind::full_cost_map::get_pair_at(), events::mouse_handler::get_route(), get_tiles_radius(), image::getMinimap(), game_lua_kernel::intf_find_path(), game_lua_kernel::intf_get_map_size(), editor::editor_map::invert_selection(), editor::editor_map::mask_to(), display::max_map_area(), display::minimap_location_on(), editor::context_manager::new_map_dialog(), editor::context_manager::new_scenario_dialog(), parse_location_range(), terrain_builder::rebuild_cache_all(), editor::editor_map::resize(), editor::context_manager::resize_map_dialog(), editor::editor_map::same_size_as(), editor::editor_map::sanity_check(), editor::map_context::set_map(), ai::move_result::test_route(), and ai::default_recruitment::recruitment::update_average_local_cost().
std::string gamemap::write | ( | ) | const |
Definition at line 210 of file map.cpp.
References border_size(), starting_positions_, tiles_, and t_translation::write_game_map().
Referenced by events::menu_handler::save_map(), editor::map_context::save_map(), tdata(), and editor::map_context::to_config().
void gamemap::write_terrain | ( | const map_location & | loc, |
config & | cfg | ||
) | const |
Writes the terrain at loc to cfg.
Definition at line 99 of file map.cpp.
References get_terrain(), and t_translation::write_terrain_code().
Referenced by operator[]().
|
static |
The default border style for a map.
Definition at line 211 of file map.hpp.
Referenced by border_size(), passage_path_calculator::cost(), output_map(), cave_map_generator::cave_map_generator_job::place_castle(), and cave_map_generator::cave_map_generator_job::set_terrain().
|
protected |
Definition at line 261 of file map.hpp.
Referenced by empty(), editor::editor_map::expand_bottom(), editor::editor_map::expand_top(), h(), on_board(), on_board_with_border(), read(), editor::editor_map::sanity_check(), editor::editor_map::shrink_bottom(), and editor::editor_map::shrink_top().
|
protected |
Definition at line 243 of file map.hpp.
Referenced by is_starting_position(), num_valid_starting_positions(), overlay(), read(), editor::editor_map::resize(), set_special_location(), editor::editor_map::set_starting_position_labels(), special_location(), special_locations(), and write().
|
private |
Definition at line 254 of file map.hpp.
Referenced by gamemap(), get_terrain_editor_string(), get_terrain_info(), get_terrain_list(), get_terrain_string(), get_underlying_terrain_string(), gives_healing(), is_castle(), is_keep(), is_village(), read(), set_terrain(), tdata(), underlying_def_terrain(), underlying_mvt_terrain(), and underlying_union_terrain().
|
protected |
Definition at line 241 of file map.hpp.
Referenced by editor::editor_map::expand_bottom(), editor::editor_map::expand_left(), editor::editor_map::expand_right(), editor::editor_map::expand_top(), on_board_with_border(), operator[](), overlay(), read(), editor::editor_map::sanity_check(), editor::editor_map::shrink_bottom(), editor::editor_map::shrink_left(), editor::editor_map::shrink_right(), editor::editor_map::shrink_top(), total_height(), total_width(), and write().
|
protected |
Definition at line 257 of file map.hpp.
Referenced by read(), editor::editor_map::resize(), set_terrain(), and villages().
|
protected |
Sizes of the map area.
Definition at line 260 of file map.hpp.
Referenced by empty(), editor::editor_map::expand_left(), editor::editor_map::expand_right(), on_board(), on_board_with_border(), read(), editor::editor_map::sanity_check(), editor::editor_map::shrink_left(), editor::editor_map::shrink_right(), and w().