public virtual int CompareTo(IBranchFeature other) { if (this == other) { return(0); } if (null == Branch) { throw new Exception("Cannot compare branch features that are not connected to a branch."); } if (other.Branch != branch) { return(Branch.CompareTo(other.Branch)); } if (Chainage > other.Chainage) { return(1); } if (Math.Abs(Chainage - other.Chainage) < Epsilon) { // in some cases branch features are defined at the same location and differ only in name if (Name != other.Name) { return(String.Compare(Name, other.Name, StringComparison.Ordinal)); } return(0); } return(-1); }
public int CompareTo(IBranchFeature other) { if (this == other) { return(0); } if (null == Branch) { throw new Exception("Cannot compare branch features that are not connected to a branch."); } if (other.Branch != branch) { return(Branch.CompareTo(other.Branch)); } if (Offset > other.Offset) { return(1); } return(-1); }