Horizon Official Technical Documentation
Horizon::Zone::Traits::WeaponAttackRight Class Reference

#include <AttributesImpl.hpp>

+ Inheritance diagram for Horizon::Zone::Traits::WeaponAttackRight:
+ Collaboration diagram for Horizon::Zone::Traits::WeaponAttackRight:

Public Member Functions

 WeaponAttackRight (std::weak_ptr< Unit > unit)
 
void on_equipment_changed ()
 
int32_t compute ()
 
void set_base (int32_t val, bool notify_client=true) override
 
void add_base (int32_t val, bool notify_client=true) override
 
void sub_base (int32_t val, bool notify_client=true) override
 
void set_equip (int32_t val, bool notify_client=true) override
 
void add_equip (int32_t val, bool notify_client=true) override
 
void sub_equip (int32_t val, bool notify_client=true) override
 
void set_status (int32_t val, bool notify_client=true) override
 
void add_status (int32_t val, bool notify_client=true) override
 
void sub_status (int32_t val, bool notify_client=true) override
 
- Public Member Functions inherited from Horizon::Zone::Traits::Attribute
 Attribute ()=default
 
 Attribute (std::weak_ptr< Unit > unit, status_point_type st_type, int32_t base=0, int32_t equip=0, int32_t status=0)
 
 Attribute (const Attribute &other)
 
 Attribute (Attribute &&other) noexcept
 
std::shared_ptr< Unitunit ()
 
void unit (std::shared_ptr< Unit > e)
 
virtual void set_base (int32_t val, bool notify=true)
 
virtual void add_base (int32_t val, bool notify=true)
 
virtual void sub_base (int32_t val, bool notify=true)
 
virtual int32_t get_base () const
 
virtual void set_equip (int32_t val, bool notify=true)
 
virtual void add_equip (int32_t val, bool notify=true)
 
virtual void sub_equip (int32_t val, bool notify=true)
 
virtual int32_t get_equip () const
 
virtual void set_status (int32_t val, bool notify=true)
 
virtual void add_status (int32_t val, bool notify=true)
 
virtual void sub_status (int32_t val, bool notify=true)
 
virtual int32_t get_status () const
 
virtual int32_t total () const
 
virtual int32_t compute ()
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
TT operator+ (TT right)
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
TT operator/ (TT right)
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
TT operator* (TT right)
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
TT operator- (TT right)
 
int operator+ (Attribute const &right) const
 
double operator/ (Attribute const &right)
 
double operator* (Attribute const &right)
 
int operator- (Attribute const &right)
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
bool operator== (TT right)
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
bool operator!= (TT right)
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
bool operator> (TT right)
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
bool operator>= (TT right)
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
bool operator< (TT right)
 
template<typename TT , typename std::enable_if< std::is_integral< TT >::value >::type * = nullptr>
bool operator<= (TT right)
 
bool operator== (Attribute const &right)
 
bool operator!= (Attribute const &right)
 
bool operator> (Attribute const &right)
 
bool operator>= (Attribute const &right)
 
bool operator< (Attribute const &right)
 
bool operator<= (Attribute const &right)
 
Attribute operator= (Attribute &right)
 
Attribute operator= (Attribute &&right)
 
void add_permanent_change (s_attribute_change_values change, std::string source)
 
void remove_permanent_change (std::string source)
 
void add_temporary_change (s_attribute_change_values change, uint64_t duration, std::string source)
 
void remove_temporary_change (std::string source)
 
void add_periodic_change (s_attribute_change_values change, uint64_t duration, uint64_t interval, std::string source)
 
void remove_periodic_change (std::string source)
 
void update (uint64_t delta)
 
void apply (bool notify=true)
 
void reset ()
 
void notify ()
 
status_point_type get_type () const
 
bool needs_recalculation () const
 
void recalculate (bool flag)
 
bool is_compute_ready () const
 
- Public Member Functions inherited from ObservableStatus< WeaponAttackRight *, WeaponAttackCombined * >
 ObservableStatus (HAS_OBSERVERS ... args)
 
 ~ObservableStatus ()
 
std::enable_if< I==sizeof...(Tp), void >::type notify (std::tuple< Tp... > &)
 
 notify (t)
 
 std::enable_if (_observers) -> on_observable_changed(_observable)
 
void notify_observers ()
 
void register_observable (WeaponAttackRight * obs)
 
