Ejemplo n.º 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = ImpulseStatCounts?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (ImpulseTimelapses?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (MedalStatCounts?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (MedalTimelapses?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
Ejemplo n.º 2
0
        public bool Equals(FlexibleStats other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

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

            return(ImpulseStatCounts.OrderBy(isc => isc.Id).SequenceEqual(other.ImpulseStatCounts.OrderBy(isc => isc.Id)) &&
                   ImpulseTimelapses.OrderBy(it => it.Id).SequenceEqual(other.ImpulseTimelapses.OrderBy(it => it.Id)) &&
                   MedalStatCounts.OrderBy(msc => msc.Id).SequenceEqual(other.MedalStatCounts.OrderBy(msc => msc.Id)) &&
                   MedalTimelapses.OrderBy(mt => mt.Id).SequenceEqual(other.MedalTimelapses.OrderBy(mt => mt.Id)));
        }