CreatureLib/src/Battling/Models/BattleRandom.hpp

28 lines
861 B
C++

#ifndef CREATURELIB_BATTLERANDOM_HPP
#define CREATURELIB_BATTLERANDOM_HPP
#include <Arbutils/Random.hpp>
namespace CreatureLib::Battling {
class ExecutingAttack;
class Creature;
class BattleRandom {
private:
ArbUt::Random _random;
public:
BattleRandom() noexcept : _random() {}
explicit BattleRandom(uint_fast32_t seed) noexcept : _random(seed) {}
bool EffectChance(float chance, ExecutingAttack* attack, Creature* target);
i32 Get() noexcept { return _random.Get(); }
i32 Get(i32 max) noexcept { return _random.Get(max); }
i32 Get(i32 min, i32 max) noexcept { return _random.Get(min, max); }
ArbUt::Random& GetRNG() noexcept { return _random; }
uint_fast32_t GetSeed() const noexcept { return _random.GetSeed(); }
};
}
#endif // CREATURELIB_BATTLERANDOM_HPP