mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
MTRand
This commit is contained in:
parent
d9eca5ba5c
commit
2f89450493
5 changed files with 193 additions and 0 deletions
28
BeefySysLib/util/MTRand.h
Normal file
28
BeefySysLib/util/MTRand.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
#pragma once
|
||||
|
||||
#include "Common.h"
|
||||
|
||||
NS_BF_BEGIN;
|
||||
|
||||
#define MTRAND_N 624
|
||||
|
||||
class MTRand
|
||||
{
|
||||
unsigned long mt[MTRAND_N]; /* the array for the state vector */
|
||||
int mti;
|
||||
|
||||
public:
|
||||
MTRand(const std::string& theSerialData);
|
||||
MTRand(unsigned long seed);
|
||||
MTRand();
|
||||
|
||||
void SRand(const std::string& theSerialData);
|
||||
void SRand(unsigned long seed);
|
||||
unsigned long Next();
|
||||
unsigned long Next(unsigned long range);
|
||||
float Next(float range);
|
||||
|
||||
String Serialize();
|
||||
};
|
||||
|
||||
NS_BF_END
|
Loading…
Add table
Add a link
Reference in a new issue