public int CompareTo(Wagon other)
        {
            if (LSort)
            {
                if (L_Level != other.L_Level)
                {
                    return(-1 * L_Level.CompareTo(other.L_Level));
                }
            }

            if (AlphaSort)
            {
                if (!(PlayerBeingVoted.Name.Equals(other.PlayerBeingVoted.Name)))
                {
                    return(string.Compare(PlayerBeingVoted.Name, other.PlayerBeingVoted.Name));
                }

                return(MaxTimeStamp.CompareTo(other.MaxTimeStamp));
            }
            else
            {
                if (MaxTimeStamp.CompareTo(other.MaxTimeStamp) != 0)
                {
                    return(MaxTimeStamp.CompareTo(other.MaxTimeStamp));
                }
                else
                {
                    return(GetMaxPostNumber().CompareTo(other.GetMaxPostNumber()));
                }
            }
        }
Esempio n. 2
0
 protected bool Equals(SnapshotSelectionCriteria other)
 {
     return(MaxSequenceNr == other.MaxSequenceNr &&
            MaxTimeStamp.Equals(other.MaxTimeStamp) &&
            MinSequenceNr == other.MinSequenceNr &&
            MinTimestamp.Equals(other.MinTimestamp));
 }
Esempio n. 3
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = MaxSequenceNr.GetHashCode();
         hashCode = (hashCode * 397) ^ MaxTimeStamp.GetHashCode();
         hashCode = (hashCode * 397) ^ MinSequenceNr.GetHashCode();
         hashCode = (hashCode * 397) ^ MinTimestamp.GetHashCode();
         return(hashCode);
     }
 }
Esempio n. 4
0
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 17;
         hash = hash * 23 + MaxSequenceNr.GetHashCode();
         hash = hash * 23 + MaxTimeStamp.GetHashCode();
         hash = hash * 23 + MinSequenceNr.GetHashCode();
         hash = hash * 23 + MinTimestamp.GetHashCode();
         return(hash);
     }
 }