The Battle for Wesnoth  1.15.5+dev
Enumerator | Functions | Variables | Friends
Ability functions

Functions

static std::string unit::upkeep_full::type ()
 
static std::string unit::upkeep_loyal::type ()
 
 unit::upkeep_value_visitor::upkeep_value_visitor (const unit &unit)
 
int unit::upkeep_value_visitor::operator() (const upkeep_full &) const
 Full upkeep equals the unit's level. More...
 
int unit::upkeep_value_visitor::operator() (const upkeep_loyal &) const
 Loyal units cost no upkeep. More...
 
int unit::upkeep_value_visitor::operator() (int v) const
 
template<typename T >
std::enable_if_t<!std::is_same< int, T >::value, std::string > unit::upkeep_type_visitor::operator() (T &) const
 
std::string unit::upkeep_type_visitor::operator() (int v) const
 
template<typename N >
std::enable_if_t< std::is_arithmetic< N >::value, upkeep_tunit::upkeep_parser_visitor::operator() (N n) const
 
template<typename B >
std::enable_if_t< std::is_convertible< B, bool >::value &&!std::is_arithmetic< B >::value, upkeep_tunit::upkeep_parser_visitor::operator() (B b) const
 
upkeep_t unit::upkeep_parser_visitor::operator() (boost::blank) const
 
upkeep_t unit::upkeep_parser_visitor::operator() (const std::string &s) const
 
bool unit::get_ability_bool (const std::string &tag_name, const map_location &loc) const
 Checks whether this unit currently possesses or is affected by a given ability. More...
 
bool unit::get_ability_bool (const std::string &tag_name) const
 Checks whether this unit currently possesses or is affected by a given ability. More...
 
unit_ability_list unit::get_abilities (const std::string &tag_name, const map_location &loc) const
 Gets the unit's active abilities of a particular type if it were on a specified location. More...
 
unit_ability_list unit::get_abilities (const std::string &tag_name) const
 Gets the unit's active abilities of a particular type. More...
 
unit_ability_list unit::get_abilities_weapons (const std::string &tag_name, const map_location &loc, const_attack_ptr weapon=nullptr, const_attack_ptr opp_weapon=nullptr) const
 
unit_ability_list unit::get_abilities_weapons (const std::string &tag_name, const_attack_ptr weapon=nullptr, const_attack_ptr opp_weapon=nullptr) const
 
std::vector< std::tuple< std::string, t_string, t_string, t_string > > unit::ability_tooltips () const
 Gets the names and descriptions of this unit's abilities. More...
 
std::vector< std::tuple< std::string, t_string, t_string, t_string > > unit::ability_tooltips (boost::dynamic_bitset<> &active_list, const map_location &loc) const
 Gets the names and descriptions of this unit's abilities. More...
 
std::vector< std::string > unit::get_ability_list () const
 Get a list of all abilities by ID. More...
 
bool unit::has_ability_type (const std::string &ability) const
 Check if the unit has an ability of a specific type. More...
 
bool unit::has_ability_by_id (const std::string &ability) const
 Check if the unit has an ability of a specific ID. More...
 
void unit::remove_ability_by_id (const std::string &ability)
 Removes a unit's abilities with a specific ID. More...
 
bool unit::ability_active (const std::string &ability, const config &cfg, const map_location &loc) const
 Check if an ability is active. More...
 
bool unit::ability_affects_adjacent (const std::string &ability, const config &cfg, int dir, const map_location &loc, const unit &from) const
 Check if an ability affects adjacent units. More...
 
bool unit::ability_affects_self (const std::string &ability, const config &cfg, const map_location &loc) const
 Check if an ability affects the owning unit. More...
 
