The feature below amazing, I wonder how Visual studio will display it, I like it when above Properties it adds the ref count across the Solution:<p><pre><code> 3 references
public int Damage { get; }
4 references
public int Durability { get; }
public class Sword(int Damage, int Durability);
</code></pre>
This single line will result in a fully functional class:<p><pre><code> public class Sword : IEquatable<Sword>
{
public int Damage { get; }
public int Durability { get; }
public Sword(int Damage, int Durability)
{
this.Damage = Damage;
this.Durability = Durability;
}
public bool Equals(Sword other)
{
return Equals(Damage, other.Damage) && Equals(Durability, other.Durability);
}
public override bool Equals(object other)
{
return (other as Sword)?.Equals(this) == true;
}
public override int GetHashCode()
{
return (Damage.GetHashCode() * 17 + Durability.GetHashCode())
.GetValueOrDefault();
}
public static void operator is(Sword self, out int Damage, out int Durability)
{
Damage = self.Damage;
Durability = self.Durability;
}
public Sword With(int Damage = this.Damage, int Durability = this.Durability) =>
new Sword(Damage, Durability);
}</code></pre>