/// <summary> /// Compares this station with another one. /// </summary> /// <param name="other"></param> /// <returns></returns> /// <exception cref="System.ArgumentNullException">other</exception> public int CompareTo(Station other) { other.ThrowIfNull(nameof(other)); return(SolarSystem != other.SolarSystem ? SolarSystem.CompareTo(other.SolarSystem) : String.Compare(Name, other.Name, StringComparison.CurrentCulture)); }
/// <summary> /// Compares this station with another one. /// </summary> /// <param name="other"></param> /// <returns></returns> /// <exception cref="System.ArgumentNullException">other</exception> public int CompareTo(Station other) { other.ThrowIfNull(nameof(other)); // Properly handle null SolarSystem, it should be equal to SolarSystem with ID = 0 SolarSystem mine = SolarSystemChecked, theirs = other.SolarSystemChecked; return(mine != theirs?mine.CompareTo(theirs) : string.Compare(Name, other.Name, StringComparison.CurrentCulture)); }