unity-atoms/Packages/Core/Runtime/Variables/EquatableAtomVariable.cs
2020-03-18 02:00:18 +01:00

19 lines
523 B
C#

using System;
namespace UnityAtoms
{
[EditorIcon("atom-icon-lush")]
public abstract class EquatableAtomVariable<T, P, E1, E2, F> : AtomVariable<T, P, E1, E2, F>
where T : IEquatable<T>
where P : struct, IPair<T>
where E1 : AtomEvent<T>
where E2 : AtomEvent<P>
where F : AtomFunction<T, T>
{
protected override bool ValueEquals(T other)
{
return (_value == null && other == null) || (_value != null && _value.Equals(other));
}
}
}