public Coordinates GetMaxEnergyPosition() { // I don't think that Coordinates should implement IComparable, so using LINQ and IComparer<Coordinates> instance it is the only way. // Without constraint to use LINQ I would've implement it another way. return(_energyObservationStorage.OrderBy(o => o.ObservationPoint, new CoordinatesComparer(new Configuration.Configuration())).Select(o => o.ObservationPoint).Last()); }
public Coordinates GetMaxEnergyPosition() { return(_observationStorage.OrderBy(obs => obs.EstimatedValue).LastOrDefault().ObservationPoint); }