The Battle for Wesnoth  1.19.7+dev
Private Member Functions | Private Attributes | Friends | List of all members
attack_type::specials_context_t Class Reference

#include <attack_type.hpp>

Private Member Functions

 specials_context_t (const specials_context_t &)=delete
 

Private Attributes

std::shared_ptr< const attack_typeparent
 
bool was_moved = false
 

Friends

class attack_type
 

already added

 specials_context_t (const attack_type &weapon, bool attacking)
 Initialize weapon specials context for listing. More...
 
 specials_context_t (const attack_type &weapon, const unit_type &self_type, const map_location &loc, bool attacking=true)
 Initialize weapon specials context for a unit type. More...
 
 specials_context_t (const attack_type &weapon, const_attack_ptr other_weapon, unit_const_ptr self, unit_const_ptr other, const map_location &self_loc, const map_location &other_loc, bool attacking)
 Initialize weapon specials context for a single unit. More...
 
 specials_context_t (const attack_type &weapon, unit_const_ptr self, const map_location &loc, bool attacking)
 Initialize weapon specials context for a pair of units. More...
 
 ~specials_context_t ()
 
 specials_context_t (specials_context_t &&)
 

Detailed Description

Definition at line 375 of file attack_type.hpp.

Constructor & Destructor Documentation

◆ specials_context_t() [1/6]

attack_type::specials_context_t::specials_context_t ( const attack_type weapon,
bool  attacking 
)
explicitprivate

Initialize weapon specials context for listing.

Definition at line 1208 of file abilities.cpp.

References attack_type::is_attacker_, and attack_type::is_for_listing_.

◆ specials_context_t() [2/6]

attack_type::specials_context_t::specials_context_t ( const attack_type weapon,
const unit_type self_type,
const map_location loc,
bool  attacking = true 
)
private

Initialize weapon specials context for a unit type.

Sets the context under which specials will be checked for being active.

This version is appropriate for theoretical units of a particular type.

Parameters
[in]weaponThe weapon being considered.
[in]self_typeA reference to the type of the unit with this weapon.
[in]locThe location of the unit with this weapon.
[in]attackingWhether or not the unit with this weapon is the attacker.

Definition at line 1196 of file abilities.cpp.

References attack_type::is_attacker_, attack_type::is_for_listing_, loc, map_location::null_location(), attack_type::other_, attack_type::other_attack_, attack_type::other_loc_, attack_type::self_, and attack_type::self_loc_.

◆ specials_context_t() [3/6]

attack_type::specials_context_t::specials_context_t ( const attack_type weapon,
const_attack_ptr  other_attack,
unit_const_ptr  self,
unit_const_ptr  other,
const map_location unit_loc,
const map_location other_loc,
bool  attacking 
)
private

Initialize weapon specials context for a single unit.

Sets the context under which specials will be checked for being active.

This version is appropriate if both units in a combat are known.

Parameters
[in]weaponThe weapon being considered.
[in]selfA reference to the unit with this weapon.
[in]otherA reference to the other unit in the combat.
[in]unit_locThe location of the unit with this weapon.
[in]other_locThe location of the other unit in the combat.
[in]attackingWhether or not the unit with this weapon is the attacker.
[in]other_attackThe attack used by the other unit.

Definition at line 1149 of file abilities.cpp.

References attack_type::is_attacker_, attack_type::is_for_listing_, attack_type::other_, attack_type::other_attack_, attack_type::other_loc_, attack_type::self_, and attack_type::self_loc_.

◆ specials_context_t() [4/6]

attack_type::specials_context_t::specials_context_t ( const attack_type weapon,
unit_const_ptr  self,
const map_location loc,
bool  attacking 
)
private

Initialize weapon specials context for a pair of units.

Sets the context under which specials will be checked for being active.

This version is appropriate if there is no specific combat being considered.

Parameters
[in]weaponThe weapon being considered.
[in]selfA reference to the unit with this weapon.
[in]locThe location of the unit with this weapon.
[in]attackingWhether or not the unit with this weapon is the attacker.

Definition at line 1176 of file abilities.cpp.

References attack_type::is_attacker_, attack_type::is_for_listing_, loc, map_location::null_location(), attack_type::other_, attack_type::other_attack_, attack_type::other_loc_, attack_type::self_, and attack_type::self_loc_.

◆ specials_context_t() [5/6]

attack_type::specials_context_t::specials_context_t ( const specials_context_t )
privatedelete

◆ ~specials_context_t()

attack_type::specials_context_t::~specials_context_t ( )

Definition at line 1215 of file abilities.cpp.

References map_location::null_location().

◆ specials_context_t() [6/6]

attack_type::specials_context_t::specials_context_t ( attack_type::specials_context_t &&  other)

Definition at line 1227 of file abilities.cpp.

Friends And Related Function Documentation

◆ attack_type

friend class attack_type
friend

Definition at line 377 of file attack_type.hpp.

Member Data Documentation

◆ parent

std::shared_ptr<const attack_type> attack_type::specials_context_t::parent
private

Definition at line 376 of file attack_type.hpp.

◆ was_moved

bool attack_type::specials_context_t::was_moved = false
private

Definition at line 390 of file attack_type.hpp.


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