public int CompareToByEngineSize(Car other) { if (ReferenceEquals(this, other)) { return(0); } return(other is null ? 1 : EngineSize.CompareTo(other.EngineSize)); }
public (int, int, int, int, int) CompareCarProperties(Car other) { var comparisonTuple = ( maxSpeedComparison : MaxSpeed.CompareTo(other.MaxSpeed), accelerationComparison : Acceleration.CompareTo(other.Acceleration), cylinderComparison : Cylinders.CompareTo(other.Cylinders), engineSizeComparison : EngineSize.CompareTo(other.EngineSize), horsePowerComparison : HorsePower.CompareTo(other.HorsePower) ); return(comparisonTuple); }