Encapsulates the map of the game. More...
#include <map.hpp>
Public Types | |
enum | { MAX_PLAYERS = 9 } |
Maximum number of players supported. More... | |
using | tstarting_positions = t_translation::tstarting_positions |
Public Member Functions | |
const t_translation::t_list & | underlying_mvt_terrain (const map_location &loc) const |
const t_translation::t_list & | underlying_def_terrain (const map_location &loc) const |
const t_translation::t_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::t_list & | underlying_mvt_terrain (const t_translation::t_terrain &terrain) const |
const t_translation::t_list & | underlying_def_terrain (const t_translation::t_terrain &terrain) const |
const t_translation::t_list & | underlying_union_terrain (const t_translation::t_terrain &terrain) const |
std::string | get_terrain_string (const t_translation::t_terrain &terrain) const |
std::string | get_terrain_editor_string (const t_translation::t_terrain &terrain) const |
std::string | get_underlying_terrain_string (const t_translation::t_terrain &terrain) const |
bool | is_village (const t_translation::t_terrain &terrain) const |
int | gives_healing (const t_translation::t_terrain &terrain) const |
bool | is_castle (const t_translation::t_terrain &terrain) const |
bool | is_keep (const t_translation::t_terrain &terrain) const |
const terrain_type & | get_terrain_info (const t_translation::t_terrain &terrain) const |
const tdata_cache & | tdata () const |
gamemap (const tdata_cache &tdata, const std::string &data) | |
Loads a map, with the given terrain configuration. More... | |
gamemap (const tdata_cache &tdata, const config &level) | |
Loads a map, from the [map] wml config in level. More... | |
virtual | ~gamemap () |
void | read (const std::string &data, const bool allow_invalid=true, const int border_size=1) |
std::string | write () const |
void | overlay (const gamemap &m, const config &rules, int x=0, int y=0, bool border=false) |
Overlays another map onto this one at the given position. More... | |
int | w () const |
Effective map width. More... | |
int | h () const |
Effective map height. 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::t_terrain | operator[] (const map_location &loc) const |
t_translation::t_terrain | 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::t_list & | get_terrain_list () const |
Gets the list of terrains. More... | |
void | set_terrain (const map_location &loc, const t_translation::t_terrain &terrain, const terrain_type_data::tmerge_mode mode=terrain_type_data::BOTH, bool replace_if_failed=false) |
Clobbers over the terrain at location 'loc', with the given terrain. More... | |
const std::map < t_translation::t_terrain, size_t > & | get_weighted_terrain_frequencies () const |
Returns a list of the frequencies of different terrain types on the map, with terrain nearer the center getting weighted higher. More... | |
void | remove_from_border_cache (const map_location &loc) |
Remove the cached border terrain at loc. 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 tstarting_positions & | special_locations () const |
Static Public Attributes | |
static const int | default_border = 1 |
The default border style for a map. More... | |
Protected Member Functions | |
void | clear_border_cache () |
Clears the border cache, needed for the editor. More... | |
Protected Attributes | |
t_translation::t_map | tiles_ |
tstarting_positions | starting_positions_ |
The size of the starting positions array is MAX_PLAYERS + 1, because the positions themselves are numbered from 1. More... | |
int | w_ |
Sizes of the map area. More... | |
int | h_ |
int | total_width_ |
Sizes of the map including the borders. More... | |
int | total_height_ |
Private Member Functions | |
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 | |
tdata_cache | tdata_ |
Allows lookup of terrain at a particular location. More... | |
std::vector< map_location > | villages_ |
std::map< map_location, t_translation::t_terrain > | borderCache_ |
std::map < t_translation::t_terrain, size_t > | terrainFrequencyCache_ |
int | border_size_ |
The size of the border around the map. More... | |
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 tdata_cache & | tdata, |
const std::string & | data | ||
) |
gamemap::gamemap | ( | const tdata_cache & | tdata, |
const config & | level | ||
) |
Loads a map, from the [map] wml config in level.
Data should be a series of lines, with each character representing one hex on the map. Starting locations are represented by numbers
tdata | the terrain data |
level | the scenario config to load from. |
Definition at line 125 of file map.cpp.
References DBG_G, config::debug(), h_, read(), total_height_, total_width_, and w_.
|
inline |
Size of the map border.
Definition at line 111 of file map.hpp.
References border_size_.
Referenced by terrain_filter::get_locations(), get_tiles_radius(), game_lua_kernel::intf_get_map_size(), editor::editor_map::mask_to(), overlay(), parse_location_range(), read(), and editor::editor_map::sanity_check().
|
inlineprotected |
Clears the border cache, needed for the editor.
Definition at line 221 of file map.hpp.
References borderCache_.
Referenced by editor::editor_map::expand_left(), and editor::editor_map::expand_top().
|
inline |
Tell if the map is of 0 size.
Definition at line 157 of file map.hpp.
Referenced by display::draw(), and team_builder::init().
t_translation::t_terrain 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 341 of file map.cpp.
References border_size_, borderCache_, c, get_adjacent_tiles(), i, mp_ui_alerts::items, itor, t_translation::NONE_TERRAIN, map_location::null_location(), on_board(), on_board_with_border(), tdata_, tiles_, map_location::x, and map_location::y.
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(), display::draw_hex(), 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(), basic_unit_filter_impl::internal_matches_filter(), unit_animation_component::invalidate(), is_castle(), is_keep(), is_village(), editor::editor_map::mask_to(), terrain_filter::match_internal(), unit_animation::matches(), ai::ai_default_rca::move_to_targets_phase::move_group(), editor::editor_action_fill::perform(), 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 65 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::t_terrain & | terrain | ) | const |
const terrain_type & gamemap::get_terrain_info | ( | const t_translation::t_terrain & | terrain | ) | const |
Definition at line 100 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_filter::match_internal(), 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(), unit_box_at(), unit_defense(), and unit_moves().
const terrain_type & gamemap::get_terrain_info | ( | const map_location & | loc | ) | const |
Shortcut to get_terrain_info(get_terrain(loc)).
Definition at line 52 of file map.cpp.
References get_terrain(), and tdata_.
const t_translation::t_list & gamemap::get_terrain_list | ( | ) | const |
Gets the list of terrains.
Definition at line 46 of file map.cpp.
References tdata_.
Referenced by editor::terrain_palette::setup().
std::string gamemap::get_terrain_string | ( | const map_location & | loc | ) | const |
std::string gamemap::get_terrain_string | ( | const t_translation::t_terrain & | terrain | ) | const |
std::string gamemap::get_underlying_terrain_string | ( | const t_translation::t_terrain & | terrain | ) | const |
const std::map< t_translation::t_terrain, size_t > & gamemap::get_weighted_terrain_frequencies | ( | ) | const |
Returns a list of the frequencies of different terrain types on the map, with terrain nearer the center getting weighted higher.
Definition at line 513 of file map.cpp.
References border_size_, distance_between(), h(), i, terrainFrequencyCache_, tiles_, w(), and map_location::ZERO().
int gamemap::gives_healing | ( | const map_location & | loc | ) | const |
Definition at line 70 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::t_terrain & | terrain | ) | const |
|
inline |
Effective map height.
Definition at line 108 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(), editor::editor_map::clone_column(), ai::default_recruitment::recruitment::compare_cost_maps_and_update_important_hexes(), events::menu_handler::do_search(), display::draw_minimap(), display::draw_minimap_units(), preferences::encounter_map_terrain(), 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(), pathfind::find_routes(), ai::default_ai_context_impl::find_targets(), pathfind::full_cost_map::full_cost_map(), game_info::game_info(), ai::keeps_cache::get(), terrain_filter::get_locations(), pathfind::full_cost_map::get_pair_at(), events::mouse_handler::get_route(), get_tiles_radius(), get_weighted_terrain_frequencies(), 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(), overlay(), parse_location_range(), mp::gamebrowser::populate_game_item_map_info(), 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 72 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(), and actions::get_recruits().
bool gamemap::is_castle | ( | const t_translation::t_terrain & | terrain | ) | const |
bool gamemap::is_keep | ( | const map_location & | loc | ) | const |
Definition at line 74 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(), and events::mouse_handler::move_unit_along_route().
bool gamemap::is_keep | ( | const t_translation::t_terrain & | 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 439 of file map.cpp.
References starting_positions_, map_location::x, and map_location::y.
Referenced by editor::mouse_action::key_event(), editor::editor_action_starting_position::perform(), 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 68 of file map.cpp.
References get_terrain(), and on_board().
Referenced by ai::attack_analysis::analyze(), team::build(), ai::ai_default_rca::retreat_phase::evaluate(), ai::ai_default_rca::get_villages_phase::find_villages(), pathfind::mark_route(), terrain_filter::match_internal(), editor::editor_action_village::perform(), 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(), set_terrain(), editor::mouse_action_village::up_left(), and editor::mouse_action_village::up_right().
bool gamemap::is_village | ( | const t_translation::t_terrain & | terrain | ) | const |
int gamemap::num_valid_starting_positions | ( | ) | const |
Definition at line 426 of file map.cpp.
References starting_positions_.
Referenced by 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 467 of file map.cpp.
References h_, map_location::valid(), w_, map_location::x, and map_location::y.
Referenced by 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(), events::console_handler::do_create(), editor::mouse_action_item::drag_end_left(), editor::mouse_action_unit::drag_end_left(), game_display::draw_hex(), display::draw_hex(), display::draw_invalidated(), ai::ai_default_rca::goto_phase::evaluate(), ai::ai_default_rca::move_to_targets_phase::execute(), unit_creator::find_location(), ai::default_ai_context_impl::find_targets(), pathfind::find_vacant_tile(), get_terrain(), get_tiles_radius(), image::getMinimap(), gives_healing(), basic_unit_filter_impl::internal_matches_filter(), game_lua_kernel::intf_teleport(), is_castle(), is_keep(), is_village(), unit::is_visible_to_team(), editor::mouse_action::key_event(), terrain_filter::match(), terrain_filter::match_internal(), events::mouse_handler::mouse_motion(), ai::ai_default_rca::move_to_targets_phase::move_group(), ai::ai_default_rca::remove_wrong_targets::operator()(), placing_score(), controller_base::play_slice(), 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(), 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 472 of file map.cpp.
References border_size_, h_, tiles_, w_, map_location::x, and map_location::y.
Referenced by editor::editor_map::add_to_selection(), actions::shroud_clearer::clear_loc(), 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(), editor::editor_map::sanity_check(), and set_terrain().
|
inline |
Definition at line 119 of file map.hpp.
References border_size_, tiles_, map_location::x, and map_location::y.
void gamemap::overlay | ( | const gamemap & | m, |
const config & | rules, | ||
int | x = 0 , |
||
int | y = 0 , |
||
bool | border = false |
||
) |
Overlays another map onto this one at the given position.
Definition at line 274 of file map.cpp.
References terrain_type_data::BASE, border_size(), border_size_, terrain_type_data::BOTH, config::child(), config::child_count(), t_translation::FOGGED, h(), i, terrain_type_data::OVERLAY, t_translation::read_list(), set_terrain(), starting_positions_, gui2::terrain, t_translation::terrain_matches(), tiles_, t_translation::VOID_TERRAIN, and w().
Referenced by editor::editor_action_apply_mask::perform_without_undo().
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 537 of file map.cpp.
References border_size(), h(), i, utils::parse_range(), utils::split(), and w().
Referenced by tod_manager::add_time_area(), team::build(), terrain_filterimpl::filter_xy(), and terrain_filter::get_locations().
void gamemap::read | ( | const std::string & | data, |
const bool | allow_invalid = true , |
||
const int | border_size = 1 |
||
) |
Definition at line 154 of file map.cpp.
References border_size(), border_size_, e, ERR_CF, h_, game::error::message, t_translation::read_game_map(), read_header(), starting_positions_, tdata_, tiles_, total_height_, total_width_, villages_, w_, and t_translation::write_terrain_code().
Referenced by gamemap(), read_header(), and game_events::WML_HANDLER_FUNCTION().
|
private |
Reads the header of a map which is saved in the deprecated map_data format.
data | The mapdata to load. |
Definition at line 218 of file map.cpp.
References border_size_, and read().
Referenced by read().
|
inline |
Remove the cached border terrain at loc.
Needed by the editor to make tiles at the border update correctly when drawing other tiles.
Definition at line 189 of file map.hpp.
References borderCache_.
Referenced by set_terrain().
void gamemap::set_special_location | ( | const std::string & | id, |
const map_location & | loc | ||
) |
Definition at line 445 of file map.cpp.
References starting_positions_, schema_validation::valid, map_location::valid(), map_location::x, and map_location::y.
Referenced by editor::editor_action_starting_position::perform(), 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 462 of file map.cpp.
References set_special_location().
void gamemap::set_terrain | ( | const map_location & | loc, |
const t_translation::t_terrain & | terrain, | ||
const terrain_type_data::tmerge_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 479 of file map.cpp.
References border_size_, get_adjacent_tiles(), get_terrain(), is_village(), t_translation::NONE_TERRAIN, on_board(), on_board_with_border(), schema_validation::remove, remove_from_border_cache(), tdata_, tiles_, villages_, map_location::x, and map_location::y.
Referenced by editor::map_context::draw_terrain_actual(), editor::editor_map::mask_to(), overlay(), and editor::map_fragment::paste_into().
map_location gamemap::special_location | ( | const std::string & | id | ) | const |
Definition at line 409 of file map.cpp.
References starting_positions_.
Referenced by editor::location_palette::adjust_size(), terrain_filterimpl::filter_special_loc(), unit_creator::find_location(), terrain_filter::get_locations(), terrain_filter::match_internal(), editor::editor_action_starting_position::perform(), and starting_position().
|
inline |
Definition at line 208 of file map.hpp.
References starting_positions_.
map_location gamemap::starting_position | ( | int | side | ) | const |
Definition at line 421 of file map.cpp.
References special_location().
Referenced by game_lua_kernel::intf_get_starting_location(), editor::mouse_action::key_event(), game_state::place_sides_in_preferred_locations(), and team_builder::place_units().
|
inline |
Definition at line 70 of file map.hpp.
References tdata_.
Referenced by image::getMinimap(), game_lua_kernel::intf_get_terrain_info(), help::load_terrain_types_data(), and terrain_filter::match_internal().
|
inline |
Real height of the map, including borders.
Definition at line 117 of file map.hpp.
References total_height_.
Referenced by editor::editor_map::everything_selected(), image::getMinimap(), editor::editor_map::sanity_check(), and game_events::WML_HANDLER_FUNCTION().
|
inline |
Real width of the map, including borders.
Definition at line 114 of file map.hpp.
References total_width_.
Referenced by editor::editor_map::everything_selected(), image::getMinimap(), editor::editor_map::sanity_check(), and game_events::WML_HANDLER_FUNCTION().
const t_translation::t_list & gamemap::underlying_def_terrain | ( | const map_location & | loc | ) | const |
const t_translation::t_list & gamemap::underlying_def_terrain | ( | const t_translation::t_terrain & | terrain | ) | const |
const t_translation::t_list & gamemap::underlying_mvt_terrain | ( | const map_location & | loc | ) | const |
Definition at line 57 of file map.cpp.
References get_terrain().
const t_translation::t_list & gamemap::underlying_mvt_terrain | ( | const t_translation::t_terrain & | terrain | ) | const |
const t_translation::t_list & gamemap::underlying_union_terrain | ( | const map_location & | loc | ) | const |
Definition at line 61 of file map.cpp.
References get_terrain().
Referenced by preferences::encounter_map_terrain(), REPORT_GENERATOR(), and unit_box_at().
const t_translation::t_list & gamemap::underlying_union_terrain | ( | const t_translation::t_terrain & | terrain | ) | const |
|
inline |
Return a list of the locations of villages on the map.
Definition at line 163 of file map.hpp.
References villages_.
Referenced by ai::default_ai_context_impl::find_targets(), ai::default_recruitment::recruitment::get_estimated_village_gain(), game_lua_kernel::intf_get_villages(), campaign_controller::show_carryover_message(), events::menu_handler::status_table(), and ai::default_recruitment::recruitment::update_important_hexes().
|
inline |
Effective map width.
Definition at line 105 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(), ai::default_recruitment::recruitment::compare_cost_maps_and_update_important_hexes(), events::menu_handler::do_search(), display::draw_minimap(), display::draw_minimap_units(), preferences::encounter_map_terrain(), 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(), pathfind::find_routes(), ai::default_ai_context_impl::find_targets(), pathfind::full_cost_map::full_cost_map(), game_info::game_info(), ai::keeps_cache::get(), terrain_filter::get_locations(), pathfind::full_cost_map::get_pair_at(), events::mouse_handler::get_route(), get_tiles_radius(), get_weighted_terrain_frequencies(), 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(), overlay(), parse_location_range(), mp::gamebrowser::populate_game_item_map_info(), 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 247 of file map.cpp.
References border_size_, starting_positions_, tiles_, and t_translation::write_game_map().
Referenced by editor::map_context::save_map(), 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 103 of file map.cpp.
References get_terrain(), and t_translation::write_terrain_code().
|
private |
The size of the border around the map.
Definition at line 254 of file map.hpp.
Referenced by border_size(), get_terrain(), get_weighted_terrain_frequencies(), on_board_with_border(), operator[](), overlay(), read(), read_header(), set_terrain(), and write().
|
mutableprivate |
Definition at line 240 of file map.hpp.
Referenced by clear_border_cache(), get_terrain(), and remove_from_border_cache().
|
static |
The default border style for a map.
Definition at line 201 of file map.hpp.
Referenced by 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 246 of file map.hpp.
Referenced by empty(), editor::editor_map::expand_bottom(), editor::editor_map::expand_top(), gamemap(), 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 |
The size of the starting positions array is MAX_PLAYERS + 1, because the positions themselves are numbered from 1.
Definition at line 216 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 |
Allows lookup of terrain at a particular location.
Definition at line 237 of file map.hpp.
Referenced by get_terrain(), 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().
|
mutableprivate |
Definition at line 241 of file map.hpp.
Referenced by get_weighted_terrain_frequencies().
|
protected |
Definition at line 210 of file map.hpp.
Referenced by editor::editor_map::clone_column(), editor::editor_map::expand_bottom(), editor::editor_map::expand_left(), editor::editor_map::expand_right(), editor::editor_map::expand_top(), get_terrain(), get_weighted_terrain_frequencies(), on_board_with_border(), operator[](), overlay(), read(), editor::editor_map::sanity_check(), set_terrain(), editor::editor_map::shrink_bottom(), editor::editor_map::shrink_left(), editor::editor_map::shrink_right(), editor::editor_map::shrink_top(), and write().
|
protected |
Definition at line 250 of file map.hpp.
Referenced by editor::editor_map::expand_bottom(), editor::editor_map::expand_top(), gamemap(), read(), editor::editor_map::shrink_bottom(), editor::editor_map::shrink_top(), and total_height().
|
protected |
Sizes of the map including the borders.
Definition at line 249 of file map.hpp.
Referenced by editor::editor_map::expand_left(), editor::editor_map::expand_right(), gamemap(), read(), editor::editor_map::shrink_left(), editor::editor_map::shrink_right(), and total_width().
|
private |
Definition at line 238 of file map.hpp.
Referenced by read(), set_terrain(), and villages().
|
protected |
Sizes of the map area.
Definition at line 245 of file map.hpp.
Referenced by empty(), editor::editor_map::expand_left(), editor::editor_map::expand_right(), gamemap(), on_board(), on_board_with_border(), read(), editor::editor_map::sanity_check(), editor::editor_map::shrink_left(), editor::editor_map::shrink_right(), and w().