Example #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (DisplayInfo != null ? DisplayInfo.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Faction?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ Id;
         hashCode = (hashCode * 397) ^ (Image != null ? Image.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Name?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (PromotionOffer != null ? PromotionOffer.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StartingArmyOptions?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
Example #2
0
        public bool Equals(Leader other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(Equals(DisplayInfo, other.DisplayInfo) &&
                   string.Equals(Faction, other.Faction) &&
                   Id == other.Id &&
                   Equals(Image, other.Image) &&
                   string.Equals(Name, other.Name) &&
                   Equals(PromotionOffer, other.PromotionOffer) &&
                   StartingArmyOptions.OrderBy(sao => sao.Id).SequenceEqual(other.StartingArmyOptions.OrderBy(sao => sao.Id)));
        }