summaryrefslogtreecommitdiff
path: root/Data/AppDatabase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Data/AppDatabase.cs')
-rw-r--r--Data/AppDatabase.cs79
1 files changed, 79 insertions, 0 deletions
diff --git a/Data/AppDatabase.cs b/Data/AppDatabase.cs
new file mode 100644
index 0000000..f3897b2
--- /dev/null
+++ b/Data/AppDatabase.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using IvyBus;
+
+namespace Data
+{
+ public class AppDatabase
+ {
+ private AircraftsList listOfAircrafts;
+ private Beacon[] listOfBeacons;
+ private Route[] listOfRoutes;
+ private Sector[] listOfSectors;
+ private Horloge horloge;
+
+ #region Constructor
+
+ public AppDatabase(IvyControl IvyBus)
+ {
+ this.listOfAircrafts = new AircraftsList(IvyBus);
+ this.listOfBeacons = Beacon.LoadBeaconsFile(@Config.beaconsXmlFilePath);
+ this.listOfRoutes = Route.LoadRoutesFile(@Config.routesXmlFilePath, this);
+ this.listOfSectors = Sector.LoadSectorsFile(@Config.sectorsXmlFilePath);
+
+ this.horloge = new Horloge(IvyBus);
+ }
+ #endregion
+
+ #region Getter
+ public Sector[] getSectors()
+ {
+ return listOfSectors;
+ }
+
+ public Route[] getRoutes()
+ {
+ return listOfRoutes;
+ }
+
+ public Beacon[] getBeacons()
+ {
+ return listOfBeacons;
+ }
+
+ public int getHour()
+ {
+ return horloge.getHour();
+ }
+
+ public int getMinute()
+ {
+ return horloge.getMinute();
+ }
+
+ public int getSecond()
+ {
+ return horloge.getSecond();
+ }
+
+ public Dictionary<string, List<AircraftPosition>> getAircraftList()
+ {
+ return listOfAircrafts.getAircraftList();
+ }
+ #endregion
+
+ #region AddViewFuntions
+ public void addAircraftView(IAircraftView view)
+ {
+ listOfAircrafts.addAircraftView(view);
+ }
+
+ public void removeAircraftView(IAircraftView view)
+ {
+ listOfAircrafts.removeAircraftView(view);
+ }
+ #endregion
+ }
+}