Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 05b07c94 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

gear rating: implement icomparable

parent 889f74b2
No related branches found
No related tags found
No related merge requests found
using TUGraz.VectoCommon.Utils;
using System;
using TUGraz.VectoCommon.Utils;
namespace TUGraz.VectoCore.Models.SimulationComponent.Impl {
......@@ -13,7 +14,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl {
}
internal struct GearRating
internal struct GearRating : IComparable
{
private const double CaseSeparationInterval = 1e5;
......@@ -48,5 +49,19 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl {
{
return string.Format("{0} / {1} ({2})", RatingCase, Rating, NumericValue);
}
public int CompareTo(object obj)
{
var other = (GearRating)obj;
if (other > this) {
return -1;
}
if (other < this) {
return 1;
}
return 0;
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment