using System;
namespace UnityEngine.XR.ARFoundation
{
///
/// Holds data relevant to the event.
///
public struct ARFaceUpdatedEventArgs : IEquatable
{
///
/// The component that was updated.
///
public ARFace face { get; private set; }
///
/// Constructor invoked by the which triggered the event.
///
/// The component that was updated.
/// Thrown if is `null`.
public ARFaceUpdatedEventArgs(ARFace face)
{
if (face == null)
throw new ArgumentNullException(nameof(face));
this.face = face;
}
///
/// Generates a hash suitable for use with containers like `HashSet` and `Dictionary`.
///
/// A hash code generated from this object's fields.
public override int GetHashCode() => HashCodeUtil.ReferenceHash(face);
///
/// Tests for equality.
///
/// The `object` to compare against.
/// `True` if is of type and
/// also returns `true`; otherwise `false`.
public override bool Equals(object obj) => obj is ARFaceUpdatedEventArgs other && Equals(other);
///
/// Tests for equality.
///
/// The other to compare against.
/// `True` if every field in is equal to this , otherwise false.
public bool Equals(ARFaceUpdatedEventArgs other) => face == other.face;
///
/// Tests for equality. Same as .
///
/// The left-hand side of the comparison.
/// The right-hand side of the comparison.
/// `True` if is equal to , otherwise `false`.
public static bool operator==(ARFaceUpdatedEventArgs lhs, ARFaceUpdatedEventArgs rhs) => lhs.Equals(rhs);
///
/// Tests for inequality. Same as `!`.
///
/// The left-hand side of the comparison.
/// The right-hand side of the comparison.
/// `True` if is not equal to , otherwise `false`.
public static bool operator!=(ARFaceUpdatedEventArgs lhs, ARFaceUpdatedEventArgs rhs) => !lhs.Equals(rhs);
}
}