public int CompareToByHorsePower(Car other) { if (ReferenceEquals(this, other)) { return(0); } return(other is null ? 1 : HorsePower.CompareTo(other.HorsePower)); }
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); }