The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
terrain_type Class Reference

#include <terrain.hpp>

Public Member Functions

 terrain_type ()
 
 terrain_type (const config &cfg)
 
 terrain_type (const terrain_type &base, const terrain_type &overlay)
 
const std::stringicon_image () const
 
const std::stringminimap_image () const
 
const std::stringminimap_image_overlay () const
 
const std::stringeditor_image () const
 
const t_stringname () const
 
const t_stringeditor_name () const
 
const t_stringdescription () const
 
const t_stringhelp_topic_text () const
 
const std::stringid () const
 
bool hide_help () const
 
bool hide_in_editor () const
 
t_translation::t_terrain number () const
 
const t_translation::t_listmvt_type () const
 
const t_translation::t_listdef_type () const
 
const t_translation::t_listvision_type () const
 
const t_translation::t_listunion_type () const
 
bool is_nonnull () const
 
int light_bonus (int base) const
 Returns the light (lawful) bonus for this terrain when the time of day gives a base bonus. More...
 
int unit_height_adjust () const
 
double unit_submerge () const
 
int gives_healing () const
 
bool is_village () const
 
bool is_castle () const
 
bool is_keep () const
 
const t_stringincome_description () const
 
const t_stringincome_description_ally () const
 
const t_stringincome_description_enemy () const
 
const t_stringincome_description_own () const
 
const std::stringeditor_group () const
 
void set_editor_group (const std::string &str)
 
bool is_overlay () const
 
bool is_combined () const
 
t_translation::t_terrain default_base () const
 
t_translation::t_terrain terrain_with_default_base () const
 
bool operator== (const terrain_type &other) const
 

Private Attributes

std::string icon_image_
 The image used as symbol icon. More...
 
std::string minimap_image_
 The image used in the minimap. More...
 
std::string minimap_image_overlay_
 
std::string editor_image_
 The image used in the editor palette if not defined in WML it will be initialized with the value of minimap_image_. More...
 
std::string id_
 
t_string name_
 
t_string editor_name_
 
t_string description_
 
t_string help_topic_text_
 
t_translation::t_terrain number_
 
t_translation::t_list mvt_type_
 
t_translation::t_list vision_type_
 
t_translation::t_list def_type_
 
t_translation::t_list union_type_
 
int height_adjust_
 
bool height_adjust_set_
 
double submerge_
 
bool submerge_set_
 
int light_modification_
 
int max_light_
 
int min_light_
 
int heals_
 
t_string income_description_
 
t_string income_description_ally_
 
t_string income_description_enemy_
 
t_string income_description_own_
 
std::string editor_group_
 
bool village_
 
bool castle_
 
bool keep_
 
bool overlay_
 
bool combined_
 
t_translation::t_terrain editor_default_base_
 
bool hide_help_
 
bool hide_in_editor_
 

Detailed Description

Definition at line 21 of file terrain.hpp.

Constructor & Destructor Documentation

terrain_type::terrain_type ( )

Definition at line 31 of file terrain.cpp.

terrain_type::terrain_type ( const config cfg)
Todo:
reenable these validations. The problem is that all MP scenarios/campaigns share the same namespace and one rogue scenario can avoid the player to create a MP game. So every scenario/campaign should get its own namespace to be safe.

Definition at line 68 of file terrain.cpp.

References _(), def_type_, editor_image_, t_string::empty(), hide_in_editor_, income_description_, income_description_ally_, income_description_enemy_, income_description_own_, minimap_image_, t_translation::MINUS, missing_mandatory_wml_key(), mvt_type_, name_, t_translation::NONE_TERRAIN, number_, t_translation::PLUS, t_translation::read_list(), schema_validation::remove, sort(), union_type_, VALIDATE, village_, vision_type_, and t_translation::write_terrain_code().

terrain_type::terrain_type ( const terrain_type base,
const terrain_type overlay 
)

Member Function Documentation

const t_translation::t_list& terrain_type::def_type ( ) const
inline

Definition at line 47 of file terrain.hpp.

References def_type_.

t_translation::t_terrain terrain_type::default_base ( ) const
inline
const t_string& terrain_type::description ( ) const
inline
const std::string& terrain_type::editor_group ( ) const
inline
const std::string& terrain_type::editor_image ( ) const
inline
const t_string& terrain_type::editor_name ( ) const
inline
int terrain_type::gives_healing ( ) const
inline
const t_string& terrain_type::help_topic_text ( ) const
inline

Definition at line 36 of file terrain.hpp.

