using System; namespace UnityAtoms { /// /// Atom Reference that where the value is implementing `IEquatable`. /// /// The type of the variable. /// IPair of type `T`. /// Constant of type `T`. /// Variable of type `T`. /// Event of type `T`. /// Event of type `IPair<T>`. /// Function of type `T => T`. /// Variable Instancer of type `T`. public abstract class EquatableAtomReference : AtomReference, IEquatable> where P : struct, IPair where C : AtomBaseVariable where V : AtomVariable where E1 : AtomEvent where E2 : AtomEvent

where F : AtomFunction where VI : AtomVariableInstancer { public EquatableAtomReference() : base() { } public EquatableAtomReference(T value) : base(value) { } public bool Equals(EquatableAtomReference other) { return base.Equals(other); } protected override bool ValueEquals(T other) { return (Value == null && other == null) || (Value != null && Value.Equals(other)); } } }