namespace Mr.BrickAdventures.Progression; /// /// Stable identity of an Achievement, matching the authored AchievementResource id that Steam /// also keys on. /// public readonly struct AchievementId : IEquatable { public string Value { get; } private AchievementId(string value) => Value = value; public static AchievementId Of(string value) => string.IsNullOrWhiteSpace(value) ? throw new ArgumentException("An achievement id cannot be blank.", nameof(value)) : new AchievementId(value); public bool Equals(AchievementId other) => string.Equals(Value, other.Value, StringComparison.Ordinal); public override bool Equals(object? obj) => obj is AchievementId other && Equals(other); public override int GetHashCode() => StringComparer.Ordinal.GetHashCode(Value ?? string.Empty); public override string ToString() => Value; }