C interface for Battle Random.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-04-04 18:24:59 +02:00
parent 3dd5aeffd8
commit e2675d06fb
2 changed files with 27 additions and 6 deletions

View File

@@ -12,14 +12,15 @@ namespace CreatureLib::Battling {
Arbutils::Random _random;
public:
BattleRandom() : _random() {}
BattleRandom(int32_t seed) : _random(seed) {}
BattleRandom() noexcept : _random() {}
BattleRandom(uint_fast32_t seed) noexcept : _random(seed) {}
bool EffectChance(float chance, ExecutingAttack* attack, Creature* target);
int32_t Get() { return _random.Get(); }
int32_t Get(int32_t max) { return _random.Get(max); }
int32_t Get(int32_t min, int32_t max) { return _random.Get(min, max); }
Arbutils::Random& GetRNG() { return _random; }
int32_t Get() noexcept { return _random.Get(); }
int32_t Get(int32_t max) noexcept { return _random.Get(max); }
int32_t Get(int32_t min, int32_t max) noexcept { return _random.Get(min, max); }
Arbutils::Random& GetRNG() noexcept { return _random; }
uint_fast32_t GetSeed() const noexcept { return _random.GetSeed(); }
};
}