void register_observers (HAS_OBSERVERS... obs)
 

Additional Inherited Members

- Public Attributes inherited from ObservableStatus< WeaponAttackRight *, WeaponAttackCombined * >
WeaponAttackRight * _observable
 
std::tuple< HAS_OBSERVERS... > _observers
 
- Protected Attributes inherited from Horizon::Zone::Traits::Attribute
status_point_type _status_point_type {status_point_type::STATUS_POINT_INVALID}
 
int32_t _base_val {0}
 
int32_t _equip_val {0}
 
int32_t _status_val {0}
 
bool _apply_periodic_changes {false}
 
bool _recalculate_flag {false}
 
bool _calculate_ready {false}
 

Constructor & Destructor Documentation

◆ WeaponAttackRight()

Horizon::Zone::Traits::WeaponAttackRight::WeaponAttackRight ( std::weak_ptr< Unit unit)
inline
1698 ObservableStatus(nullptr)
1699 { }
@ STATUS_WATK_RIGHT
Definition: UnitDefinitions.hpp:441
std::shared_ptr< Unit > unit()
Definition: Attribute.hpp:259
ObservableStatus(HAS_OBSERVERS ... args)
Definition: ObservableStatus.hpp:39

Member Function Documentation

◆ add_base()

void Horizon::Zone::Traits::WeaponAttackRight::add_base ( int32_t  val,
bool  notify_client = true 
)
inlineoverridevirtual

Reimplemented from Horizon::Zone::Traits::Attribute.

1712 {
1713 Attribute::add_base(val, notify_client);
1714 this->notify_observers();
1715 }
virtual void add_base(int32_t val, bool notify=true)
Definition: Attribute.cpp:244
void notify_observers()
Definition: ObservableStatus.hpp:59

References Horizon::Zone::Traits::Attribute::add_base(), and ObservableStatus< WeaponAttackRight *, WeaponAttackCombined * >::notify_observers().

+ Here is the call graph for this function:

◆ add_equip()

void Horizon::Zone::Traits::WeaponAttackRight::add_equip ( int32_t  val,
bool  notify_client = true 
)
inlineoverridevirtual

Reimplemented from Horizon::Zone::Traits::Attribute.

1730 {
1731 Attribute::add_equip(val, notify_client);
1732 this->notify_observers();
1733 }
virtual void add_equip(int32_t val, bool notify=true)
Definition: Attribute.cpp:252

References Horizon::Zone::Traits::Attribute::add_equip(), and ObservableStatus< WeaponAttackRight *, WeaponAttackCombined * >::notify_observers().

+ Here is the call graph for this function:

◆ add_status()

void Horizon::Zone::Traits::WeaponAttackRight::add_status ( int32_t  val,
bool  notify_client = true 
)
inlineoverridevirtual

Reimplemented from Horizon::Zone::Traits::Attribute.

1748 {
1749 Attribute::add_status(val, notify_client);
1750 this->notify_observers();
1751 }
virtual void add_status(int32_t val, bool notify=true)
Definition: Attribute.cpp:260

References Horizon::Zone::Traits::Attribute::add_status(), and ObservableStatus< WeaponAttackRight *, WeaponAttackCombined * >::notify_observers().

+ Here is the call graph for this function:

◆ compute()

int32_t WeaponAttackRight::compute ( )
virtual

Reimplemented from Horizon::Zone::Traits::Attribute.

987{
988 EquipmentListType const &equipments = unit()->downcast<Horizon::Zone::Units::Player>()->inventory()->equipments();
989
990 if (equipments[IT_EQPI_HAND_R].second.expired() == true)
991 return 0;
992
993 set_base(equipments[IT_EQPI_HAND_R].second.lock()->config->attack, false);
994
995 return total();
996}
@ IT_EQPI_HAND_R
Definition: ItemDefinitions.hpp:214
std::array< std::pair< item_equip_location_mask, std::weak_ptr< item_entry_data > >, IT_EQPI_MAX > EquipmentListType
Definition: ItemDefinitions.hpp:577
virtual int32_t total() const
Definition: Attribute.hpp:289
void set_base(int32_t val, bool notify_client=true) override
Definition: AttributesImpl.hpp:1705
Definition: Player.hpp:62

References IT_EQPI_HAND_R, and Horizon::Zone::Traits::s_attribute_change_values::set_base().

