Esempio n. 1
0
        /// <summary>
        /// Determines whether specified instance of <see cref="SteamGameInfo" /> is equal to caller
        /// object.
        /// </summary>
        /// <param name="other">Other object to compare.</param>
        /// <returns><c>true</c> if values are memberwise equals, <c>false</c> otherwise.</returns>
        private bool IsEqual(SteamGameInfo other)
        {
            // Note: list with genre IDs usually has only few items and that is why comparison
            // using contains method is considered the best option here.

            return(Price.Equals(other.Price) &&
                   RequiredAge.Equals(other.RequiredAge) &&
                   GenreIds.All(genreId => other.GenreIds.Contains(genreId)) &&
                   string.Equals(PosterPath, other.PosterPath, StringComparison.Ordinal));
        }
Esempio n. 2
0
        /// <summary>
        /// Determines whether specified instance of <see cref="OmdbMovieInfo" /> is equal to caller
        /// object.
        /// </summary>
        /// <param name="other">Other object to compare.</param>
        /// <returns><c>true</c> if values are memberwise equals, <c>false</c> otherwise.</returns>
        private bool IsEqual(OmdbMovieInfo other)
        {
            // Note: list with genre IDs usually has only few items and that is why comparison
            // using contains method is considered the best option here.

            return(string.Equals(Rated, other.Rated, StringComparison.Ordinal) &&
                   Metascore.Equals(other.Metascore) &&
                   GenreIds.All(genreId => other.GenreIds.Contains(genreId)) &&
                   string.Equals(PosterPath, other.PosterPath, StringComparison.Ordinal));
        }
Esempio n. 3
0
        /// <summary>
        /// Determines whether specified instance of <see cref="TmdbMovieInfo" /> is equal to caller
        /// object.
        /// </summary>
        /// <param name="other">Other object to compare.</param>
        /// <returns><c>true</c> if values are memberwise equals, <c>false</c> otherwise.</returns>
        private bool IsEqual(TmdbMovieInfo other)
        {
            // Note: list with genre IDs usually has only few items and that is why comparison
            // using contains method is considered the best option here.

            const double eps = 1e-6;

            return(Math.Abs(Popularity - other.Popularity) < eps &&
                   Adult.Equals(other.Adult) &&
                   GenreIds.All(genreId => other.GenreIds.Contains(genreId)) &&
                   string.Equals(PosterPath, other.PosterPath, StringComparison.Ordinal));
        }