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

#include <AttributesImpl.hpp>

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

Public Member Functions

 NextBaseExperience (std::weak_ptr< Unit > unit, int32_t base=0)
 
 ~NextBaseExperience ()
 
void on_observable_changed (BaseLevel *blvl)
 
- 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
 

Additional Inherited Members

- 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

◆ NextBaseExperience()

Horizon::Zone::Traits::NextBaseExperience::NextBaseExperience ( std::weak_ptr< Unit unit,
int32_t  base = 0 
)
inline
1096 : Attribute(unit, STATUS_NEXTBASEEXP, base, 0, 0)
1097 { }
@ STATUS_NEXTBASEEXP
Definition: UnitDefinitions.hpp:111
std::shared_ptr< Unit > unit()
Definition: Attribute.hpp:259

◆ ~NextBaseExperience()

Horizon::Zone::Traits::NextBaseExperience::~NextBaseExperience ( )
inline
1098{ };

Member Function Documentation

◆ on_observable_changed()

void NextBaseExperience::on_observable_changed ( BaseLevel blvl)
507{
508 if (unit() == nullptr || blvl == nullptr)
509 return;
510
511 std::shared_ptr<const job_config_data> job = JobDB->get_job_by_id(unit()->job_id());
512 std::shared_ptr<const exp_group_data> bexpg = ExpDB->get_exp_group(job->base_exp_group, EXP_GROUP_TYPE_BASE);
513
514 if (blvl->get_base() >= bexpg->max_level)
515 return;
516
517 set_base(bexpg->exp[blvl->get_base() - 1]);
518}
#define ExpDB
Definition: ExpDB.hpp:93
#define JobDB
Definition: JobDB.hpp:87
virtual void set_base(int32_t val, bool notify=true)
Definition: Attribute.hpp:262
virtual int32_t get_base() const
Definition: Attribute.hpp:269
@ EXP_GROUP_TYPE_BASE
Definition: ExpDB.hpp:51

References Horizon::Zone::EXP_GROUP_TYPE_BASE, ExpDB, Horizon::Zone::Traits::Attribute::get_base(), JobDB, and Horizon::Zone::Traits::s_attribute_change_values::set_base().

+ Here is the call graph for this function:

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