Referenced by on_equipment_changed().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_equipment_changed()

void Horizon::Zone::Traits::WeaponAttackRight::on_equipment_changed ( )
inline
1701{ if (is_compute_ready()) compute(); }
bool is_compute_ready() const
Definition: Attribute.hpp:412
int32_t compute()
Definition: Attribute.cpp:986

References compute(), and Horizon::Zone::Traits::Attribute::is_compute_ready().

+ Here is the call graph for this function:

◆ set_base()

void Horizon::Zone::Traits::WeaponAttackRight::set_base ( int32_t  val,
bool  notify_client = true 
)
inlineoverridevirtual

Reimplemented from Horizon::Zone::Traits::Attribute.

1706 {
1707 Attribute::set_base(val, notify_client);
1708 this->notify_observers();
1709 }
virtual void set_base(int32_t val, bool notify=true)
Definition: Attribute.hpp:262

References ObservableStatus< WeaponAttackRight *, WeaponAttackCombined * >::notify_observers(), and Horizon::Zone::Traits::Attribute::set_base().

+ Here is the call graph for this function:

◆ set_equip()

void Horizon::Zone::Traits::WeaponAttackRight::set_equip ( int32_t  val,
bool  notify_client = true 
)
inlineoverridevirtual

Reimplemented from Horizon::Zone::Traits::Attribute.

1724 {
1725 Attribute::set_equip(val, notify_client);
1726 this->notify_observers();
1727 }
virtual void set_equip(int32_t val, bool notify=true)
Definition: Attribute.hpp:271

References ObservableStatus< WeaponAttackRight *, WeaponAttackCombined * >::notify_observers(), and Horizon::Zone::Traits::Attribute::set_equip().

+ Here is the call graph for this function:

◆ set_status()

void Horizon::Zone::Traits::WeaponAttackRight::set_status ( int32_t  val,
bool  notify_client = true 
)
inlineoverridevirtual

Reimplemented from Horizon::Zone::Traits::Attribute.

1742 {
1743 Attribute::set_status(val, notify_client);
1744 this->notify_observers();
1745 }
virtual void set_status(int32_t val, bool notify=true)
Definition: Attribute.hpp:280

References ObservableStatus< WeaponAttackRight *, WeaponAttackCombined * >::notify_observers(), and Horizon::Zone::Traits::Attribute::set_status().

+ Here is the call graph for this function:

◆ sub_base()

void Horizon::Zone::Traits::WeaponAttackRight::sub_base ( int32_t  val,
bool  notify_client = true 
)
inlineoverridevirtual

Reimplemented from Horizon::Zone::Traits::Attribute.

1718 {
1719 Attribute::sub_base(val, notify_client);
1720 this->notify_observers();
1721 }
virtual void sub_base(int32_t val, bool notify=true)
Definition: Attribute.cpp:248

References ObservableStatus< WeaponAttackRight *, WeaponAttackCombined * >::notify_observers(), and Horizon::Zone::Traits::Attribute::sub_base().

+ Here is the call graph for this function:

◆ sub_equip()

void Horizon::Zone::Traits::WeaponAttackRight::sub_equip ( int32_t  val,
bool  notify_client = true 
)
inlineoverridevirtual

Reimplemented from Horizon::Zone::Traits::Attribute.

1736 {
1737 Attribute::sub_equip(val, notify_client);
1738 this->notify_observers();
1739 }
virtual void sub_equip(int32_t val, bool notify=true)
Definition: Attribute.cpp:256

References ObservableStatus< WeaponAttackRight *, WeaponAttackCombined * >::notify_observers(), and Horizon::Zone::Traits::Attribute::sub_equip().

+ Here is the call graph for this function:

◆ sub_status()

void Horizon::Zone::Traits::WeaponAttackRight::sub_status ( int32_t  val,
bool  notify_client = true 
)
inlineoverridevirtual

Reimplemented from Horizon::Zone::Traits::Attribute.

1754 {
1755 Attribute::sub_status(val, notify_client);
1756 this->notify_observers();
1757 }
virtual void sub_status(int32_t val, bool notify=true)
Definition: Attribute.cpp:264

References ObservableStatus< WeaponAttackRight *, WeaponAttackCombined * >::notify_observers(), and Horizon::Zone::Traits::Attribute::sub_status().

+ Here is the call graph for this function:

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