Remove Random passes by pointer.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -86,14 +86,10 @@ namespace CreatureLib::Library {
|
||||
|
||||
[[nodiscard]] size_t GetCount() const noexcept { return _values.Count(); }
|
||||
|
||||
inline ArbUt::BorrowedPtr<const T> GetRandomValue(ArbUt::Random rand = ArbUt::Random()) const noexcept {
|
||||
inline ArbUt::BorrowedPtr<const T> GetRandomValue(ArbUt::Random& rand) const noexcept {
|
||||
auto i = rand.Get(_listValues.Count());
|
||||
return _values[_listValues[i]];
|
||||
}
|
||||
inline ArbUt::BorrowedPtr<const T> GetRandomValue(ArbUt::Random* rand) const noexcept {
|
||||
auto i = rand->Get(_listValues.Count());
|
||||
return _values[_listValues[i]];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -68,8 +68,8 @@ namespace CreatureLib::Library {
|
||||
GetLearnableAttacks() const {
|
||||
return _attacks;
|
||||
}
|
||||
[[nodiscard]] inline TalentIndex GetRandomTalent(ArbUt::Random* rand) const noexcept {
|
||||
return TalentIndex(false, rand->Get(_talents.Count()));
|
||||
[[nodiscard]] inline TalentIndex GetRandomTalent(ArbUt::Random& rand) const noexcept {
|
||||
return TalentIndex(false, rand.Get(_talents.Count()));
|
||||
}
|
||||
[[nodiscard]] inline const ArbUt::List<ArbUt::StringView>& GetTalents() const { return _talents; }
|
||||
[[nodiscard]] inline const ArbUt::List<ArbUt::StringView>& GetSecretTalents() const { return _secretTalents; }
|
||||
|
||||
Reference in New Issue
Block a user