#include <unit_types.hpp>
Public Member Functions | |
unit_movement_type (const config &cfg, const unit_movement_type *parent=NULL) | |
unit_movement_type () | |
const t_string & | name () const |
int | movement_cost (const gamemap &map, t_translation::t_terrain terrain, int recurse_count=0) const |
int | defense_modifier (const gamemap &map, t_translation::t_terrain terrain, int recurse_count=0) const |
int | damage_against (const attack_type &attack) const |
int | resistance_against (const attack_type &attack) const |
string_map | damage_table () const |
void | set_parent (const unit_movement_type *parent) |
bool | is_flying () const |
const std::map < t_translation::t_terrain, int > & | movement_costs () const |
const std::map < t_translation::t_terrain, int > & | defense_mods () const |
const config & | get_cfg () const |
const unit_movement_type * | get_parent () const |
Private Attributes | |
std::map < t_translation::t_terrain, int > | moveCosts_ |
std::map < t_translation::t_terrain, int > | defenseMods_ |
const unit_movement_type * | parent_ |
config | cfg_ |
Definition at line 114 of file unit_types.hpp.
unit_movement_type::unit_movement_type | ( | const config & | cfg, | |
const unit_movement_type * | parent = NULL | |||
) |
Definition at line 283 of file unit_types.cpp.
References config::add_child(), cfg_, config::child(), t_string::empty(), movement_costs(), and name().
unit_movement_type::unit_movement_type | ( | ) |
Definition at line 310 of file unit_types.cpp.
const t_string & unit_movement_type::name | ( | ) | const |
Definition at line 313 of file unit_types.cpp.
References cfg_, config::get_attribute(), name(), and parent_.
Referenced by name(), unit_type_data::unit_type_map_wrapper::set_config(), and unit_movement_type().
int unit_movement_type::movement_cost | ( | const gamemap & | map, | |
t_translation::t_terrain | terrain, | |||
int | recurse_count = 0 | |||
) | const |
Definition at line 322 of file unit_types.cpp.
References cfg_, config::child(), lg::err, gamemap::get_terrain_info(), LOG_STREAM, t_translation::MINUS, moveCosts_, movement_cost(), movement_costs(), parent_, t_translation::PLUS, gamemap::underlying_mvt_terrain(), and value.
Referenced by ai::average_resistance_against(), movement_cost(), and help::unit_topic_generator::operator()().
int unit_movement_type::defense_modifier | ( | const gamemap & | map, | |
t_translation::t_terrain | terrain, | |||
int | recurse_count = 0 | |||
) | const |
Definition at line 400 of file unit_types.cpp.
References cfg_, config::child(), defense_modifier(), defenseMods_, lg::err, ERR_CONFIG, gamemap::get_terrain_info(), LOG_STREAM, t_translation::MINUS, parent_, t_translation::PLUS, gamemap::underlying_def_terrain(), and value.
Referenced by ai::average_resistance_against(), defense_modifier(), and help::unit_topic_generator::operator()().
int unit_movement_type::damage_against | ( | const attack_type & | attack | ) | const [inline] |
int unit_movement_type::resistance_against | ( | const attack_type & | attack | ) | const |
Definition at line 478 of file unit_types.cpp.
References cfg_, config::child(), parent_, resistance_against(), and attack_type::type().
Referenced by ai::average_resistance_against(), damage_against(), and resistance_against().
string_map unit_movement_type::damage_table | ( | ) | const |
Definition at line 499 of file unit_types.cpp.
References cfg_, config::child(), damage_table(), parent_, and config::values.
Referenced by damage_table(), and help::unit_topic_generator::operator()().
void unit_movement_type::set_parent | ( | const unit_movement_type * | parent | ) | [inline] |
Definition at line 130 of file unit_types.hpp.
References parent_.
Referenced by unit_type::build_full().
bool unit_movement_type::is_flying | ( | ) | const |
Definition at line 515 of file unit_types.cpp.
References cfg_, is_flying(), parent_, and utils::string_bool().
Referenced by unit::advance_to(), and is_flying().
const std::map<t_translation::t_terrain, int>& unit_movement_type::movement_costs | ( | ) | const [inline] |
Definition at line 133 of file unit_types.hpp.
References moveCosts_.
Referenced by movement_cost(), and unit_movement_type().
const std::map<t_translation::t_terrain, int>& unit_movement_type::defense_mods | ( | ) | const [inline] |
const config& unit_movement_type::get_cfg | ( | ) | const [inline] |
const unit_movement_type* unit_movement_type::get_parent | ( | ) | const [inline] |
Definition at line 137 of file unit_types.hpp.
References parent_.
Referenced by unit::advance_to().
std::map<t_translation::t_terrain, int> unit_movement_type::moveCosts_ [mutable, private] |
std::map<t_translation::t_terrain, int> unit_movement_type::defenseMods_ [mutable, private] |
Definition at line 140 of file unit_types.hpp.
Referenced by defense_modifier(), and defense_mods().
const unit_movement_type* unit_movement_type::parent_ [private] |
Definition at line 142 of file unit_types.hpp.
Referenced by damage_table(), defense_modifier(), get_parent(), is_flying(), movement_cost(), name(), resistance_against(), and set_parent().
config unit_movement_type::cfg_ [private] |
Definition at line 144 of file unit_types.hpp.
Referenced by damage_table(), defense_modifier(), get_cfg(), is_flying(), movement_cost(), name(), resistance_against(), and unit_movement_type().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |