public static bool TryParse(string seedString, out SeedOptions options) { if (seedString.Length == Seed.Length && uint.TryParse(seedString.Substring(Seed.Length - Length), NumberStyles.HexNumber, NumberFormatInfo.CurrentInfo, out var parsedOptionsKey)) { options = new SeedOptions(parsedOptionsKey); return(true); } options = None; return(false); }
public static bool TryParse(string seedString, out Seed seed) { ExceptionLogger.SetSeedContext(seedString); if (seedString.Length == Length && uint.TryParse(seedString.Substring(0, Length - SeedOptions.Length), NumberStyles.HexNumber, NumberFormatInfo.CurrentInfo, out var parsedSeedKey) && SeedOptions.TryParse(seedString, out var options)) { seed = new Seed(parsedSeedKey, options); return(true); } seed = Zero; return(false); }
public static Seed GenerateRandom(SeedOptions options, Random random) { return(new Seed((uint)random.Next(), options)); }
public Seed(uint id, SeedOptions options) { Id = id; Options = options; }