2020-07-10 07:30:10 +00:00
|
|
|
#include "../src/Random.hpp"
|
2020-07-19 09:08:05 +00:00
|
|
|
#include "Core.hpp"
|
2020-07-10 07:30:10 +00:00
|
|
|
|
2020-07-19 08:44:54 +00:00
|
|
|
export ArbUt::Random* Arbutils_Random_Construct() { return new ArbUt::Random(); }
|
|
|
|
export ArbUt::Random* Arbutils_Random_ConstructWithSeed(uint_fast32_t seed) { return new ArbUt::Random(seed); }
|
2020-07-10 07:30:10 +00:00
|
|
|
|
2020-07-19 08:44:54 +00:00
|
|
|
export void Arbutils_Random_Destruct(ArbUt::Random* p) { delete p; }
|
2020-07-10 07:30:10 +00:00
|
|
|
|
2020-07-19 08:44:54 +00:00
|
|
|
export float Arbutils_Random_GetFloat(ArbUt::Random* p) { return p->GetFloat(); }
|
|
|
|
export double Arbutils_Random_GetDouble(ArbUt::Random* p) { return p->GetDouble(); }
|
|
|
|
export int32_t Arbutils_Random_Get(ArbUt::Random* p) { return p->Get(); }
|
2020-07-19 09:08:05 +00:00
|
|
|
export uint8_t Arbutils_Random_GetWithMax(ArbUt::Random* p, int32_t max, int32_t& out) { Try(out = p->Get(max);) }
|
|
|
|
export uint8_t Arbutils_Random_GetInLimits(ArbUt::Random* p, int32_t min, int32_t max, int32_t& out) {
|
|
|
|
Try(out = p->Get(min, max);)
|
|
|
|
}
|
2020-07-19 08:44:54 +00:00
|
|
|
|
|
|
|
export uint32_t Arbutils_Random_GetUnsigned(ArbUt::Random* p) { return p->GetUnsigned(); }
|
2020-07-19 09:08:05 +00:00
|
|
|
export uint8_t Arbutils_Random_GetUnsignedWithMax(ArbUt::Random* p, uint32_t max, uint32_t& out) {
|
|
|
|
Try(out = p->GetUnsigned(max);)
|
|
|
|
}
|
|
|
|
export uint8_t Arbutils_Random_GetUnsignedInLimits(ArbUt::Random* p, uint32_t min, uint32_t max, uint32_t& out) {
|
|
|
|
Try(out = p->GetUnsigned(min, max);)
|
2020-07-10 07:30:10 +00:00
|
|
|
}
|
|
|
|
|
2020-07-19 08:44:54 +00:00
|
|
|
export uint_fast32_t Arbutils_Random_GetSeed(ArbUt::Random* p) { return p->GetSeed(); }
|