References help_topic_text_.

Referenced by help::terrain_topic_generator::operator()().

bool terrain_type::hide_help ( ) const
inline

Definition at line 39 of file terrain.hpp.

References hide_help_.

Referenced by help::generate_terrain_sections(), and help::terrain_topic_generator::operator()().

bool terrain_type::hide_in_editor ( ) const
inline
const std::string& terrain_type::icon_image ( ) const
inline
const std::string& terrain_type::id ( ) const
inline
const t_string& terrain_type::income_description ( ) const
inline

Definition at line 68 of file terrain.hpp.

References income_description_.

Referenced by help::terrain_topic_generator::operator()(), and REPORT_GENERATOR().

const t_string& terrain_type::income_description_ally ( ) const
inline

Definition at line 69 of file terrain.hpp.

References income_description_ally_.

Referenced by REPORT_GENERATOR().

const t_string& terrain_type::income_description_enemy ( ) const
inline

Definition at line 70 of file terrain.hpp.

References income_description_enemy_.

Referenced by REPORT_GENERATOR().

const t_string& terrain_type::income_description_own ( ) const
inline

Definition at line 71 of file terrain.hpp.

References income_description_own_.

Referenced by REPORT_GENERATOR().

bool terrain_type::is_castle ( ) const
inline
bool terrain_type::is_combined ( ) const
inline
bool terrain_type::is_keep ( ) const
inline
bool terrain_type::is_nonnull ( ) const
inline
bool terrain_type::is_overlay ( ) const
inline

Definition at line 76 of file terrain.hpp.

References overlay_.

Referenced by help::generate_terrain_sections(), and help::terrain_topic_generator::operator()().

bool terrain_type::is_village ( ) const
inline
int terrain_type::light_bonus ( int  base) const
inline

Returns the light (lawful) bonus for this terrain when the time of day gives a base bonus.

Definition at line 55 of file terrain.hpp.

References bounded_add(), light_modification_, max_light_, and min_light_.

Referenced by tod_manager::get_illuminated_time_of_day(), terrain_callable::get_value(), game_lua_kernel::intf_get_terrain_info(), and help::terrain_topic_generator::operator()().

const std::string& terrain_type::minimap_image ( ) const
inline

Definition at line 30 of file terrain.hpp.

References minimap_image_.

Referenced by image::getMinimap(), and terrain_builder::rebuild_terrain().

const std::string& terrain_type::minimap_image_overlay ( ) const
inline

Definition at line 31 of file terrain.hpp.

References minimap_image_overlay_.

Referenced by image::getMinimap(), and terrain_builder::rebuild_terrain().

const t_translation::t_list& terrain_type::mvt_type ( ) const
inline

Definition at line 46 of file terrain.hpp.

References mvt_type_.

const t_string& terrain_type::name ( ) const
inline
t_translation::t_terrain terrain_type::number ( ) const
inline
bool terrain_type::operator== ( const terrain_type other) const
void terrain_type::set_editor_group ( const std::string str)
inline

Definition at line 74 of file terrain.hpp.

References editor_group_.

Referenced by create_terrain_maps().

t_translation::t_terrain terrain_type::terrain_with_default_base ( ) const
const t_translation::t_list& terrain_type::union_type ( ) const
inline
int terrain_type::unit_height_adjust ( ) const
inline

Definition at line 58 of file terrain.hpp.

References height_adjust_.

Referenced by unit_animation_component::invalidate(), and unit_drawer::redraw_unit().

double terrain_type::unit_submerge ( ) const
inline

Definition at line 59 of file terrain.hpp.

References submerge_.

Referenced by unit_drawer::redraw_unit().

const t_translation::t_list& terrain_type::vision_type ( ) const
inline

Definition at line 48 of file terrain.hpp.

References vision_type_.

Member Data Documentation

bool terrain_type::castle_
private

Definition at line 131 of file terrain.hpp.

Referenced by is_castle(), and operator==().

bool terrain_type::combined_
private

Definition at line 133 of file terrain.hpp.

Referenced by is_combined().

t_translation::t_list terrain_type::def_type_
private

Definition at line 110 of file terrain.hpp.

Referenced by def_type(), and terrain_type().

t_string terrain_type::description_
private

Definition at line 100 of file terrain.hpp.

Referenced by description(), and terrain_type().

t_translation::t_terrain terrain_type::editor_default_base_
private

Definition at line 134 of file terrain.hpp.

Referenced by default_base(), operator==(), and terrain_with_default_base().

