From 425bf1df2f21c286d8df1b827394a226cc47ec13 Mon Sep 17 00:00:00 2001 From: Relintai Date: Mon, 7 Oct 2019 00:34:12 +0200 Subject: [PATCH] Removed the stat helper member Refs from entity. --- entities/entity.cpp | 22 ---------------- entities/entity.h | 61 ++++++++++++++++----------------------------- 2 files changed, 21 insertions(+), 62 deletions(-) diff --git a/entities/entity.cpp b/entities/entity.cpp index 0ab5e71..8da722e 100644 --- a/entities/entity.cpp +++ b/entities/entity.cpp @@ -697,28 +697,6 @@ Entity::Entity() { get_stat_enum(Stat::STAT_ID_PARRY)->set_base(15); get_stat_enum(Stat::STAT_ID_MELEE_DAMAGE_REDUCTION)->set_base(15); - _health = Ref(get_stat_enum(Stat::STAT_ID_HEALTH)); - _mana = Ref(get_stat_enum(Stat::STAT_ID_MANA)); - _rage = Ref(get_stat_enum(Stat::STAT_ID_RAGE)); - _energy = Ref(get_stat_enum(Stat::STAT_ID_ENERGY)); - _speed = Ref(get_stat_enum(Stat::STAT_ID_SPEED)); - _gcd = Ref(get_stat_enum(Stat::STAT_ID_GLOBAL_COOLDOWN)); - - _melee_crit = Ref(get_stat_enum(Stat::STAT_ID_MELEE_CRIT)); - _melee_crit_bonus = Ref(get_stat_enum(Stat::STAT_ID_MELEE_CRIT_BONUS)); - _spell_crit = Ref(get_stat_enum(Stat::STAT_ID_SPELL_CRIT)); - _spell_crit_bonus = Ref(get_stat_enum(Stat::STAT_ID_SPELL_CRIT_BONUS)); - - _block = Ref(get_stat_enum(Stat::STAT_ID_BLOCK)); - _parry = Ref(get_stat_enum(Stat::STAT_ID_PARRY)); - _damage_reduction = Ref(get_stat_enum(Stat::STAT_ID_DAMAGE_REDUCTION)); - _melee_damage_reduction = Ref(get_stat_enum(Stat::STAT_ID_MELEE_DAMAGE_REDUCTION)); - _spell_damage_reduction = Ref(get_stat_enum(Stat::STAT_ID_SPELL_DAMAGE_REDUCTION)); - _damage_taken = Ref(get_stat_enum(Stat::STAT_ID_DAMAGE_TAKEN)); - _heal_taken = Ref(get_stat_enum(Stat::STAT_ID_HEAL_TAKEN)); - _melee_damage = Ref(get_stat_enum(Stat::STAT_ID_MELEE_DAMAGE)); - _spell_damage = Ref(get_stat_enum(Stat::STAT_ID_SPELL_DAMAGE)); - SET_RPC_REMOTE("crequest_spell_cast"); SET_RPC_REMOTE("csend_request_rank_increase"); SET_RPC_REMOTE("csend_request_rank_decrease"); diff --git a/entities/entity.h b/entities/entity.h index fca06be..c71cf31 100644 --- a/entities/entity.h +++ b/entities/entity.h @@ -206,25 +206,27 @@ public: //// Stats //// - _FORCE_INLINE_ Ref get_health() { return _health; } - _FORCE_INLINE_ Ref get_mana() { return _mana; } - _FORCE_INLINE_ Ref get_energy() { return _energy; } - _FORCE_INLINE_ Ref get_rage() { return _rage; } - _FORCE_INLINE_ Ref get_speed() { return _speed; } - _FORCE_INLINE_ Ref get_gcd() { return _gcd; } - _FORCE_INLINE_ Ref get_melee_crit() { return _melee_crit; } - _FORCE_INLINE_ Ref get_melee_crit_bonus() { return _melee_crit_bonus; } - _FORCE_INLINE_ Ref get_spell_crit() { return _spell_crit; } - _FORCE_INLINE_ Ref get_spell_crit_bonus() { return _spell_crit_bonus; } - _FORCE_INLINE_ Ref get_block() { return _block; } - _FORCE_INLINE_ Ref get_parry() { return _parry; } - _FORCE_INLINE_ Ref get_damage_reduction() { return _damage_reduction; } - _FORCE_INLINE_ Ref get_melee_damage_reduction() { return _melee_damage_reduction; } - _FORCE_INLINE_ Ref get_spell_damage_reduction() { return _spell_damage_reduction; } - _FORCE_INLINE_ Ref get_damage_taken() { return _damage_taken; } - _FORCE_INLINE_ Ref get_heal_taken() { return _heal_taken; } - _FORCE_INLINE_ Ref get_melee_damage() { return _melee_damage; } - _FORCE_INLINE_ Ref get_spell_damage() { return _spell_damage; } + _FORCE_INLINE_ Ref get_health() { return _stats[Stat::STAT_ID_HEALTH]; } + _FORCE_INLINE_ Ref get_mana() { return _stats[Stat::STAT_ID_MANA]; } + _FORCE_INLINE_ Ref get_energy() { return _stats[Stat::STAT_ID_RAGE]; } + _FORCE_INLINE_ Ref get_rage() { return _stats[Stat::STAT_ID_ENERGY]; } + _FORCE_INLINE_ Ref get_speed() { return _stats[Stat::STAT_ID_SPEED]; } + _FORCE_INLINE_ Ref get_gcd() { return _stats[Stat::STAT_ID_GLOBAL_COOLDOWN]; } + + _FORCE_INLINE_ Ref get_melee_crit() { return _stats[Stat::STAT_ID_MELEE_CRIT]; } + _FORCE_INLINE_ Ref get_melee_crit_bonus() { return _stats[Stat::STAT_ID_MELEE_CRIT_BONUS]; } + _FORCE_INLINE_ Ref get_spell_crit() { return _stats[Stat::STAT_ID_SPELL_CRIT]; } + _FORCE_INLINE_ Ref get_spell_crit_bonus() { return _stats[Stat::STAT_ID_SPELL_CRIT_BONUS]; } + + _FORCE_INLINE_ Ref get_block() { return _stats[Stat::STAT_ID_BLOCK]; } + _FORCE_INLINE_ Ref get_parry() { return _stats[Stat::STAT_ID_PARRY]; } + _FORCE_INLINE_ Ref get_damage_reduction() { return _stats[Stat::STAT_ID_DAMAGE_REDUCTION]; } + _FORCE_INLINE_ Ref get_melee_damage_reduction() { return _stats[Stat::STAT_ID_MELEE_DAMAGE_REDUCTION]; } + _FORCE_INLINE_ Ref get_spell_damage_reduction() { return _stats[Stat::STAT_ID_SPELL_DAMAGE_REDUCTION]; } + _FORCE_INLINE_ Ref get_damage_taken() { return _stats[Stat::STAT_ID_DAMAGE_TAKEN]; } + _FORCE_INLINE_ Ref get_heal_taken() { return _stats[Stat::STAT_ID_HEAL_TAKEN]; } + _FORCE_INLINE_ Ref get_melee_damage() { return _stats[Stat::STAT_ID_MELEE_DAMAGE]; } + _FORCE_INLINE_ Ref get_spell_damage() { return _stats[Stat::STAT_ID_SPELL_DAMAGE]; } Ref get_stat_int(int index); void set_stat_int(int index, Ref entry); @@ -674,27 +676,6 @@ private: //// Stats //// - Ref _health; - Ref _mana; - Ref _rage; - Ref _energy; - Ref _speed; - Ref _gcd; - - Ref _melee_crit; - Ref _melee_crit_bonus; - Ref _spell_crit; - Ref _spell_crit_bonus; - Ref _block; - Ref _parry; - Ref _damage_reduction; - Ref _melee_damage_reduction; - Ref _spell_damage_reduction; - Ref _damage_taken; - Ref _heal_taken; - Ref _melee_damage; - Ref _spell_damage; - Ref _stats[Stat::STAT_ID_TOTAL_STATS]; //// Equipment ////