public GeoCoordinate NextStep(GeoCoordinate actualLocation) { if (!Waypoints.Any()) { return(_lastNextStep ?? (_lastNextStep = actualLocation)); } do { _lastNextStep = Waypoints.FirstOrDefault(); Waypoints.Remove(_lastNextStep); } while (actualLocation.GetDistanceTo(_lastNextStep) < 20 || Waypoints.Any()); return(_lastNextStep); }
public void LoadWaypoints(ISerializer s) { if ((Movement & MovementType.RandomMask) != 0) { var wp = Waypoints?.FirstOrDefault() ?? new Waypoint(); wp.X = s.UInt8("X", wp.X); wp.Y = s.UInt8("Y", wp.Y); Waypoints = new[] { wp }; } else { Waypoints ??= new Waypoint[0x480]; for (int i = 0; i < Waypoints.Length; i++) { Waypoints[i].X = s.UInt8(null, Waypoints[i].X); Waypoints[i].Y = s.UInt8(null, Waypoints[i].Y); } } }
public static WaypointData GetWaypointByWorldId(int worldId) { return(Waypoints.FirstOrDefault(o => o.Value.WorldSnoId == worldId).Value); }
public static WaypointData GetWaypointByLevelAreaId(int levelAreaId) { return(Waypoints.FirstOrDefault(o => o.Value.LevelAreaSnoId == levelAreaId).Value); }
public Point GetPointById(string id) => Waypoints.FirstOrDefault(p => p.ID == id);