mirror of
https://github.com/copyrighttxt/watrbx-game-engine.git
synced 2026-09-04 20:57:49 +00:00
24 lines
413 B
C++
24 lines
413 B
C++
/* Copyright 2014 ROBLOX Corporation, All Rights Reserved */
|
|
#include "stdafx.h"
|
|
|
|
class LcmRand
|
|
{
|
|
public:
|
|
LcmRand() : seed(1337U) {}
|
|
|
|
uint32_t value()
|
|
{
|
|
const static uint32_t a = 214013U;
|
|
const static uint32_t c = 2531011U;
|
|
seed = seed * a + c;
|
|
return (seed >> 16) & 0x7FFF;
|
|
}
|
|
|
|
void setSeed(uint32_t newSeed)
|
|
{
|
|
seed = newSeed;
|
|
}
|
|
|
|
private:
|
|
uint32_t seed;
|
|
}; |