Ejemplo n.º 1
0
        /// <summary>
        ///     Returns true if ShootEvent instances are equal
        /// </summary>
        /// <param name="other">Instance of ShootEvent to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ShootEvent other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Shooter == other.Shooter ||
                     Shooter.Equals(other.Shooter)
                     ) &&
                 (
                     Direction == other.Direction ||
                     Direction.Equals(other.Direction)
                 ) &&
                 (
                     To == other.To ||
                     To != null &&
                     To.Equals(other.To)
                 ) &&
                 (
                     HitEntitys == other.HitEntitys ||
                     HitEntitys != null &&
                     other.HitEntitys != null &&
                     HitEntitys.SequenceEqual(other.HitEntitys)
                 ));
        }