std::string terrain_type::editor_group_
private

Definition at line 129 of file terrain.hpp.

Referenced by editor_group(), and set_editor_group().

std::string terrain_type::editor_image_
private

The image used in the editor palette if not defined in WML it will be initialized with the value of minimap_image_.

Definition at line 96 of file terrain.hpp.

Referenced by editor_image(), operator==(), and terrain_type().

t_string terrain_type::editor_name_
private

Definition at line 99 of file terrain.hpp.

Referenced by editor_name(), and operator==().

int terrain_type::heals_
private

Definition at line 122 of file terrain.hpp.

Referenced by gives_healing(), and operator==().

int terrain_type::height_adjust_
private

Definition at line 113 of file terrain.hpp.

Referenced by operator==(), terrain_type(), and unit_height_adjust().

bool terrain_type::height_adjust_set_
private

Definition at line 114 of file terrain.hpp.

Referenced by operator==(), and terrain_type().

t_string terrain_type::help_topic_text_
private

Definition at line 101 of file terrain.hpp.

Referenced by help_topic_text().

bool terrain_type::hide_help_
private

Definition at line 135 of file terrain.hpp.

Referenced by hide_help(), and operator==().

bool terrain_type::hide_in_editor_
private

Definition at line 135 of file terrain.hpp.

Referenced by hide_in_editor(), operator==(), and terrain_type().

std::string terrain_type::icon_image_
private

The image used as symbol icon.

Definition at line 86 of file terrain.hpp.

Referenced by icon_image().

std::string terrain_type::id_
private

Definition at line 97 of file terrain.hpp.

Referenced by id(), and operator==().

t_string terrain_type::income_description_
private

Definition at line 124 of file terrain.hpp.

Referenced by income_description(), and terrain_type().

t_string terrain_type::income_description_ally_
private

Definition at line 125 of file terrain.hpp.

Referenced by income_description_ally(), and terrain_type().

t_string terrain_type::income_description_enemy_
private

Definition at line 126 of file terrain.hpp.

Referenced by income_description_enemy(), and terrain_type().

t_string terrain_type::income_description_own_
private

Definition at line 127 of file terrain.hpp.

Referenced by income_description_own(), and terrain_type().

bool terrain_type::keep_
private

Definition at line 131 of file terrain.hpp.

Referenced by is_keep(), and operator==().

int terrain_type::light_modification_
private

Definition at line 119 of file terrain.hpp.

Referenced by light_bonus(), and operator==().

int terrain_type::max_light_
private

Definition at line 120 of file terrain.hpp.

Referenced by light_bonus(), and operator==().

int terrain_type::min_light_
private

Definition at line 121 of file terrain.hpp.

Referenced by light_bonus(), and operator==().

std::string terrain_type::minimap_image_
private

The image used in the minimap.

Definition at line 89 of file terrain.hpp.

Referenced by minimap_image(), operator==(), and terrain_type().

std::string terrain_type::minimap_image_overlay_
private

Definition at line 90 of file terrain.hpp.

Referenced by minimap_image_overlay(), and operator==().

t_translation::t_list terrain_type::mvt_type_
private

Definition at line 108 of file terrain.hpp.

Referenced by mvt_type(), and terrain_type().

t_string terrain_type::name_
private

Definition at line 98 of file terrain.hpp.

Referenced by description(), name(), operator==(), and terrain_type().

t_translation::t_terrain terrain_type::number_
private

Definition at line 107 of file terrain.hpp.

Referenced by is_nonnull(), number(), operator==(), terrain_type(), and terrain_with_default_base().

bool terrain_type::overlay_
private

Definition at line 133 of file terrain.hpp.

Referenced by is_overlay(), and terrain_with_default_base().

double terrain_type::submerge_
private

Definition at line 116 of file terrain.hpp.

Referenced by operator==(), terrain_type(), and unit_submerge().

bool terrain_type::submerge_set_
private

Definition at line 117 of file terrain.hpp.

Referenced by operator==(), and terrain_type().

t_translation::t_list terrain_type::union_type_
private

Definition at line 111 of file terrain.hpp.

Referenced by terrain_type(), and union_type().

bool terrain_type::village_
private

Definition at line 131 of file terrain.hpp.

Referenced by is_village(), operator==(), and terrain_type().

t_translation::t_list terrain_type::vision_type_
private

Definition at line 109 of file terrain.hpp.

Referenced by terrain_type(), and vision_type().


The documentation for this class was generated from the following files: