Esempio n. 1
0
        /// <summary>
        /// Determines whether this instance and another specified <see cref="GameModel"/> are the same
        /// </summary>
        /// <param name="obj">The object to compare to this instance</param>
        /// <returns><b>True</b> of the object of the obj parameter is the same as the current instance</returns>
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            if (!this.GetType().IsAssignableFrom(obj.GetType()))
            {
                return(false);
            }
            GameModel other = (GameModel)obj;

            if (!Type.Equals(other.Type))
            {
                return(false);
            }

            if (GamePath == null)
            {
                if (other.GamePath != null)
                {
                    return(false);
                }
            }
            else if (!GamePath.Equals(other.GamePath))
            {
                return(false);
            }

            if (LauncherPath == null)
            {
                if (other.LauncherPath != null)
                {
                    return(false);
                }
            }
            else if (!LauncherPath.Equals(other.LauncherPath))
            {
                return(false);
            }

            return(this.GetHashCode() == obj.GetHashCode());
        }