using System; namespace Vellum.Generator { /// /// Says that a method saves a type built from its type parameters, as plain data an incremental generator step can /// compare between runs. /// public sealed class SaveRegistration : IEquatable { /// /// Holds the method's documentation ID. /// public readonly string Id; public readonly SaveTemplate Template; public SaveRegistration(string id, SaveTemplate template) { Id = id; Template = template; } public bool Equals(SaveRegistration other) { return other != null && Id == other.Id && Template.Equals(other.Template); } public override bool Equals(object obj) { return Equals(obj as SaveRegistration); } public override int GetHashCode() { return Id.GetHashCode() * 31 + Template.GetHashCode(); } } }