// TODO: Consider utilizing Parallel.For to speed this up a tad public BHGw2Api.Landmark GetClosestWaypoint(BHGw2Api.Landmark landmark) { BHGw2Api.Landmark closestWp = null; float distance = float.MaxValue; var staticPos = new Vector2((float)landmark.Coordinates.X, (float)landmark.Coordinates.Y); foreach (var wp in PointsOfInterest.Values.Where(poi => poi.Type == "waypoint" && landmark != poi)) { var pos = new Vector2((float)wp.Coordinates.X, (float)wp.Coordinates.Y); var netDist = Vector2.Distance(staticPos, pos); if (netDist < distance) { closestWp = wp; distance = netDist; } } return(closestWp); }
public WordScoreResult(BHGw2Api.Landmark landmark, int diffScore) { this.Landmark = landmark; this.DiffScore = diffScore; }