Adds more templated functions for getting stats
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
df1fd007f1
commit
b0e2e9935a
|
@ -240,6 +240,9 @@ namespace CreatureLib::Battling {
|
|||
return _boostedStats.GetStat<stat>();
|
||||
}
|
||||
[[nodiscard]] inline u32 GetBaseStat(Library::Statistic stat) const { return _variant->GetStatistic(stat); }
|
||||
template <Library::Statistic stat> [[nodiscard]] inline u32 GetBaseStat() const {
|
||||
return _variant->GetStatistics().GetStat<stat>();
|
||||
}
|
||||
[[nodiscard]] inline i8 GetStatBoost(Library::Statistic stat) const { return _statBoost.GetStat(stat); }
|
||||
template <Library::Statistic stat> [[nodiscard]] inline u32 GetStatBoost() const {
|
||||
return _statBoost.GetStat<stat>();
|
||||
|
|
|
@ -31,6 +31,7 @@ namespace CreatureLib::Library {
|
|||
[[nodiscard]] inline size_t GetTypeCount() const { return _types.Count(); }
|
||||
[[nodiscard]] inline u8 GetType(size_t index) const { return _types[index]; }
|
||||
[[nodiscard]] inline const ArbUt::List<u8>& GetTypes() const { return _types; }
|
||||
[[nodiscard]] inline const Library::StatisticSet<u16>& GetStatistics() const { return _baseStatistics; }
|
||||
[[nodiscard]] inline u16 GetStatistic(Library::Statistic stat) const { return _baseStatistics.GetStat(stat); }
|
||||
[[nodiscard]] inline size_t GetTalentCount() const noexcept { return _talents.Count(); }
|
||||
[[nodiscard]] inline size_t GetSecretTalentCount() const noexcept { return _secretTalents.Count(); }
|
||||
|
@ -114,6 +115,7 @@ namespace CreatureLib::Library {
|
|||
ImplGetter(size_t, GetTypeCount);
|
||||
u8 SpeciesVariant::GetType(size_t index) const { return _impl->GetType(index); }
|
||||
ImplGetter(const ArbUt::List<u8>&, GetTypes);
|
||||
ImplGetter(const Library::StatisticSet<u16>&, GetStatistics);
|
||||
u16 SpeciesVariant::GetStatistic(Library::Statistic stat) const noexcept { return _impl->GetStatistic(stat); }
|
||||
|
||||
ImplGetter(size_t, GetTalentCount);
|
||||
|
|
|
@ -57,6 +57,11 @@ namespace CreatureLib::Library {
|
|||
/// @brief Returns a list of the types on this variant.
|
||||
/// @return A list of types on the variant,
|
||||
[[nodiscard]] const ArbUt::List<u8>& GetTypes() const noexcept;
|
||||
|
||||
/// @brief Returns the base statistics.
|
||||
/// @return The base statistics.
|
||||
[[nodiscard]] const Library::StatisticSet<u16>& GetStatistics() const noexcept;
|
||||
|
||||
/// @brief Returns the value of a base statistic.
|
||||
/// @param stat The desired statistic.
|
||||
/// @return The base statistic value.
|
||||
|
|
Loading…
Reference in New Issue