예제 #1
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;

                if (Mode != null)
                {
                    hashCode = hashCode * 59 + Mode.GetHashCode();
                }

                if (Direction != null)
                {
                    hashCode = hashCode * 59 + Direction.GetHashCode();
                }

                if (FromCurrent != null)
                {
                    hashCode = hashCode * 59 + FromCurrent.GetHashCode();
                }

                if (Frame != null)
                {
                    hashCode = hashCode * 59 + Frame.GetHashCode();
                }

                if (Transition != null)
                {
                    hashCode = hashCode * 59 + Transition.GetHashCode();
                }

                return(hashCode);
            }
        }
예제 #2
0
        /// <inheritdoc />
        public bool Equals([AllowNull] Animation other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Mode == other.Mode ||
                     Mode != null &&
                     Mode.Equals(other.Mode)
                     ) &&
                 (
                     Direction == other.Direction ||
                     Direction != null &&
                     Direction.Equals(other.Direction)
                 ) &&
                 (
                     FromCurrent == other.FromCurrent ||
                     FromCurrent != null &&
                     FromCurrent.Equals(other.FromCurrent)
                 ) &&
                 (
                     Frame == other.Frame ||
                     Frame != null &&
                     Frame.Equals(other.Frame)
                 ) &&
                 (
                     Transition == other.Transition ||
                     Transition != null &&
                     Transition.Equals(other.Transition)
                 ));
        }