public void CompareTo()
        {
            TimeStamp timeStamp1 = new TimeStamp(12345.3);

            Assert.AreEqual(0.0, timeStamp.CompareTo(timeStamp1));
            timeStamp1.ModifiedJulianDay = 10000;
            Assert.IsTrue(timeStamp.CompareTo(timeStamp1) > 0.0);
            Assert.IsTrue(timeStamp1.CompareTo(timeStamp) < 0.0);
        }
Beispiel #2
0
        public int CompareTo(Highscore score)
        {
            int diff1 = (((int)Difficulty) + 1) % 4;
            int diff2 = (((int)score.Difficulty) + 1) % 4;

            if (diff1 == diff2)
            {
                float mines1 = MinesHit / (float)TotalMines;
                float mines2 = score.MinesHit / (float)score.TotalMines;

                if (mines1 == mines2)
                {
                    if (Time.Equals(score.Time))
                    {
                        return(TimeStamp.CompareTo(score.TimeStamp));
                    }

                    return(Time.CompareTo(score.Time));
                }

                return(mines1.CompareTo(mines2));
            }

            return(diff2.CompareTo(diff1));
        }
        /// <inheritdoc/>
        public virtual int CompareTo(MultiNodeMessage other)
        {
            var tc = TimeStamp.CompareTo(other.TimeStamp);

            if (tc != 0)
            {
                return(tc);
            }
            var m = string.Compare(Message, other.Message, StringComparison.Ordinal);

            if (m != 0)
            {
                return(m);
            }
            var ni = NodeIndex.CompareTo(other.NodeIndex);

            if (ni != 0)
            {
                return(ni);
            }
            var nr = string.Compare(NodeRole, other.NodeRole, StringComparison.Ordinal);

            if (nr != 0)
            {
                return(nr);
            }
            return(0);
        }
Beispiel #4
0
        public int CompareTo(Index obj)
        {
            int ret = TimeStamp.CompareTo(obj.TimeStamp);

            if (ret == 0)
            {
                ret = Grid.CompareTo(obj.Grid);
            }
            return(ret);
        }
Beispiel #5
0
        public int CompareTo(Index obj)
        {
            int compare = TimeStamp.CompareTo(obj.TimeStamp);

            if (compare == 0)
            {
                compare = Grid.CompareTo(obj.Grid);
            }
            return(compare);
        }
Beispiel #6
0
        /// <summary>Compares this <seealso cref="Guideline"/> to another primarily based on their time stamps and secondarily on their colors.</summary>
        /// <param name="other">The other <seealso cref="Guideline"/> to compare this to.</param>
        public int CompareTo(Guideline other)
        {
            int result = TimeStamp.CompareTo(other.TimeStamp);

            if (result == 0)
            {
                return(Color.CompareTo(other.Color));
            }
            return(result);
        }
Beispiel #7
0
 public int CompareTo(Message other)
 {
     if (ReferenceEquals(this, other))
     {
         return(0);
     }
     if (ReferenceEquals(null, other))
     {
         return(1);
     }
     return(TimeStamp.CompareTo(other.TimeStamp));
 }
Beispiel #8
0
        public int CompareTo(TimeGuid other)
        {
            var timeStampTicksComparison = TimeStamp.CompareTo(other.TimeStamp);

            if (timeStampTicksComparison != 0)
            {
                return(timeStampTicksComparison);
            }
            var seqComparison = Seq.CompareTo(other.Seq);

            if (seqComparison != 0)
            {
                return(seqComparison);
            }
            return(Tag.CompareTo(other.Tag));
        }
Beispiel #9
0
            public int CompareTo(TimeStampKey o)
            {
                if (o == null)
                {
                    return(1);
                }
                int c;

                if ((c = TimeStamp.CompareTo(o.TimeStamp)) != 0)
                {
                    return(c);
                }
                if ((c = _minorOrder.CompareTo(o._minorOrder)) != 0)
                {
                    return(c);
                }
                return(0);
            }
Beispiel #10
0
        public bool IsValid()
        {
            if (PreviousDeltaDfsHash == null || PreviousDeltaDfsHash.IsEmpty)
            {
                throw new InvalidDataException($"{nameof(PreviousDeltaDfsHash)} cannot be null or empty");
            }

            if (MerkleRoot == null || MerkleRoot.IsEmpty)
            {
                throw new InvalidDataException($"{nameof(MerkleRoot)} cannot be null or empty");
            }

            if (TimeStamp == null || TimeStamp.CompareTo(new Timestamp()) == 0)
            {
                throw new InvalidDataException($"{nameof(TimeStamp)} cannot be null or default");
            }

            return(true);
        }
Beispiel #11
0
        public int CompareTo(object obj)
        {
            var other = obj as Entity01;

            if (other == null)
            {
                return(0);
            }

            var x = Interval.CompareTo(other.Interval);

            if (x != 0)
            {
                return(x);
            }
            x = TimeStamp.CompareTo(other.TimeStamp);
            if (x != 0)
            {
                return(x);
            }
            x = Time.CompareTo(other.Time);
            return(x);
        }
Beispiel #12
0
 public int CompareTo(BitrateLogEntry other)
 {
     return(TimeStamp.CompareTo(other.TimeStamp));
 }
 public int CompareTo(BuySellOperation other)
 {
     return(TimeStamp.CompareTo(other.TimeStamp));
 }
Beispiel #14
0
        /// <summary>
        /// Compares the current instance with another object of the same kind.
        /// </summary>
        /// <param name="obj"<>An <c>SensorDataPod</c> object to compare with this instance./param>
        /// <returns>A value that indicates the relative order of the objects being compared.</returns>
        public int CompareTo(object obj)
        {
            SensorDataPod sdp = obj as SensorDataPod;

            return(TimeStamp.CompareTo(sdp.TimeStamp));
        }
 public int CompareTo(CastingDataInstances rhs)
 {
     return(TimeStamp.CompareTo(rhs.TimeStamp));
 }
Beispiel #16
0
 public int CompareTo(EyeTrackerOriginPose other)
 {
     return(TimeStamp.CompareTo(other.TimeStamp));
 }
Beispiel #17
0
 public int CompareTo(TimestampedItem<T> other)
 {
     return TimeStamp.CompareTo(other.TimeStamp);
 }
Beispiel #18
0
 public int CompareTo(ICommand dc)
 {
     return(TimeStamp.CompareTo(dc.TimeStamp));
 }
Beispiel #19
0
        public int CompareTo(object obj)
        {
            var other = (Log)obj;

            return(TimeStamp.CompareTo(other.TimeStamp));
        }