unity-atoms/Packages/Core/Runtime/References/EquatableAtomReference.cs

23 lines
869 B
C#

using System;
namespace UnityAtoms
{
public abstract class EquatableAtomReference<T, C, V, E1, E2, F, VI> : AtomReference<T, C, V, E1, E2, F, VI>, IEquatable<EquatableAtomReference<T, C, V, E1, E2, F, VI>>
where C : AtomBaseVariable<T>
where V : AtomVariable<T, E1, E2, F>
where E1 : AtomEvent<T>
where E2 : AtomEvent<T, T>
where F : AtomFunction<T, T>
where VI : AtomVariableInstancer<V, T, E1, E2, F>
{
public EquatableAtomReference() : base() { }
public EquatableAtomReference(T value) : base(value) { }
public bool Equals(EquatableAtomReference<T, C, V, E1, E2, F, VI> other) { return base.Equals(other); }
protected override bool ValueEquals(T other)
{
return (Value == null && other == null) || (Value != null && Value.Equals(other));
}
}
}