Enhance school creation functionality by introducing support for name sets in the API and UI. Update the catalog to include skills, traits, body attributes, needs, and name sets, improving character generation capabilities. Revise localization strings for better user guidance and update tests to validate the new name set functionality and ensure robustness in school creation processes.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
namespace HSchool.People;
|
||||
|
||||
/// <summary>
|
||||
/// Per-family streams derived from the school seed. Family N never consumes family N-1's rolls,
|
||||
/// so appending a thirteenth family leaves the first twelve unchanged.
|
||||
/// </summary>
|
||||
internal static class Seed
|
||||
{
|
||||
public const int ChildCountSalt = 1;
|
||||
public const int AppearanceSalt = 2;
|
||||
|
||||
public static int Mix(int schoolSeed, int familyIndex, int salt)
|
||||
{
|
||||
var z = Mix64((uint)schoolSeed);
|
||||
z = Mix64(z ^ (uint)(familyIndex + 1));
|
||||
z = Mix64(z ^ (uint)(salt + 1));
|
||||
return (int)z;
|
||||
}
|
||||
|
||||
private static ulong Mix64(ulong z)
|
||||
{
|
||||
z += 0x9E3779B97F4A7C15UL;
|
||||
z = (z ^ (z >> 30)) * 0xBF58476D1CE4E5B9UL;
|
||||
z = (z ^ (z >> 27)) * 0x94D049BB133111EBUL;
|
||||
return z ^ (z >> 31);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user