From 79e22be419b7ad0b87904127f548e7921eca1fad Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 10 Jan 2022 22:06:22 -0800 Subject: [PATCH] Add more constructors Ease of use --- PKHeX.Core/Legality/RNG/Algorithms/XorShift128.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/PKHeX.Core/Legality/RNG/Algorithms/XorShift128.cs b/PKHeX.Core/Legality/RNG/Algorithms/XorShift128.cs index f99828215..4d9f1d79e 100644 --- a/PKHeX.Core/Legality/RNG/Algorithms/XorShift128.cs +++ b/PKHeX.Core/Legality/RNG/Algorithms/XorShift128.cs @@ -11,6 +11,18 @@ public ref struct XorShift128 { private uint x, y, z, w; + public XorShift128(uint seed) + { + x = seed << 13; + y = (seed >> 9) ^ (x << 6); + z = y >> 7; + w = seed; + } + + public XorShift128(ulong s0, ulong s1) : this((uint)s0, (uint)(s0 >> 32), (uint)s1, (uint)(s1 >> 32)) + { + } + public XorShift128(uint x, uint y, uint z, uint w) { this.x = x;