Mark percentile odds helpers nodiscard

This commit is contained in:
2026-06-23 17:33:47 -07:00
parent 567846156c
commit 1847e92fd6
@@ -22,13 +22,13 @@ namespace shardok {
using PercentileRollOdds = net::eagle0::shardok::storage::Odds; using PercentileRollOdds = net::eagle0::shardok::storage::Odds;
using OtherFactor = net::eagle0::shardok::storage::Odds_OtherFactor; using OtherFactor = net::eagle0::shardok::storage::Odds_OtherFactor;
double BonusFromStat(double stat); [[nodiscard]] double BonusFromStat(double stat);
int16_t AverageBonusFromStats(const std::vector<double> &stats); [[nodiscard]] int16_t AverageBonusFromStats(const std::vector<double> &stats);
OtherFactor MakeOtherFactor(int value, const std::string &id); [[nodiscard]] OtherFactor MakeOtherFactor(int value, const std::string &id);
PercentileRollOdds MakeOdds( [[nodiscard]] PercentileRollOdds MakeOdds(
int base = 0, int base = 0,
int terr = 0, int terr = 0,
int weath = 0, int weath = 0,
@@ -36,7 +36,7 @@ PercentileRollOdds MakeOdds(
int statF = 0, int statF = 0,
std::span<const OtherFactor> others = {}); std::span<const OtherFactor> others = {});
PercentileRollOdds MakeOdds( [[nodiscard]] PercentileRollOdds MakeOdds(
int base, int base,
int terr, int terr,
int weath, int weath,
@@ -44,11 +44,11 @@ PercentileRollOdds MakeOdds(
const std::vector<double> &stats, const std::vector<double> &stats,
std::span<const OtherFactor> others = {}); std::span<const OtherFactor> others = {});
int16_t GetTotalOdds(const PercentileRollOdds &odds); [[nodiscard]] int16_t GetTotalOdds(const PercentileRollOdds &odds);
bool PercentileRollSucceeds(const PercentileRollOdds &odds, double roll); [[nodiscard]] bool PercentileRollSucceeds(const PercentileRollOdds &odds, double roll);
int16_t GetSuccessChance(const PercentileRollOdds &odds); [[nodiscard]] int16_t GetSuccessChance(const PercentileRollOdds &odds);
} // namespace shardok } // namespace shardok
#endif // EAGLE0_SHARDOK_LIBRARY_PERCENTILE_ROLL_ODDS_HPP #endif // EAGLE0_SHARDOK_LIBRARY_PERCENTILE_ROLL_ODDS_HPP