blob: 385d7322b3c5e38e4b026c3457b74a0c85ad4c86 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
namespace Godosa.Core.Runs;
/// <summary>Independent per-purpose seeds from one run seed: SplitMix64 output number <c>stream + 1</c> of
/// <paramref name="seed"/> (audio draws then never shift the game's stream).</summary>
public static class SeedStreams
{
public static ulong Of(ulong seed, int stream)
{
var z = unchecked(seed + (ulong)(stream + 1) * 0x9E3779B97F4A7C15UL);
z = unchecked((z ^ (z >> 30)) * 0xBF58476D1CE4E5B9UL);
z = unchecked((z ^ (z >> 27)) * 0x94D049BB133111EBUL);
return z ^ (z >> 31);
}
}
|