#include <map.hpp>
Public Types | |
enum | tborder { NO_BORDER = 0, SINGLE_TILE_BORDER } |
enum | tusage { IS_MAP, IS_MASK } |
enum | tmerge_mode { BASE, OVERLAY, BOTH } |
enum | { MAX_PLAYERS = 9 } |
Maximum number of players supported. More... | |
Public Member Functions | |
const t_translation::t_list & | underlying_mvt_terrain (t_translation::t_terrain terrain) const |
const t_translation::t_list & | underlying_def_terrain (t_translation::t_terrain terrain) const |
const t_translation::t_list & | underlying_union_terrain (t_translation::t_terrain terrain) const |
const t_translation::t_list & | underlying_mvt_terrain (const location &loc) const |
const t_translation::t_list & | underlying_def_terrain (const location &loc) const |
const t_translation::t_list & | underlying_union_terrain (const location &loc) const |
bool | is_village (t_translation::t_terrain terrain) const |
int | gives_healing (t_translation::t_terrain terrain) const |
bool | is_castle (t_translation::t_terrain terrain) const |
bool | is_keep (t_translation::t_terrain terrain) const |
bool | is_village (const location &loc) const |
int | gives_healing (const location &loc) const |
bool | is_castle (const location &loc) const |
bool | is_keep (const location &loc) const |
gamemap (const config &terrain_cfg, const std::string &data) | |
Loads a map, with the given terrain configuration. | |
void | read (const std::string &data) |
Reads a map. | |
std::string | write () const |
void | overlay (const gamemap &m, const config &rules, const int x=0, const int y=0) |
Overlays another map onto this one at the given position. | |
int | w () const |
Effective dimensions of the map. | |
int | h () const |
int | total_width () const |
Real dimension of the map, including borders. | |
int | total_height () const |
const t_translation::t_terrain | operator[] (const gamemap::location &loc) const |
t_translation::t_terrain | get_terrain (const location &loc) const |
Looks up terrain at a particular location. | |
void | write_terrain (const gamemap::location &loc, config &cfg) const |
Writes the terrain at loc to cfg. | |
const location & | starting_position (int side) const |
Manipulate starting positions of the different sides. | |
int | is_starting_position (const location &loc) const |
int | num_valid_starting_positions () const |
void | set_starting_position (int side, const location &loc) |
bool | on_board (const location &loc, const bool include_border=false) const |
Tell if a location is on the map. | |
bool | empty () const |
Tell if the map is of 0 size. | |
const std::vector< location > & | villages () const |
Return a list of the locations of villages on the map. | |
const terrain_type & | get_terrain_info (const t_translation::t_terrain terrain) const |
Get the corresponding terrain_type information object for a given type of terrain. | |
const terrain_type & | get_terrain_info (const location &loc) const |
Shortcut to get_terrain_info(get_terrain(loc)). | |
const t_translation::t_list & | get_terrain_list () const |
Gets the list of terrains. | |
void | set_terrain (const location &loc, const t_translation::t_terrain terrain, const tmerge_mode mode=BOTH, bool replace_if_failed=false) |
Clobbers over the terrain at location 'loc', with the given terrain. | |
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. | |
void | remove_from_border_cache (const location &loc) |
Remove the cached border terrain at loc. | |
tusage | get_usage () const |
Returns the usage of the map. | |
t_translation::t_terrain | merge_terrains (const t_translation::t_terrain old_t, const t_translation::t_terrain new_t, const tmerge_mode mode, bool replace_if_failed=false) |
Tries to merge old and new terrain using the merge_settings config Relevant parameters are "layer" and "replace_conflicting" "layer" specifies the layer that should be replaced (base or overlay, default is both). | |
Static Public Member Functions | |
static int | get_drawing_order (const gamemap::location &loc) |
Drawing order, copied from ordered_draw in display.hpp. | |
Static Public Attributes | |
static const std::string | default_map_header = "usage=map\nborder_size=1\n\n" |
The default map header, needed for maps created with terrain_translation::write_game_map(). | |
static const tborder | default_border = gamemap::SINGLE_TILE_BORDER |
The default border style for a map. | |
Protected Member Functions | |
void | clear_border_cache () |
Clears the border cache, needed for the editor. | |
Protected Attributes | |
t_translation::t_map | tiles_ |
location | startingPositions_ [MAX_PLAYERS+1] |
The size of the starting positions array is MAX_PLAYERS + 1, because the positions themselves are numbered from 1. | |
Private Member Functions | |
int | num_starting_positions () const |
const t_translation::t_list | operator[] (int index) const |
Allows lookup of terrain at a particular location. | |
bool | try_merge_terrains (const t_translation::t_terrain terrain) |
Tries to find out if "terrain" can be created by combining two existing terrains Will add the resulting terrain to the terrain list if successfull. | |
Private Attributes | |
t_translation::t_list | terrainList_ |
std::map < t_translation::t_terrain, terrain_type > | tcodeToTerrain_ |
std::vector< location > | villages_ |
std::map< location, t_translation::t_terrain > | borderCache_ |
std::map < t_translation::t_terrain, size_t > | terrainFrequencyCache_ |
int | w_ |
Sizes of the map area. | |
int | h_ |
int | total_width_ |
Sizes of the map including the borders. | |
int | total_height_ |
int | border_size_ |
The size of the border around the map. | |
tusage | usage_ |
The kind of map is being loaded. | |
Classes | |
struct | incorrect_format_exception |
Throws exception if the map file is not in the correct format. More... | |
struct | location |
Represents a location on the map. More... |
Although the game is hexagonal, the map is stored as a grid. Each type of terrain is represented by a multiletter terrain code.
Definition at line 43 of file map.hpp.
enum gamemap::tborder |
enum gamemap::tusage |
enum gamemap::tmerge_mode |
anonymous enum |
Maximum number of players supported.
Warning: when you increase this, you need to add more definitions to the team_colors.cfg file.
gamemap::gamemap | ( | const config & | cfg, | |
const std::string & | data | |||
) |
Loads a map, with the given terrain configuration.
gamemap constructor
Data should be a series of lines, with each character representing one hex on the map. Starting locations are represented by numbers, and will be of type keep.
Definition at line 288 of file map.cpp.
References create_terrain_maps(), DBG_G, config::get_children(), read(), tcodeToTerrain_, and terrainList_.
const t_translation::t_list & gamemap::underlying_mvt_terrain | ( | t_translation::t_terrain | terrain | ) | const |
Definition at line 51 of file map.cpp.
References tcodeToTerrain_.
Referenced by unit_movement_type::movement_cost(), unit::movement_cost_internal(), and underlying_mvt_terrain().
const t_translation::t_list & gamemap::underlying_def_terrain | ( | t_translation::t_terrain | terrain | ) | const |
Definition at line 65 of file map.cpp.
References tcodeToTerrain_.
Referenced by unit_movement_type::defense_modifier(), unit::defense_modifier(), and underlying_def_terrain().
const t_translation::t_list & gamemap::underlying_union_terrain | ( | t_translation::t_terrain | terrain | ) | const |
Definition at line 79 of file map.cpp.
References tcodeToTerrain_.
Referenced by editor_display::draw(), preferences::encounter_map_terrain(), reports::generate_report(), map_editor::terrain_palette::get_terrain_string(), and underlying_union_terrain().
static int gamemap::get_drawing_order | ( | const gamemap::location & | loc | ) | [inline, static] |
Drawing order, copied from ordered_draw in display.hpp.
This returns the order in which the units should be drawn so they overlap propererly.
Definition at line 113 of file map.hpp.
References gamemap::location::x, and gamemap::location::y.
Referenced by game_display::draw(), editor_display::draw(), game_display::draw_movement_info(), display::draw_text_in_hex(), unit_frame::redraw(), and unit::redraw_unit().
const t_translation::t_list& gamemap::underlying_mvt_terrain | ( | const location & | loc | ) | const [inline] |
const t_translation::t_list& gamemap::underlying_def_terrain | ( | const location & | loc | ) | const [inline] |
const t_translation::t_list& gamemap::underlying_union_terrain | ( | const location & | loc | ) | const [inline] |
bool gamemap::is_village | ( | t_translation::t_terrain | terrain | ) | const [inline] |
Definition at line 123 of file map.hpp.
References get_terrain_info(), and terrain_type::is_village().
Referenced by ai::attack_analysis::analyze(), do_replay_handle(), find_routes(), reports::generate_report(), game_display::get_flag(), get_terrain(), sample_ai::get_villages(), game_display::invalidate_animations(), is_village(), ai::move_leader_after_recruit(), move_unit(), ai_interface::move_unit_partial(), ai::power_projection(), ai::rate_terrain(), read(), events::menu_handler::redo(), ai::retreat_units(), route_turns_to_complete(), set_terrain(), events::menu_handler::undo(), and battle_context::unit_stats::unit_stats().
int gamemap::gives_healing | ( | t_translation::t_terrain | terrain | ) | const [inline] |
Definition at line 125 of file map.hpp.
References get_terrain_info(), and terrain_type::gives_healing().
Referenced by ai::attack_analysis::analyze(), calculate_healing(), ai::get_healing(), gives_healing(), and ai::rate_terrain().
bool gamemap::is_castle | ( | t_translation::t_terrain | terrain | ) | const [inline] |
Definition at line 127 of file map.hpp.
References get_terrain_info(), and terrain_type::is_castle().
Referenced by can_recruit_on(), castle_cost_calculator::cost(), find_vacant(), formula_ai::get_keeps(), is_castle(), and ai::keeps().
bool gamemap::is_keep | ( | t_translation::t_terrain | terrain | ) | const [inline] |
Definition at line 129 of file map.hpp.
References get_terrain_info(), and terrain_type::is_keep().
Referenced by formula_ai::get_keeps(), get_terrain(), is_keep(), ai::keeps(), and recruit_unit().
bool gamemap::is_village | ( | const location & | loc | ) | const [inline] |
int gamemap::gives_healing | ( | const location & | loc | ) | const [inline] |
bool gamemap::is_castle | ( | const location & | loc | ) | const [inline] |
bool gamemap::is_keep | ( | const location & | loc | ) | const [inline] |
void gamemap::read | ( | const std::string & | data | ) |
Reads a map.
data | the mapdata to load |
Definition at line 312 of file map.cpp.
References _, border_size_, ERR_CF, h_, IS_MAP, IS_MASK, is_village(), map, MAX_PLAYERS, t_translation::error::message, t_translation::read_game_map(), startingPositions_, tcodeToTerrain_, tiles_, total_height_, total_width_, try_merge_terrains(), usage_, VALIDATE, vgettext(), villages_, w_, and t_translation::write_terrain_code().
Referenced by gamemap().
std::string gamemap::write | ( | ) | const |
Definition at line 432 of file map.cpp.
References border_size_, data, IS_MAP, lexical_cast(), MAX_PLAYERS, on_board(), startingPositions_, tiles_, usage_, t_translation::write_game_map(), gamemap::location::x, and gamemap::location::y.
Referenced by map_editor::change_language(), map_editor::edit_flip(), map_editor::edit_resize(), map_editor::edit_revert(), editormap::flip(), editormap::resize(), events::menu_handler::save_map(), map_editor::save_map(), and events::menu_handler::write_game_snapshot().
Overlays another map onto this one at the given position.
Definition at line 453 of file map.cpp.
References BASE, border_size_, BOTH, cfg, t_translation::FOGGED, config::get_children(), h(), OVERLAY, pos, t_translation::read_list(), set_terrain(), startingPositions_, utils::string_bool(), t_translation::terrain_matches(), t_translation::VOID_TERRAIN, and w().
int gamemap::w | ( | ) | const [inline] |
Effective dimensions of the map.
Definition at line 171 of file map.hpp.
References w_.
Referenced by ai::access_points(), ai::analyze_potential_recruit_movements(), display::bounds_check_position(), terrain_builder::build_terrains(), can_recruit_on(), ai::choose_move(), clear_shroud_loc(), events::menu_handler::do_search(), display::draw_border(), display::draw_minimap(), game_display::draw_minimap_units(), map_editor::edit_resize(), map_editor::edit_select_all(), preferences::encounter_map_terrain(), formula_ai::get_keeps(), terrain_filter::get_locations(), display::get_rect_hex_bounds(), events::mouse_handler::get_route(), get_weighted_terrain_frequencies(), image::getMinimap(), ai::keeps(), display::max_map_area(), display::minimap_location_on(), ai::move_leader_to_goals(), overlay(), parse_location_range(), editormap::resize(), mp::gamebrowser::set_game_items(), and map_editor::valid_mapdata().
int gamemap::h | ( | ) | const [inline] |
Definition at line 172 of file map.hpp.
References h_.
Referenced by ai::access_points(), ai::analyze_potential_recruit_movements(), display::bounds_check_position(), terrain_builder::build_terrains(), can_recruit_on(), ai::choose_move(), clear_shroud_loc(), events::menu_handler::do_search(), display::draw_border(), display::draw_minimap(), game_display::draw_minimap_units(), map_editor::edit_resize(), map_editor::edit_select_all(), preferences::encounter_map_terrain(), formula_ai::get_keeps(), terrain_filter::get_locations(), display::get_rect_hex_bounds(), events::mouse_handler::get_route(), get_weighted_terrain_frequencies(), image::getMinimap(), ai::keeps(), display::max_map_area(), display::minimap_location_on(), ai::move_leader_to_goals(), overlay(), parse_location_range(), editormap::resize(), mp::gamebrowser::set_game_items(), and map_editor::valid_mapdata().
int gamemap::total_width | ( | ) | const [inline] |
Real dimension of the map, including borders.
Definition at line 175 of file map.hpp.
References total_width_.
Referenced by image::getMinimap().
int gamemap::total_height | ( | ) | const [inline] |
Definition at line 176 of file map.hpp.
References total_height_.
Referenced by image::getMinimap().
const t_translation::t_terrain gamemap::operator[] | ( | const gamemap::location & | loc | ) | const [inline] |
Definition at line 178 of file map.hpp.
References border_size_, tiles_, gamemap::location::x, and gamemap::location::y.
t_translation::t_terrain gamemap::get_terrain | ( | const 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 547 of file map.cpp.
References border_size_, borderCache_, get_adjacent_tiles(), is_keep(), is_village(), t_translation::NONE_TERRAIN, on_board(), tiles_, gamemap::location::x, and gamemap::location::y.
Referenced by ai::best_defensive_position(), terrain_builder::build_terrains(), ai::choose_move(), map_editor::copy_buffer(), sample_ai::do_attacks(), game_display::draw(), editor_display::draw(), game_display::draw_movement_info(), map_editor::draw_terrain(), preferences::encounter_map_terrain(), map_editor::flood_fill(), game_display::footsteps_images(), reports::generate_report(), map_editor::get_component(), game_display::get_flag(), get_terrain_info(), gives_healing(), unit::internal_matches_filter(), is_castle(), is_keep(), is_village(), map_editor::left_click(), unit_animation::matches(), ai::move_group(), unit::overlaps(), map_editor::paste_buffer(), map_editor::perform_fill_hexes(), ai::rate_group(), ai::rate_terrain(), terrain_builder::rebuild_terrain(), unit::redraw_unit(), ai::retreat_units(), map_editor::right_click(), terrain_builder::rule_matches(), set_terrain(), ai::should_retreat(), timeofday_at(), underlying_def_terrain(), underlying_mvt_terrain(), underlying_union_terrain(), events::menu_handler::unit_list(), battle_context::unit_stats::unit_stats(), and write_terrain().
void gamemap::write_terrain | ( | const gamemap::location & | loc, | |
config & | cfg | |||
) | const |
Writes the terrain at loc to cfg.
Definition at line 93 of file map.cpp.
References get_terrain(), and t_translation::write_terrain_code().
const gamemap::location & gamemap::starting_position | ( | int | side | ) | const |
Manipulate starting positions of the different sides.
Definition at line 611 of file map.cpp.
References startingPositions_.
Referenced by ai::do_recruitment(), get_player_info(), playsingle_controller::init_gui(), map_editor::paste_buffer(), play_controller::place_sides_in_preferred_locations(), map_editor::recalculate_starting_pos_labels(), map_editor::set_starting_position(), and starting_side_at().
int gamemap::is_starting_position | ( | const location & | loc | ) | const |
Definition at line 630 of file map.cpp.
References boost::foreach_detail_::end(), num_starting_positions(), pos, and startingPositions_.
Referenced by num_valid_starting_positions(), and editormap::swap_starting_position().
int gamemap::num_valid_starting_positions | ( | ) | const |
Definition at line 621 of file map.cpp.
References is_starting_position(), and num_starting_positions().
Referenced by play_controller::place_sides_in_preferred_locations().
void gamemap::set_starting_position | ( | int | side, | |
const location & | loc | |||
) |
Definition at line 639 of file map.cpp.
References num_starting_positions(), and startingPositions_.
Referenced by map_editor::paste_buffer(), play_controller::place_sides_in_preferred_locations(), map_editor::redo(), map_editor::set_starting_position(), and map_editor::undo().
bool gamemap::on_board | ( | const location & | loc, | |
const bool | include_border = false | |||
) | const |
Tell if a location is on the map.
Should be called before indexing using [].
Definition at line 646 of file map.cpp.
References border_size_, h_, tiles_, gamemap::location::valid(), w_, gamemap::location::x, and gamemap::location::y.
Referenced by ai::analyze_potential_recruit_movements(), playsingle_controller::before_human_turn(), playsingle_controller::can_execute_command(), can_recruit_on(), ai::choose_move(), clear_shroud_loc(), emergency_path_calculator::cost(), shortest_path_calculator::cost(), move_cost_calculator::cost(), events::mouse_handler::current_unit_attacks_from(), ai::do_attack_analysis(), events::console_handler::do_create(), ai::do_move(), game_display::draw(), editor_display::draw(), map_editor::draw_on_mouseover_hexes(), find_routes(), ai::find_targets(), find_vacant(), find_vacant_tile(), find_visible_unit(), reports::generate_report(), map_editor::get_component(), get_player_info(), get_terrain(), map_editor::get_tiles(), get_tiles_radius(), image::getMinimap(), gives_healing(), map_editor::handle_mouse_button_event(), unit::internal_matches_filter(), is_castle(), is_keep(), is_village(), events::menu_handler::label_terrain(), map_editor::left_button_down(), terrain_filter::match(), terrain_filter::match_internal(), events::mouse_handler::mouse_motion(), ai::move_group(), ai::move_leader_after_recruit(), ai::move_to_targets(), map_editor::paste_buffer(), map_editor::perform_fill_hexes(), placing_score(), ai::power_projection(), recruit_unit(), route_turns_to_complete(), display::scroll_to_tile(), display::scroll_to_tiles(), map_editor::set_starting_position(), set_terrain(), unit_can_move(), and write().
bool gamemap::empty | ( | ) | const [inline] |
Tell if the map is of 0 size.
Definition at line 203 of file map.hpp.
Referenced by game_display::draw(), editor_display::draw(), display::draw_init(), get_player_info(), and display::screenshot().
const std::vector<location>& gamemap::villages | ( | ) | const [inline] |
Return a list of the locations of villages on the map.
Definition at line 209 of file map.hpp.
References villages_.
Referenced by ai::do_recruitment(), editor_display::draw(), ai::find_targets(), reports::generate_report(), ai_interface::get_value(), and playsingle_controller::play_scenario().
const terrain_type & gamemap::get_terrain_info | ( | const t_translation::t_terrain | terrain | ) | const |
Get the corresponding terrain_type information object for a given type of terrain.
Definition at line 658 of file map.cpp.
References tcodeToTerrain_.
Referenced by unit_movement_type::defense_modifier(), unit::defense_modifier(), game_display::draw(), map_editor::terrain_palette::draw(), editor_display::draw(), map_editor::draw_terrain(), map_editor::edit_new_map(), map_editor::edit_resize(), reports::generate_report(), display::get_fog_shroud_graphics(), get_terrain_info(), map_editor::terrain_palette::get_terrain_string(), image::getMinimap(), gives_healing(), is_castle(), is_keep(), is_village(), terrain_filter::match_internal(), merge_terrains(), unit_movement_type::movement_cost(), unit::movement_cost_internal(), help::unit_topic_generator::operator()(), unit::overlaps(), map_editor::perform_flood_fill(), terrain_builder::rebuild_terrain(), unit::redraw_unit(), map_editor::set_mouseover_overlay(), map_editor::terrain_palette::terrain_palette(), and timeofday_at().
const terrain_type& gamemap::get_terrain_info | ( | const location & | loc | ) | const [inline] |
Shortcut to get_terrain_info(get_terrain(loc)).
Definition at line 216 of file map.hpp.
References get_terrain(), and get_terrain_info().
const t_translation::t_list& gamemap::get_terrain_list | ( | ) | const [inline] |
Gets the list of terrains.
Definition at line 220 of file map.hpp.
References terrainList_.
Referenced by map_editor::terrain_palette::terrain_palette().
void gamemap::set_terrain | ( | const location & | loc, | |
const t_translation::t_terrain | terrain, | |||
const tmerge_mode | mode = 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 730 of file map.cpp.
References border_size_, get_adjacent_tiles(), get_terrain(), is_village(), merge_terrains(), t_translation::NONE_TERRAIN, on_board(), halo::remove(), remove_from_border_cache(), tiles_, villages_, gamemap::location::x, and gamemap::location::y.
Referenced by map_editor::draw_terrain(), map_editor::flood_fill(), overlay(), map_editor::paste_buffer(), map_editor::perform_fill_hexes(), map_editor::redo(), and map_editor::undo().
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 803 of file map.cpp.
References distance_between(), h(), terrainFrequencyCache_, and w().
Referenced by ai::average_resistance_against().
void gamemap::remove_from_border_cache | ( | const location & | loc | ) | [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 233 of file map.hpp.
References borderCache_.
Referenced by set_terrain().
tusage gamemap::get_usage | ( | ) | const [inline] |
t_translation::t_terrain gamemap::merge_terrains | ( | const t_translation::t_terrain | old_t, | |
const t_translation::t_terrain | new_t, | |||
const tmerge_mode | mode, | |||
bool | replace_if_failed = false | |||
) |
Tries to merge old and new terrain using the merge_settings config Relevant parameters are "layer" and "replace_conflicting" "layer" specifies the layer that should be replaced (base or overlay, default is both).
If "replace_conflicting" is true the new terrain will replace the old one if merging failed (using the default base if new terrain is an overlay terrain) Will return the resulting terrain or NONE_TERRAIN if merging failed
Definition at line 848 of file map.cpp.
References BASE, t_translation::t_terrain::base, BOTH, terrain_type::default_base(), get_terrain_info(), t_translation::NO_LAYER, t_translation::NONE_TERRAIN, t_translation::t_terrain::overlay, OVERLAY, tcodeToTerrain_, terrain_type::terrain_with_default_base(), and try_merge_terrains().
Referenced by set_terrain().
void gamemap::clear_border_cache | ( | ) | [inline, protected] |
Clears the border cache, needed for the editor.
Definition at line 267 of file map.hpp.
References borderCache_.
Referenced by editormap::add_tiles_left(), and editormap::add_tiles_top().
int gamemap::num_starting_positions | ( | ) | const [inline, private] |
Definition at line 270 of file map.hpp.
References startingPositions_.
Referenced by is_starting_position(), num_valid_starting_positions(), and set_starting_position().
const t_translation::t_list gamemap::operator[] | ( | int | index | ) | const [inline, private] |
Allows lookup of terrain at a particular location.
Definition at line 274 of file map.hpp.
References border_size_, and tiles_.
bool gamemap::try_merge_terrains | ( | const t_translation::t_terrain | terrain | ) | [private] |
Tries to find out if "terrain" can be created by combining two existing terrains Will add the resulting terrain to the terrain list if successfull.
Definition at line 827 of file map.cpp.
References t_translation::t_terrain::base, t_translation::NO_LAYER, terrain_type::number(), t_translation::t_terrain::overlay, tcodeToTerrain_, and terrainList_.
Referenced by merge_terrains(), and read().
const std::string gamemap::default_map_header = "usage=map\nborder_size=1\n\n" [static] |
The default map header, needed for maps created with terrain_translation::write_game_map().
Definition at line 246 of file map.hpp.
Referenced by cave_map_generator::create_scenario(), map_editor::new_map(), and output_map().
const gamemap::tborder gamemap::default_border = gamemap::SINGLE_TILE_BORDER [static] |
The default border style for a map.
Definition at line 248 of file map.hpp.
Referenced by cave_map_generator::cave_map_generator(), map_editor::new_map_dialog(), and output_map().
t_translation::t_map gamemap::tiles_ [protected] |
Definition at line 259 of file map.hpp.
Referenced by editormap::add_tiles_bottom(), editormap::add_tiles_left(), editormap::add_tiles_right(), editormap::add_tiles_top(), editormap::flip(), get_terrain(), on_board(), operator[](), read(), editormap::remove_tiles_bottom(), editormap::remove_tiles_left(), editormap::remove_tiles_right(), editormap::remove_tiles_top(), set_terrain(), and write().
location gamemap::startingPositions_[MAX_PLAYERS+1] [protected] |
The size of the starting positions array is MAX_PLAYERS + 1, because the positions themselves are numbered from 1.
Definition at line 262 of file map.hpp.
Referenced by is_starting_position(), num_starting_positions(), overlay(), read(), editormap::resize(), editormap::set_starting_position(), set_starting_position(), starting_position(), and write().
t_translation::t_list gamemap::terrainList_ [private] |
Definition at line 281 of file map.hpp.
Referenced by gamemap(), get_terrain_list(), and try_merge_terrains().
Definition at line 282 of file map.hpp.
Referenced by gamemap(), get_terrain_info(), merge_terrains(), read(), try_merge_terrains(), underlying_def_terrain(), underlying_mvt_terrain(), and underlying_union_terrain().
std::vector<location> gamemap::villages_ [private] |
std::map<location, t_translation::t_terrain> gamemap::borderCache_ [mutable, private] |
Definition at line 285 of file map.hpp.
Referenced by clear_border_cache(), get_terrain(), and remove_from_border_cache().
std::map<t_translation::t_terrain, size_t> gamemap::terrainFrequencyCache_ [mutable, private] |
int gamemap::w_ [private] |
int gamemap::h_ [private] |
int gamemap::total_width_ [private] |
Sizes of the map including the borders.
Definition at line 293 of file map.hpp.
Referenced by read(), and total_width().
int gamemap::total_height_ [private] |
int gamemap::border_size_ [private] |
The size of the border around the map.
Definition at line 297 of file map.hpp.
Referenced by get_terrain(), on_board(), operator[](), overlay(), read(), set_terrain(), and write().
tusage gamemap::usage_ [private] |
The kind of map is being loaded.
Definition at line 299 of file map.hpp.
Referenced by get_usage(), read(), and write().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |