Inlined get stats from Creature. These are frequently called one line methods.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-04-25 16:15:27 +02:00
parent 0e874346bb
commit 864a9d933d
2 changed files with 8 additions and 16 deletions

View File

@@ -142,10 +142,14 @@ namespace CreatureLib::Battling {
// region Stat APIs
bool ChangeStatBoost(Library::Statistic stat, int8_t diffAmount);
[[nodiscard]] uint32_t GetFlatStat(Library::Statistic stat) const noexcept;
[[nodiscard]] uint32_t GetBoostedStat(Library::Statistic stat) const noexcept;
[[nodiscard]] uint32_t GetBaseStat(Library::Statistic stat) const noexcept;
[[nodiscard]] int8_t GetStatBoost(Library::Statistic stat) const noexcept;
[[nodiscard]] inline uint32_t GetFlatStat(Library::Statistic stat) const { return _flatStats.GetStat(stat); }
[[nodiscard]] inline uint32_t GetBoostedStat(Library::Statistic stat) const {
return _boostedStats.GetStat(stat);
}
[[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 RecalculateBoostedStats();
void RecalculateFlatStat(Library::Statistic);