diff --git a/NavCityBreda/Model/Route.cs b/NavCityBreda/Model/Route.cs index 786e678..322af44 100644 --- a/NavCityBreda/Model/Route.cs +++ b/NavCityBreda/Model/Route.cs @@ -1,12 +1,48 @@ -using System; +using NavCityBreda.Helpers; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Windows.Devices.Geolocation; namespace NavCityBreda.Model { - class Route + public class Route { + private GeoboundingBox _bounds; + public GeoboundingBox Bounds { get { if (_bounds == null) CalculateBounds(); return _bounds; } } + + public string Name { get; private set; } + public string Description { get; private set; } + public string Landmarks { get; private set; } + public int Minutes { get; private set; } + + private List _waypoints; + public List Waypoints { get { return _waypoints; } } + + public Route(string name, string desc, string landmarks, int minutes) + { + Name = name; + Description = desc; + Landmarks = landmarks; + Minutes = minutes; + _waypoints = new List(); + } + + public void Add(Waypoint w) + { + _waypoints.Add(w); + } + + public void Remove(Waypoint w) + { + _waypoints.Remove(w); + } + + private void CalculateBounds() + { + _bounds = BoundingBox.GetBoundingBox(_waypoints.Select(p => p.Location).ToList()); + } } }