/// <inheritdoc /> public bool Equals(BasePart other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Equals(BasePartAsset, other.BasePartAsset) && BasePartId.Equals(other.BasePartId) && InstanceId.Equals(other.InstanceId)); }
/// <inheritdoc /> public override int GetHashCode() { unchecked { // ReSharper disable NonReadonlyMemberInGetHashCode - this property is not supposed to be changed except by asset analysis var hashCode = BasePartAsset != null?BasePartAsset.GetHashCode() : 0; // ReSharper restore NonReadonlyMemberInGetHashCode hashCode = (hashCode * 397) ^ BasePartId.GetHashCode(); hashCode = (hashCode * 397) ^ InstanceId.GetHashCode(); return(hashCode); } }