Public Member Functions | Static Public Attributes | Private Attributes

unit_movement_type Class Reference

#include <unit_types.hpp>

Collaboration diagram for unit_movement_type:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 unit_movement_type (const config &cfg, const unit_movement_type *parent=NULL)
 unit_movement_type ()
std::string name () const
int movement_cost (const gamemap &map, t_translation::t_terrain terrain) const
int vision_cost (const gamemap &map, t_translation::t_terrain terrain) const
int defense_modifier (const gamemap &map, t_translation::t_terrain terrain) const
const defense_rangedefense_range_modifier (const gamemap &map, t_translation::t_terrain terrain) const
int damage_against (const attack_type &attack) const
int resistance_against (const attack_type &attack) const
utils::string_map damage_table () const
void set_parent (const unit_movement_type *parent)
bool is_flying () const
const configget_cfg () const
const unit_movement_typeget_parent () const

Static Public Attributes

static const int UNREACHABLE = 99

Private Attributes

std::map
< t_translation::t_terrain,
int > 
moveCosts_
std::map
< t_translation::t_terrain,
int > 
visionCosts_
std::map
< t_translation::t_terrain,
int > 
jammingCosts_
defense_cache defenseMods_
const unit_movement_typeparent_
config cfg_

Detailed Description

Definition at line 124 of file unit_types.hpp.


Constructor & Destructor Documentation

unit_movement_type::unit_movement_type ( const config cfg,
const unit_movement_type parent = NULL 
)

Definition at line 281 of file unit_types.cpp.

References config::add_child(), cfg_, config::child(), t_string::empty(), and name().

Here is the call graph for this function:

unit_movement_type::unit_movement_type (  ) 

Definition at line 317 of file unit_types.cpp.


Member Function Documentation

int unit_movement_type::damage_against ( const attack_type attack  )  const [inline]

Definition at line 146 of file unit_types.hpp.

References resistance_against().

Here is the call graph for this function:

utils::string_map unit_movement_type::damage_table (  )  const

Definition at line 348 of file unit_types.cpp.

References cfg_, config::child(), damage_table(), and parent_.

Referenced by damage_table(), and help::unit_topic_generator::operator()().

Here is the call graph for this function:

Here is the caller graph for this function:

int unit_movement_type::defense_modifier ( const gamemap map,
t_translation::t_terrain  terrain 
) const [inline]
const defense_range& unit_movement_type::defense_range_modifier ( const gamemap map,
t_translation::t_terrain  terrain 
) const [inline]

Definition at line 144 of file unit_types.hpp.

References cfg_, defense_range_modifier_internal(), defenseMods_, and parent_.

Referenced by defense_range_modifier_internal().

Here is the call graph for this function:

Here is the caller graph for this function:

const config& unit_movement_type::get_cfg (  )  const [inline]

Definition at line 155 of file unit_types.hpp.

References cfg_.

Referenced by unit::advance_to().

Here is the caller graph for this function:

const unit_movement_type* unit_movement_type::get_parent (  )  const [inline]

Definition at line 156 of file unit_types.hpp.

References parent_.

Referenced by unit::advance_to().

Here is the caller graph for this function:

bool unit_movement_type::is_flying (  )  const

Definition at line 364 of file unit_types.cpp.

References cfg_, config::has_attribute(), is_flying(), and parent_.

Referenced by unit::advance_to(), and is_flying().

Here is the call graph for this function:

Here is the caller graph for this function:

int unit_movement_type::movement_cost ( const gamemap map,
t_translation::t_terrain  terrain 
) const [inline]
std::string unit_movement_type::name (  )  const

Definition at line 320 of file unit_types.cpp.

References cfg_, config::has_attribute(), name(), and parent_.

Referenced by name(), unit_type_data::set_config(), and unit_movement_type().

Here is the call graph for this function:

Here is the caller graph for this function:

int unit_movement_type::resistance_against ( const attack_type attack  )  const
void unit_movement_type::set_parent ( const unit_movement_type parent  )  [inline]

Definition at line 151 of file unit_types.hpp.

References parent_.

Referenced by unit_type::build_full().

Here is the caller graph for this function:

int unit_movement_type::vision_cost ( const gamemap map,
t_translation::t_terrain  terrain 
) const [inline]

Definition at line 140 of file unit_types.hpp.

References cfg_, config::child(), movement_cost_internal(), parent_, and visionCosts_.

Here is the call graph for this function:


Member Data Documentation

Definition at line 162 of file unit_types.hpp.

Referenced by defense_modifier(), and defense_range_modifier().

Definition at line 160 of file unit_types.hpp.

std::map<t_translation::t_terrain, int> unit_movement_type::moveCosts_ [mutable, private]

Definition at line 158 of file unit_types.hpp.

Referenced by movement_cost().

const int unit_movement_type::UNREACHABLE = 99 [static]

Definition at line 159 of file unit_types.hpp.

Referenced by vision_cost().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:17:39 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs