Stores a set of defense levels. More...
#include <movetype.hpp>
Public Member Functions | |
terrain_defense () | |
terrain_defense (const config &cfg) | |
int | defense (const t_translation::t_terrain &terrain) const |
Returns the defense associated with the given terrain. More... | |
bool | capped (const t_translation::t_terrain &terrain) const |
Returns whether there is a defense cap associated to this terrain. More... | |
void | merge (const config &new_data, bool overwrite) |
Merges the given config over the existing costs. More... | |
void | write (config &cfg, const std::string &child_name="") const |
Writes our data to a config, as a child if child_name is specified. More... | |
Private Attributes | |
terrain_info | min_ |
terrain_info | max_ |
Static Private Attributes | |
static const terrain_info::parameters | params_min_ |
static const terrain_info::parameters | params_max_ |
Stores a set of defense levels.
Definition at line 119 of file movetype.hpp.
|
inline |
Definition at line 125 of file movetype.hpp.
|
inlineexplicit |
Definition at line 126 of file movetype.hpp.
|
inline |
Returns whether there is a defense cap associated to this terrain.
Definition at line 134 of file movetype.hpp.
References min_, and movetype::terrain_info::value().
Referenced by movetype::has_terrain_defense_caps(), and help::unit_topic_generator::operator()().
|
inline |
Returns the defense associated with the given terrain.
Definition at line 131 of file movetype.hpp.
References max_, min_, and movetype::terrain_info::value().
Referenced by movetype::defense_modifier().
Merges the given config over the existing costs.
(Not overwriting implies adding.)
Definition at line 138 of file movetype.hpp.
References max_, movetype::terrain_info::merge(), and min_.
Referenced by unit::apply_builtin_effect(), and movetype::merge().
|
inline |
Writes our data to a config, as a child if child_name is specified.
(No child is created if there is no data.)
Definition at line 142 of file movetype.hpp.
References max_, and movetype::terrain_info::write().
Referenced by movetype::write().
|
private |
Definition at line 149 of file movetype.hpp.
|
private |
Definition at line 148 of file movetype.hpp.
|
staticprivate |
Definition at line 122 of file movetype.hpp.
|
staticprivate |
Definition at line 121 of file movetype.hpp.