2021-03-16 22:54:40 +00:00
|
|
|
// Defines the CRandom class
|
|
|
|
// This class implements the Lehmer Random Number Generator
|
|
|
|
|
2017-10-18 03:52:07 +00:00
|
|
|
#pragma once
|
2017-10-18 02:38:38 +00:00
|
|
|
#include <Common/stdtypes.h>
|
|
|
|
|
|
|
|
class CRandom
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CRandom();
|
|
|
|
CRandom(uint32_t seed_value);
|
|
|
|
uint32_t next();
|
2017-10-18 03:52:07 +00:00
|
|
|
uint32_t get_state();
|
|
|
|
void set_state(uint32_t state_value);
|
2017-10-18 02:38:38 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
uint32_t randomizer(uint32_t val);
|
2017-10-18 05:16:30 +00:00
|
|
|
uint32_t m_state;
|
2017-10-18 02:38:38 +00:00
|
|
|
};
|