bool unit::ability_affects_weapon (const config &cfg, const_attack_ptr weapon, bool is_opp) const
 filters the weapons that condition the use of abilities for combat ([resistance],[leadership] or abilities used like specials(deprecated in two last cases) More...
 
unit_formula_managerunit::formula_manager () const
 Get the unit formula manager. More...
 
void unit::generate_name ()
 Generates a random race-appropriate name if one has not already been provided. More...
 
bool unit::invisible (const map_location &loc, bool see_all=true) const
 
bool unit::is_visible_to_team (const team &team, bool const see_all=true) const
 
bool unit::is_visible_to_team (const map_location &loc, const team &team, bool const see_all=true) const
 Return true if the unit would be visible to team if its location were loc. More...
 
void unit::write (config &cfg, bool write_all=true) const
 Serializes the current unit metadata values. More...
 
unitunit::mark_clone (bool is_temporary)
 Mark this unit as clone so it can be inserted to unit_map. More...
 
void unit::set_appearance_changed (bool value)
 
bool unit::appearance_changed () const
 
void unit::parse_upkeep (const config::attribute_value &upkeep)
 
void unit::write_upkeep (config::attribute_value &upkeep) const
 
void unit::clear_visibility_cache () const
 Clears the cache. More...
 
 unit_movement_resetter::unit_movement_resetter (const unit_movement_resetter &)=delete
 
unit_movement_resetterunit_movement_resetter::operator= (const unit_movement_resetter &)=delete
 
 unit_movement_resetter::unit_movement_resetter (const unit &u, bool operate=true)
 
 unit_movement_resetter::~unit_movement_resetter ()
 

Variables

const unitunit::upkeep_value_visitor::u_
 
map_location unit::loc_
 
std::vector< std::string > unit::advances_to_
 
const unit_typeunit::type_
 Never nullptr. More...
 
t_string unit::type_name_
 The displayed name of this unit type. More...
 
const unit_raceunit::race_
 Never nullptr, but may point to the null race. More...
 
std::string unit::id_
 
t_string unit::name_
 
n_unit::unit_id unit::underlying_id_
 
std::string unit::undead_variation_
 
std::string unit::variation_
 
int unit::hit_points_
 
int unit::max_hit_points_
 
int unit::experience_
 
int unit::max_experience_
 
int unit::level_
 
int unit::recall_cost_
 
bool unit::canrecruit_
 
std::vector< std::string > unit::recruit_list_
 
UNIT_ALIGNMENT unit::alignment_
 
std::string unit::flag_rgb_
 
std::string unit::image_mods_
 
bool unit::unrenamable_
 
int unit::side_
 
unit_race::GENDER unit::gender_
 
std::unique_ptr< unit_formula_managerunit::formula_man_
 
int unit::movement_
 
int unit::max_movement_
 
int unit::vision_
 
int unit::jamming_
 
movetype unit::movement_type_
 
bool unit::hold_position_
 
bool unit::end_turn_
 
bool unit::resting_
 
int unit::attacks_left_
 
int unit::max_attacks_
 
std::set< std::string > unit::states_
 
static const std::size_t unit::num_bool_states = 7
 
std::bitset< num_bool_statesunit::known_boolean_states_
 
static std::map< std::string, state_tunit::known_boolean_state_names_
 
config unit::variables_
 
config unit::events_
 
config unit::filter_recall_
 
bool unit::emit_zoc_
 
std::vector< std::string > unit::overlays_
 
std::string unit::role_
 
attack_list unit::attacks_
 
map_location::DIRECTION unit::facing_
 
std::vector< t_stringunit::trait_names_
 
std::vector< t_stringunit::trait_descriptions_
 
int unit::unit_value_
 
map_location unit::goto_
 
map_location unit::interrupted_move_
 
bool unit::is_fearless_
 
bool unit::is_healthy_
 
utils::string_map unit::modification_descriptions_
 
std::unique_ptr< unit_animation_componentunit::anim_comp_
 
bool unit::hidden_
 
double unit::hp_bar_scaling_
 
double unit::xp_bar_scaling_
 
config unit::modifications_
 
config unit::abilities_
 
advancements_list unit::advancements_
 
t_string unit::description_
 
std::vector< t_stringunit::special_notes_
 
std::unique_ptr< std::string > unit::usage_
 
std::unique_ptr< std::string > unit::halo_
 
std::unique_ptr< std::string > unit::ellipse_
 
bool unit::random_traits_
 
bool unit::generate_name_
 
upkeep_t unit::upkeep_
 
std::string unit::profile_
 
std::string unit::small_profile_
 
bool unit::appearance_changed_ = true
 
std::bitset< UA_COUNTunit::changed_attributes_
 
std::map< map_location, bool > unit::invisibility_cache_
 Hold the visibility status cache for a unit, when not uncovered. More...
 
unitunit_movement_resetter::u_
 
int unit_movement_resetter::moves_
 

Friends

class unit::unit_animation_component
 

Detailed Description

Function Documentation

◆ ability_active()

bool unit::ability_active ( const std::string &  ability,
const config cfg,
const map_location loc 
) const
private

Check if an ability is active.

Parameters
abilityThe type (tag name) of the ability
cfgan ability WML structure
locThe location on which to resolve the ability
Returns
true if it is active

Definition at line 351 of file abilities.cpp.

References config::child(), config::child_range(), unit_map::end(), resources::filter_con, unit_map::find(), get_adjacent_tiles(), filter_context::get_disp_context(), display::get_singleton(), display_context::get_team(), display::get_units(), i, utf8::index(), unit_filter::matches(), map_location::NDIRECTIONS, map_location::parse_directions(), utils::parse_ranges(), unit_filter::set_use_flat_tod(), and str.

◆ ability_affects_adjacent()

bool unit::ability_affects_adjacent ( const std::string &  ability,
const config cfg,
int  dir,
const map_location loc,
const unit from 
) const
private

Check if an ability affects adjacent units.

Parameters
abilityThe type (tag name) of the ability
cfgan ability WML structure
locThe location on which to resolve the ability
fromThe "other unit" for filter matching

Definition at line 423 of file abilities.cpp.

References config::child_range(), gui2::event::find(), i, and map_location::parse_directions().

◆ ability_affects_self()

bool unit::ability_affects_self ( const std::string &  ability,
const config cfg,
const map_location loc 
) const
private

Check if an ability affects the owning unit.

Parameters
abilityThe type (tag name) of the ability
cfgan ability WML structure
locThe location on which to resolve the ability

Definition at line 447 of file abilities.cpp.

References config::child(), unit_filter::matches(), and unit_filter::set_use_flat_tod().

◆ ability_affects_weapon()

bool unit::ability_affects_weapon ( const config cfg,
const_attack_ptr  weapon,
bool  is_opp 
) const
private

filters the weapons that condition the use of abilities for combat ([resistance],[leadership] or abilities used like specials(deprecated in two last cases)

Definition at line 455 of file abilities.cpp.

References config::child(), config::has_child(), and mariadb::value::string.

◆ ability_tooltips() [1/2]

std::vector< std::tuple< std::string, t_string, t_string, t_string > > unit::ability_tooltips ( ) const

Gets the names and descriptions of this unit's abilities.

Location-independent variant with all abilities shown as active.

Returns
A list of quadruples consisting of (in order) id, base name, male or female name as appropriate for the unit, and description.

Definition at line 323 of file abilities.cpp.

Referenced by gui2::unit_preview_pane::set_displayed_unit(), and unit_abilities().

◆ ability_tooltips() [2/2]

std::vector< std::tuple< std::string, t_string, t_string, t_string > > unit::ability_tooltips ( boost::dynamic_bitset<> &  active_list,
const map_location loc 
) const

Gets the names and descriptions of this unit's abilities.

Parameters
active_listThis vector will be the same length as the returned one and will indicate whether or not the corresponding ability is active.
locThe location on which to resolve the ability.
Returns
A list of quadruples consisting of (in order) id, base name, male or female name as appropriate for the unit, and description.

Definition at line 335 of file abilities.cpp.

◆ appearance_changed()

bool unit::appearance_changed ( ) const
inline

Definition at line 1784 of file unit.hpp.

◆ clear_visibility_cache()

void unit::clear_visibility_cache ( ) const
inlineprivate

Clears the cache.

Since we don't change the state of the object we're marked const (also required since the objects in the cache need to be marked const).

Definition at line 1927 of file unit.hpp.

References swap().

◆ formula_manager()

unit_formula_manager& unit::formula_manager ( ) const
inline

Get the unit formula manager.

Definition at line 1752 of file unit.hpp.

References write().

Referenced by wfl::unit_callable::get_value().

◆ generate_name()

void unit::generate_name ( )

Generates a random race-appropriate name if one has not already been provided.

Definition at line 805 of file unit.cpp.

References t_string::empty(), unit::gender_, unit_race::generate_name(), unit::generate_name_, unit::name_, and unit::race_.

Referenced by unit::init().

◆ get_abilities() [1/2]

unit_ability_list unit::get_abilities ( const std::string &  tag_name,
const map_location loc 
) const

Gets the unit's active abilities of a particular type if it were on a specified location.

Parameters
tag_nameThe type of ability to check for
locThe location to use for resolving abilities
Returns
A list of active abilities, paired with the location they are active on

Definition at line 184 of file abilities.cpp.

References unit_ability_list::emplace_back(), unit_map::end(), unit_map::find(), get_adjacent_tiles(), display::get_singleton(), display::get_units(), i, and loc_.

Referenced by unit::defense_modifier(), pathfind::get_teleport_locations(), and unit_display::reset_helpers().

◆ get_abilities() [2/2]

unit_ability_list unit::get_abilities ( const std::string &  tag_name) const
inline

Gets the unit's active abilities of a particular type.

Parameters
tag_nameThe type of ability to check for
Returns
A list of active abilities, paired with the location they are active on

Definition at line 1660 of file unit.hpp.

References loc_, and mariadb::value::string.

◆ get_abilities_weapons() [1/2]

unit_ability_list unit::get_abilities_weapons ( const std::string &  tag_name,
const map_location loc,
const_attack_ptr  weapon = nullptr,
const_attack_ptr  opp_weapon = nullptr 
) const

◆ get_abilities_weapons() [2/2]

unit_ability_list unit::get_abilities_weapons ( const std::string &  tag_name,
const_attack_ptr  weapon = nullptr,
const_attack_ptr  opp_weapon = nullptr 
) const
inline

Definition at line 1667 of file unit.hpp.

References loc_, and mariadb::value::string.

◆ get_ability_bool() [1/2]

bool unit::get_ability_bool ( const std::string &  tag_name,
const map_location loc 
) const

Checks whether this unit currently possesses or is affected by a given ability.

This means that the ability could be owned by this unit itself or by an adjacent unit, should the ability affect an AoE in which this unit happens to be.

Parameters
tag_nameThe name of the ability to check for.
locThe location around which to check for affected units. This may or may not be the location of this unit.

Definition at line 144 of file abilities.cpp.

References unit_map::end(), unit_map::find(), get_adjacent_tiles(), display::get_singleton(), display::get_units(), and i.

Referenced by pathfind::shortest_path_calculator::cost(), ai::ai_default_rca::get_healing_phase::evaluate(), pathfind::find_routes(), game_lua_kernel::intf_unit_ability(), unit::invisible(), pathfind::mark_route(), ai::ai_default_rca::aspect_attacks_base::rate_terrain(), and ai::default_ai_context_impl::rate_terrain().

◆ get_ability_bool() [2/2]

bool unit::get_ability_bool ( const std::string &  tag_name) const
inline

Checks whether this unit currently possesses or is affected by a given ability.

This means that the ability could be owned by this unit itself or by an adjacent unit, should the ability affect an AoE in which this unit happens to be.

This overload uses the location of this unit for calculations.

Parameters
tag_nameThe name of the ability to check for.

Definition at line 1642 of file unit.hpp.

References loc_, and mariadb::value::string.

◆ get_ability_list()

std::vector< std::string > unit::get_ability_list ( ) const

◆ has_ability_by_id()

bool unit::has_ability_by_id ( const std::string &  ability) const

Check if the unit has an ability of a specific ID.

Parameters
abilityThe ID of ability to check for.
Returns
true if the ability is present

Definition at line 1394 of file unit.cpp.

References unit::abilities_, and config::all_children_range().

Referenced by unit::apply_builtin_effect().

◆ has_ability_type()

bool unit::has_ability_type ( const std::string &  ability) const

Check if the unit has an ability of a specific type.

Parameters
abilityThe type of ability (tag name) to check for.
Returns
true if the ability is present

Definition at line 468 of file abilities.cpp.

◆ invisible()

bool unit::invisible ( const map_location loc,
bool  see_all = true 
) const

◆ is_visible_to_team() [1/2]

bool unit::is_visible_to_team ( const team team,
bool const  see_all = true 
) const

◆ is_visible_to_team() [2/2]

bool unit::is_visible_to_team ( const map_location loc,
const team team,
bool const  see_all = true 
) const

Return true if the unit would be visible to team if its location were loc.

Definition at line 2481 of file unit.cpp.

References team::fogged(), display::get_singleton(), unit::invisible(), team::is_enemy(), n_unit::unit_id::is_fake(), team::side(), unit::side(), and unit::underlying_id_.

◆ mark_clone()

unit & unit::mark_clone ( bool  is_temporary)

◆ operator()() [1/9]

int unit::upkeep_value_visitor::operator() ( const upkeep_full ) const
inline

Full upkeep equals the unit's level.

Definition at line 1139 of file unit.hpp.

◆ operator()() [2/9]

int unit::upkeep_value_visitor::operator() ( const upkeep_loyal ) const
inline

Loyal units cost no upkeep.

Definition at line 1145 of file unit.hpp.

◆ operator()() [3/9]

int unit::upkeep_value_visitor::operator() ( int  v) const
inline

Definition at line 1150 of file unit.hpp.

◆ operator()() [4/9]

template<typename T >
std::enable_if_t<!std::is_same<int, T>::value, std::string> unit::upkeep_type_visitor::operator() ( T &  ) const
inline

Definition at line 1164 of file unit.hpp.

◆ operator()() [5/9]

std::string unit::upkeep_type_visitor::operator() ( int  v) const
inline

Definition at line 1170 of file unit.hpp.

◆ operator()() [6/9]

template<typename N >
std::enable_if_t<std::is_arithmetic<N>::value, upkeep_t> unit::upkeep_parser_visitor::operator() ( n) const
inline

Definition at line 1184 of file unit.hpp.

References n.

◆ operator()() [7/9]

template<typename B >
std::enable_if_t<std::is_convertible<B, bool>::value && !std::is_arithmetic<B>::value, upkeep_t> unit::upkeep_parser_visitor::operator() ( b) const
inline

Definition at line 1193 of file unit.hpp.

◆ operator()() [8/9]

upkeep_t unit::upkeep_parser_visitor::operator() ( boost::blank  ) const
inline

Definition at line 1198 of file unit.hpp.

◆ operator()() [9/9]

upkeep_t unit::upkeep_parser_visitor::operator() ( const std::string &  s) const
inline

Definition at line 1203 of file unit.hpp.

◆ operator=()

unit_movement_resetter& unit_movement_resetter::operator= ( const unit_movement_resetter )
delete

◆ parse_upkeep()

void unit::parse_upkeep ( const config::attribute_value upkeep)
private

◆ remove_ability_by_id()

void unit::remove_ability_by_id ( const std::string &  ability)

Removes a unit's abilities with a specific ID.

Parameters
abilityThe type of ability (tag name) to remove.

Definition at line 1405 of file unit.cpp.

References unit::abilities_, config::erase(), i, config::ordered_begin(), config::ordered_end(), unit::set_attr_changed(), and unit::UA_ABILITIES.

Referenced by unit::apply_builtin_effect().

◆ set_appearance_changed()

void unit::set_appearance_changed ( bool  value)
inline

Definition at line 1783 of file unit.hpp.

◆ type() [1/2]

static std::string unit::upkeep_full::type ( )
inlinestatic

Definition at line 1124 of file unit.hpp.

References mariadb::value::string.

◆ type() [2/2]

static std::string unit::upkeep_loyal::type ( )
inlinestatic

Definition at line 1129 of file unit.hpp.

References mariadb::value::string.

Referenced by unit::apply_builtin_effect().

◆ unit_movement_resetter() [1/2]

unit_movement_resetter::unit_movement_resetter ( const unit_movement_resetter )
delete

◆ unit_movement_resetter() [2/2]

unit_movement_resetter::unit_movement_resetter ( const unit u,
bool  operate = true 
)

◆ upkeep_value_visitor()

unit::upkeep_value_visitor::upkeep_value_visitor ( const unit unit)
inlineexplicit

Definition at line 1136 of file unit.hpp.

◆ write()

void unit::write ( config cfg,
bool  write_all = true 
) const

Serializes the current unit metadata values.

Parameters
cfgThe config to write to.
write_allset this to false to not write unchanged attributes.

Definition at line 1428 of file unit.cpp.

References unit::abilities_, config::add_child(), unit::advancements_, unit::advances_to_, unit::alignment_, config::append(), unit::attacks_, unit::attacks_left_, unit::can_recruit(), config::clear_children(), unit::description_, unit::ellipse_, unit::emit_zoc_, unit::events_, unit::experience_, unit::facing_, unit::filter_recall_, unit::flag_rgb_, unit::formula_man_, unit::gender_, gender_string(), unit::generate_name_, unit::get_attacks_changed(), unit::get_attr_changed(), unit::get_states(), unit::goto_, unit::halo_, unit::hidden_, unit::hit_points_, i, unit_type::icon(), unit_race::id(), unit::id_, unit_type::image(), unit::jamming_, utils::join(), unit::level_, unit::max_attacks_, unit::max_experience_, unit::max_hit_points_, unit::max_movement_, unit::modifications_, unit::movement_, unit::movement_type_, unit::name_, unit_type::parent_id(), unit::profile_, unit::race_, unit::random_traits_, unit::recall_cost_, unit::recruit_list_, unit::resting_, unit::role_, unit::side_, unit::small_profile_, unit::special_notes_, mariadb::value::string, unit::type(), unit::type_id(), unit::type_name_, unit::UA_ABILITIES, unit::UA_ADVANCE_TO, unit::UA_ADVANCEMENTS, unit::UA_ALIGNMENT, unit::UA_ATTACKS, unit::UA_LEVEL, unit::UA_MAX_AP, unit::UA_MAX_HP, unit::UA_MAX_MP, unit::UA_MAX_XP, unit::UA_MOVEMENT_TYPE, unit::UA_NOTES, unit::UA_PROFILE, unit::UA_SMALL_PROFILE, unit::UA_ZOC, unit::undead_variation_, unit::underlying_id_, unit::unit_description(), unit::unit_value_, unit::unrenamable_, unit::usage_, n_unit::unit_id::value, unit::variables_, unit::variation_, unit::vision_, map_location::wml_x(), map_location::wml_y(), movetype::write(), map_location::write_direction(), and unit::write_upkeep().

Referenced by actions::find_recruit_location(), and get_checksum().

◆ write_upkeep()

void unit::write_upkeep ( config::attribute_value upkeep) const
private

Definition at line 2660 of file unit.cpp.

References variable_info_implementation::apply_visitor().

Referenced by unit::write().

◆ ~unit_movement_resetter()

unit_movement_resetter::~unit_movement_resetter ( )

Variable Documentation

◆ abilities_

config unit::abilities_
private

◆ advancements_

advancements_list unit::advancements_
private

◆ advances_to_

std::vector<std::string> unit::advances_to_
private

◆ alignment_

UNIT_ALIGNMENT unit::alignment_
private

Definition at line 1819 of file unit.hpp.

Referenced by unit::advance_to(), unit::init(), unit::swap(), and unit::write().

◆ anim_comp_

std::unique_ptr<unit_animation_component> unit::anim_comp_
private

◆ appearance_changed_

bool unit::appearance_changed_ = true
mutableprivate

◆ attacks_

attack_list unit::attacks_
private

◆ attacks_left_

int unit::attacks_left_
private

Definition at line 1843 of file unit.hpp.

Referenced by unit::init(), unit::new_turn(), unit::swap(), and unit::write().

◆ canrecruit_

bool unit::canrecruit_
private

Definition at line 1817 of file unit.hpp.

Referenced by unit::init(), and unit::swap().

◆ changed_attributes_

std::bitset<UA_COUNT> unit::changed_attributes_
private

Definition at line 1910 of file unit.hpp.

◆ description_

t_string unit::description_
private

Definition at line 1893 of file unit.hpp.

Referenced by unit::advance_to(), unit::apply_builtin_effect(), unit::init(), and unit::write().

◆ ellipse_

std::unique_ptr<std::string> unit::ellipse_
private

Definition at line 1898 of file unit.hpp.

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

◆ emit_zoc_

bool unit::emit_zoc_
private

Definition at line 1857 of file unit.hpp.

Referenced by unit::advance_to(), unit::apply_builtin_effect(), unit::swap(), and unit::write().

◆ end_turn_

bool unit::end_turn_
private

Definition at line 1840 of file unit.hpp.

Referenced by unit::new_turn(), unit::set_movement(), and unit::swap().

◆ events_

config unit::events_
private

Definition at line 1854 of file unit.hpp.

Referenced by unit::init(), unit::swap(), and unit::write().

◆ experience_

int unit::experience_
private

Definition at line 1811 of file unit.hpp.

Referenced by unit::apply_builtin_effect(), unit::init(), unit::swap(), and unit::write().

◆ facing_

map_location::DIRECTION unit::facing_
mutableprotected

◆ filter_recall_

config unit::filter_recall_
private

Definition at line 1855 of file unit.hpp.

Referenced by unit::init(), unit::swap(), and unit::write().

◆ flag_rgb_

std::string unit::flag_rgb_
private

Definition at line 1821 of file unit.hpp.

Referenced by unit::advance_to(), unit::flag_rgb(), unit::swap(), and unit::write().

◆ formula_man_

std::unique_ptr<unit_formula_manager> unit::formula_man_
private

Definition at line 1830 of file unit.hpp.

Referenced by unit::init(), unit::swap(), and unit::write().

◆ gender_

unit_race::GENDER unit::gender_
private

◆ generate_name_

bool unit::generate_name_
private

Definition at line 1901 of file unit.hpp.

Referenced by unit::advance_to(), unit::generate_name(), unit::init(), and unit::write().

◆ goto_

map_location unit::goto_
private

Definition at line 1874 of file unit.hpp.

Referenced by unit::init(), unit::new_scenario(), unit::swap(), and unit::write().

◆ halo_

std::unique_ptr<std::string> unit::halo_
private

Definition at line 1897 of file unit.hpp.

Referenced by unit::write().

◆ hidden_

bool unit::hidden_
mutableprivate

Definition at line 1885 of file unit.hpp.

Referenced by unit::init(), unit::swap(), and unit::write().

◆ hit_points_

int unit::hit_points_
private

◆ hold_position_

bool unit::hold_position_
private

Definition at line 1839 of file unit.hpp.

Referenced by unit::new_turn(), unit::set_movement(), and unit::swap().

◆ hp_bar_scaling_

double unit::hp_bar_scaling_
private

Definition at line 1886 of file unit.hpp.

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

◆ id_

std::string unit::id_
private

◆ image_mods_

std::string unit::image_mods_
private

Definition at line 1822 of file unit.hpp.

Referenced by unit::advance_to(), unit::apply_builtin_effect(), and unit::swap().

◆ interrupted_move_

map_location unit::interrupted_move_
private

Definition at line 1874 of file unit.hpp.

Referenced by unit::swap().

◆ invisibility_cache_

std::map<map_location, bool> unit::invisibility_cache_
mutableprivate

Hold the visibility status cache for a unit, when not uncovered.

This is mutable since it is a cache.

Definition at line 1919 of file unit.hpp.

Referenced by unit::invisible(), and unit::swap().

◆ is_fearless_

bool unit::is_fearless_
private

Definition at line 1876 of file unit.hpp.

Referenced by unit::advance_to(), unit::apply_builtin_effect(), and unit::swap().

◆ is_healthy_

bool unit::is_healthy_
private

Definition at line 1876 of file unit.hpp.

Referenced by unit::advance_to(), unit::apply_builtin_effect(), and unit::swap().

◆ jamming_

int unit::jamming_
private

◆ known_boolean_state_names_

std::map< std::string, unit::state_t > unit::known_boolean_state_names_
staticprivate
Initial value:
{
{"slowed", STATE_SLOWED},
{"poisoned", STATE_POISONED},
{"petrified", STATE_PETRIFIED},
{"uncovered", STATE_UNCOVERED},
{"not_moved", STATE_NOT_MOVED},
{"unhealable", STATE_UNHEALABLE},
{"guardian", STATE_GUARDIAN},
}

Definition at line 1851 of file unit.hpp.

Referenced by unit::get_known_boolean_state_id(), and unit::get_states().

◆ known_boolean_states_

std::bitset<num_bool_states> unit::known_boolean_states_
private

Definition at line 1850 of file unit.hpp.

Referenced by unit::get_state(), unit::set_state(), and unit::swap().

◆ level_

int unit::level_
private

◆ loc_

map_location unit::loc_
private

◆ max_attacks_

int unit::max_attacks_
private

◆ max_experience_

int unit::max_experience_
private

◆ max_hit_points_

int unit::max_hit_points_
private

◆ max_movement_

int unit::max_movement_
private

◆ modification_descriptions_

utils::string_map unit::modification_descriptions_
private

Definition at line 1878 of file unit.hpp.

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

◆ modifications_

config unit::modifications_
private

◆ movement_

int unit::movement_
private

◆ movement_type_

movetype unit::movement_type_
private

◆ moves_

int unit_movement_resetter::moves_
private

Definition at line 1952 of file unit.hpp.

Referenced by unit_movement_resetter::~unit_movement_resetter().

◆ name_

t_string unit::name_
private

Definition at line 1803 of file unit.hpp.

Referenced by unit::generate_name(), unit::init(), unit::swap(), and unit::write().

◆ num_bool_states

const std::size_t unit::num_bool_states = 7
staticprivate

Definition at line 1848 of file unit.hpp.

◆ overlays_

std::vector<std::string> unit::overlays_
private

Definition at line 1859 of file unit.hpp.

Referenced by unit::advance_to(), unit::apply_builtin_effect(), and unit::swap().

◆ profile_

std::string unit::profile_
private

◆ race_

const unit_race* unit::race_
private

Never nullptr, but may point to the null race.

Definition at line 1800 of file unit.hpp.

Referenced by unit::advance_to(), unit::generate_name(), unit::init(), unit::swap(), and unit::write().

◆ random_traits_

bool unit::random_traits_
private

Definition at line 1900 of file unit.hpp.

Referenced by unit::advance_to(), unit::generate_traits(), unit::init(), and unit::write().

◆ recall_cost_

int unit::recall_cost_
private

◆ recruit_list_

std::vector<std::string> unit::recruit_list_
private

Definition at line 1818 of file unit.hpp.

Referenced by unit::set_recruits(), unit::swap(), and unit::write().

◆ resting_

bool unit::resting_
private

Definition at line 1841 of file unit.hpp.

Referenced by unit::end_turn(), unit::init(), unit::swap(), and unit::write().

◆ role_

std::string unit::role_
private

Definition at line 1861 of file unit.hpp.

Referenced by unit::init(), unit::swap(), and unit::write().

◆ side_

int unit::side_
private

◆ small_profile_

std::string unit::small_profile_
private

Definition at line 1906 of file unit.hpp.

Referenced by unit::advance_to(), unit::small_profile(), and unit::write().

◆ special_notes_

std::vector<t_string> unit::special_notes_
private

Definition at line 1894 of file unit.hpp.

Referenced by unit::advance_to(), unit::apply_builtin_effect(), unit::init(), and unit::write().

◆ states_

std::set<std::string> unit::states_
private

Definition at line 1846 of file unit.hpp.

Referenced by unit::get_state(), unit::get_states(), unit::set_state(), and unit::swap().

◆ trait_descriptions_

std::vector<t_string> unit::trait_descriptions_
private

Definition at line 1871 of file unit.hpp.

Referenced by unit::add_trait_description(), unit::advance_to(), and unit::swap().

◆ trait_names_

std::vector<t_string> unit::trait_names_
private

Definition at line 1870 of file unit.hpp.

Referenced by unit::add_trait_description(), unit::advance_to(), and unit::swap().

◆ type_

const unit_type* unit::type_
private

Never nullptr.

Adjusted for gender and variation.

Definition at line 1794 of file unit.hpp.

Referenced by unit::advance_to(), unit::init(), unit::swap(), and unit::type_id().

◆ type_name_

t_string unit::type_name_
private

The displayed name of this unit type.

Definition at line 1797 of file unit.hpp.

Referenced by unit::advance_to(), unit::swap(), and unit::write().

◆ u_ [1/2]

const unit& unit::upkeep_value_visitor::u_
private

Definition at line 1156 of file unit.hpp.

◆ u_ [2/2]

unit& unit_movement_resetter::u_
private

◆ undead_variation_

std::string unit::undead_variation_
private

Definition at line 1806 of file unit.hpp.

Referenced by unit::advance_to(), unit::swap(), and unit::write().

◆ underlying_id_

n_unit::unit_id unit::underlying_id_
private

◆ unit_value_

int unit::unit_value_
private

Definition at line 1873 of file unit.hpp.

Referenced by unit::advance_to(), unit::init(), unit::swap(), and unit::write().

◆ unrenamable_

bool unit::unrenamable_
private

Definition at line 1824 of file unit.hpp.

Referenced by unit::init(), unit::swap(), and unit::write().

◆ upkeep_

upkeep_t unit::upkeep_
private

◆ usage_

std::unique_ptr<std::string> unit::usage_
private

Definition at line 1896 of file unit.hpp.

Referenced by unit::write().

◆ variables_

config unit::variables_
private

Definition at line 1853 of file unit.hpp.

Referenced by unit::apply_modifications(), unit::init(), unit::swap(), and unit::write().

◆ variation_

std::string unit::variation_
private

◆ vision_

int unit::vision_
private

◆ xp_bar_scaling_

double unit::xp_bar_scaling_
private

Definition at line 1886 of file unit.hpp.

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

Friends

◆ unit_animation_component

friend class unit_animation_component
friend

Definition at line 1881 of file unit.hpp.