Exemplo n.º 1
0
        /// <summary>
        /// This method compares the given object with this point
        /// </summary>
        /// <param name="obj">Object to be compared with this point</param>
        /// <returns></returns>
#pragma warning disable 659
        public override bool Equals(object obj)
#pragma warning restore 659
        {
            if (this == obj)
            {
                return(true);
            }

            if (!(obj is Point rhs))
            {
                return(false);
            }

            return(Longitude.EqualsTo(rhs.Longitude) &&
                   Latitude.EqualsTo(rhs.Latitude) &&
                   // ReSharper disable PossibleInvalidOperationException
                   (Altitude == null && rhs.Altitude == null || Altitude.Value.EqualsTo(rhs.Altitude.Value)) &&
                   (Measure == null && rhs.Measure == null || (Measure.Value.EqualsTo(rhs.Measure.Value))));
            // ReSharper restore PossibleInvalidOperationException
        }