diff --git a/BeefLibs/corlib/src/Random.bf b/BeefLibs/corlib/src/Random.bf index 87801935..3fc183cb 100644 --- a/BeefLibs/corlib/src/Random.bf +++ b/BeefLibs/corlib/src/Random.bf @@ -284,6 +284,22 @@ namespace System buffer[i] = (uint8)(InternalSample() % ((int32)UInt8.MaxValue + 1)); } } + + public void Serialize(String str) + { + inext.ToString(str, "X8", null); + inextp.ToString(str, "X8", null); + for (int i < 56) + SeedArray[i].ToString(str, "X8", null); + } + + public void Deserialize(String str) + { + inext = int32.Parse(str.Substring(0*8, 8), .Hex); + inextp = int32.Parse(str.Substring(1*8, 8), .Hex); + for (int i < 56) + SeedArray[i] = int32.Parse(str.Substring((i+2)*8, 8), .Hex); + } } static