Пример #1
0
        public override string ToString()
        {
            string ls = LowestValue.Equals(minValue) ? "-Inf" : LowestValue.ToString();
            string hs = HighestValue.Equals(maxValue) ? "Inf" : HighestValue.ToString();

            return(Value.ToString() + " [" + ls + ", " + hs + "]");
        }
Пример #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id.GetHashCode();
         hashCode = (hashCode * 397) ^ TimeStamp.GetHashCode();
         hashCode = (hashCode * 397) ^ (RealmSlug?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ MeanValue.GetHashCode();
         hashCode = (hashCode * 397) ^ AdjustedMeanValue.GetHashCode();
         hashCode = (hashCode * 397) ^ LowestValue.GetHashCode();
         hashCode = (hashCode * 397) ^ HighestValue.GetHashCode();
         hashCode = (hashCode * 397) ^ Quantity;
         return(hashCode);
     }
 }
Пример #3
0
 public override dynamic GetObjectToSerialize(bool is_explicit)
 {
     IsExplicit = is_explicit;
     if (IsExplicit)
     {
         Dictionary <string, object> dict = base.GetObjectToSerialize(is_explicit) as Dictionary <string, object>;
         if (HighestValue.CompareTo(maxValue) < 0)
         {
             dict["higher_bound"] = HighestValue;
         }
         if (LowestValue.CompareTo(minValue) > 0)
         {
             dict["lower_bound"] = LowestValue;
         }
         return(dict);
     }
     return(Value);
 }
Пример #4
0
 protected bool Equals(ItemData other)
 {
     return(Id == other.Id && TimeStamp.Equals(other.TimeStamp) && string.Equals(RealmSlug, other.RealmSlug) && MeanValue.Equals(other.MeanValue) && AdjustedMeanValue.Equals(other.AdjustedMeanValue) && LowestValue.Equals(other.LowestValue) && HighestValue.Equals(other.HighestValue) && Quantity == other.Quantity);
 }