Route.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System.Collections.Generic;
  2. using System.Linq;
  3. namespace Breda_Tour.Data_
  4. {
  5. public class Route
  6. {
  7. private string _name;
  8. private string description;
  9. private List<WayPoint> _wayPoints;
  10. public List<WayPoint> WayPoints
  11. {
  12. get { return _wayPoints; }
  13. }
  14. public Route(string name, string description)
  15. {
  16. _name = name;
  17. this.description = description;
  18. _wayPoints = new List<WayPoint>();
  19. }
  20. public void Add(WayPoint waypoint)
  21. {
  22. _wayPoints.Add(waypoint);
  23. }
  24. public WayPoint Get(int index)
  25. {
  26. return _wayPoints.ElementAt(index);
  27. }
  28. public void Remove(WayPoint waypoint)
  29. {
  30. _wayPoints.Remove(waypoint);
  31. }
  32. public void CreateTestWaypoints()
  33. {
  34. _wayPoints.Add(new WayPoint(51.530805, 4.498676, "Test1", 1));
  35. _wayPoints.Add(new WayPoint(51.533461, 4.492711, "Test2", 2));
  36. _wayPoints.Add(new WayPoint(51.536998, 4.477862, "Test3", 3));
  37. _wayPoints.Add(new WayPoint(51.531285, 4.475394, "Test4", 4));
  38. _wayPoints.Add(new WayPoint(51.531566, 4.466747, "Test5", 5));
  39. }
  40. }
  41. }