Fix RNG default constructor (TODO: implement Clock class)

This commit is contained in:
2024-05-31 15:18:54 -04:00
parent 98e7b5b1f1
commit e5baef35d0

View File

@@ -1,6 +1,5 @@
#pragma once
#include "J3ML/J3ML.h"
namespace J3ML::Algorithm
@@ -45,14 +44,18 @@ namespace J3ML::Algorithm
class RNG {
public:
/// Initializes the generator from the current system clock.
RNG();
RNG()
{
// TODO: Implement Clock class
Seed(0);
}
RNG(u32 seed, u32 multiplier = 69621,
u32 increment = 0, u32 modulus = 0x7FFFFFFF) // 2^31 - 1
{
Seed(seed, multiplier, increment, modulus);
}
/// Reinitializes the generator to the new settings.
void Seed(u32 seed, u32 multiplier, u32 increment, u32 modulus = 0x7FFFFFFF);
void Seed(u32 seed, u32 multiplier = 69621, u32 increment = 0, u32 modulus = 0x7FFFFFFF);
/// Returns a random integer picked uniformly in the range [0, MaxInt()]
u32 Int();
/// Returns the biggest number the generator can yield. [modulus - 1]