Esempio n. 1
0
        private bool AreConditionEquals(WeatherCondition condition)
        {
            if (airTemperature != condition.airTemperature)
            {
                return(false);
            }

            if (isDay != condition.isDay)
            {
                return(false);
            }

            if (description != condition.description)
            {
                return(false);
            }

            if (pressure != condition.pressure)
            {
                return(false);
            }

            if (humidity != condition.humidity)
            {
                return(false);
            }

            if (windSpeed != condition.windSpeed)
            {
                return(false);
            }

            if (windDirection.Degrees != condition.windDirection.Degrees)
            {
                return(false);
            }

            if (rain != condition.rain)
            {
                return(false);
            }

            if (cloud != condition.cloud)
            {
                return(false);
            }

            return(true);
        }
Esempio n. 2
0
        public override bool Equals(object other)
        {
            if (other == null)
            {
                return(false);
            }

            if (this.GetType() != other.GetType())
            {
                return(false);
            }

            WeatherCondition condition = other as WeatherCondition;

            if (condition != null)
            {
                return(AreConditionEquals(condition));
            }

            return(false);
        }