Exemplo n.º 1
0
        public override bool Equals(object other)
        {
            if (other == null || other.GetType() != GetType())
            {
                return(false);
            }

            var otherRecipe = (Recipe)other;

            return(Type.Equals(otherRecipe.Type) &&
                   Name.Equals(otherRecipe.Name) &&
                   Hearts.Equals(otherRecipe.Hearts) &&
                   Effects.OrderBy(e => e).SequenceEqual(otherRecipe.Effects.OrderBy(e => e)) &&
                   Ingredients.OrderBy(i => i).SequenceEqual(otherRecipe.Ingredients.OrderBy(i => i)));
        }