Inlined get stats from Creature. These are frequently called one line methods.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
0e874346bb
commit
864a9d933d
|
@ -60,18 +60,6 @@ bool Battling::Creature::ChangeStatBoost(Library::Statistic stat, int8_t diffAmo
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Battling::Creature::GetFlatStat(Library::Statistic stat) const noexcept { return _flatStats.GetStat(stat); }
|
|
||||||
|
|
||||||
uint32_t Battling::Creature::GetBoostedStat(Library::Statistic stat) const noexcept {
|
|
||||||
return _boostedStats.GetStat(stat);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t Battling::Creature::GetBaseStat(Library::Statistic stat) const noexcept {
|
|
||||||
return _variant->GetStatistic(stat);
|
|
||||||
}
|
|
||||||
|
|
||||||
int8_t Battling::Creature::GetStatBoost(Library::Statistic stat) const noexcept { return _statBoost.GetStat(stat); }
|
|
||||||
|
|
||||||
void Battling::Creature::RecalculateFlatStats() {
|
void Battling::Creature::RecalculateFlatStats() {
|
||||||
auto statCalc = this->_library->GetStatCalculator();
|
auto statCalc = this->_library->GetStatCalculator();
|
||||||
this->_flatStats = statCalc->CalculateFlatStats(this);
|
this->_flatStats = statCalc->CalculateFlatStats(this);
|
||||||
|
|
|
@ -142,10 +142,14 @@ namespace CreatureLib::Battling {
|
||||||
// region Stat APIs
|
// region Stat APIs
|
||||||
|
|
||||||
bool ChangeStatBoost(Library::Statistic stat, int8_t diffAmount);
|
bool ChangeStatBoost(Library::Statistic stat, int8_t diffAmount);
|
||||||
[[nodiscard]] uint32_t GetFlatStat(Library::Statistic stat) const noexcept;
|
[[nodiscard]] inline uint32_t GetFlatStat(Library::Statistic stat) const { return _flatStats.GetStat(stat); }
|
||||||
[[nodiscard]] uint32_t GetBoostedStat(Library::Statistic stat) const noexcept;
|
[[nodiscard]] inline uint32_t GetBoostedStat(Library::Statistic stat) const {
|
||||||
[[nodiscard]] uint32_t GetBaseStat(Library::Statistic stat) const noexcept;
|
return _boostedStats.GetStat(stat);
|
||||||
[[nodiscard]] int8_t GetStatBoost(Library::Statistic stat) const noexcept;
|
}
|
||||||
|
[[nodiscard]] inline uint32_t GetBaseStat(Library::Statistic stat) const {
|
||||||
|
return _variant->GetStatistic(stat);
|
||||||
|
}
|
||||||
|
[[nodiscard]] inline int8_t GetStatBoost(Library::Statistic stat) const { return _statBoost.GetStat(stat); }
|
||||||
void RecalculateFlatStats();
|
void RecalculateFlatStats();
|
||||||
void RecalculateBoostedStats();
|
void RecalculateBoostedStats();
|
||||||
void RecalculateFlatStat(Library::Statistic);
|
void RecalculateFlatStat(Library::Statistic);
|
||||||
|
|
Loading…
Reference in New Issue