mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-02 17:16:57 +02:00
Initial commit
This commit is contained in:
20
arm9/source/rng/LinearCongruentialGenerator.h
Normal file
20
arm9/source/rng/LinearCongruentialGenerator.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
#include "RandomGenerator.h"
|
||||
|
||||
class LinearCongruentialGenerator : public RandomGenerator
|
||||
{
|
||||
public:
|
||||
explicit LinearCongruentialGenerator(u64 seed)
|
||||
: _state(seed) { }
|
||||
|
||||
void Seed(u64 seed) override
|
||||
{
|
||||
_state = seed;
|
||||
}
|
||||
|
||||
protected:
|
||||
u32 Next() override;
|
||||
|
||||
private:
|
||||
u64 _state;
|
||||
};
|
||||
Reference in New Issue
Block a user