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

#include <attack_type.hpp>

Public Member Functions

 ~specials_context_t ()
 
 specials_context_t (specials_context_t &&)
 

Private Member Functions

 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 (const specials_context_t &)=delete
 

Private Attributes

std::shared_ptr< const attack_typeparent
 
bool was_moved = false
 

Friends

class attack_type
 

Detailed Description

Definition at line 121 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 905 of file abilities.cpp.

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

Referenced by attack_type::specials_context(), and attack_type::specials_context_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]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 892 of file abilities.cpp.

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

◆ 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]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 848 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]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 873 of file abilities.cpp.

References attack_type::is_attacker_, attack_type::is_for_listing_, 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 912 of file abilities.cpp.

References map_location::null_location(), parent, and was_moved.

◆ specials_context_t() [6/6]

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

Definition at line 924 of file abilities.cpp.

Friends And Related Function Documentation

◆ attack_type

friend class attack_type
friend

Definition at line 123 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 122 of file attack_type.hpp.

Referenced by ~specials_context_t().

◆ was_moved

bool attack_type::specials_context_t::was_moved = false
private

Definition at line 136 of file attack_type.hpp.

Referenced by ~specials_context_t().


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