Esempio n. 1
0
        private int CalculateHash()
        {
            unchecked
            {
                var hc = Ingredients.Length;
                foreach (var i in Ingredients)
                {
                    hc = hc * 314159 + i.GetHashCode();
                }

                hc ^= OverridePrecedence?.GetHashCode() ?? 0;
                return((Product.GetHashCode() * 397) ^ hc);
            }
        }
Esempio n. 2
0
 private bool Equals(ProductionRule other)
 {
     return(Product.Equals(other.Product) && Ingredients.SequenceEqual(other.Ingredients) &&
            OverridePrecedence.Equals(other.OverridePrecedence));
 }