Пример #1
0
        public static void AssignAll()
        {
            listActive = new List <Controller>();

            if (isSet)
            {
                foreach (Controller ctlCtl in list)
                {
                    ctlCtl.Reset();
                    if (ctlCtl.SetClient())
                    {
                        listActive.Add(ctlCtl);
                    }
                }
            }
            else
            {
                foreach (Controller ctlCtl in list)
                {
                    if (ctlCtl.SetClient())
                    {
                        listActive.Add(ctlCtl);
                    }
                }
            }

            isSet = true;
            Airspace.AssignAll();
        }
Пример #2
0
 public OwnedAirspace(Airspace _airspace, OwnershipBase _base) : base(_base)
 {
     aspAirspace = _airspace;
 }
Пример #3
0
 public OwnedAirspace(Airspace _airspace, bool _approach, int _min, int _max) : base(_approach, _min, _max)
 {
     aspAirspace = _airspace;
 }
Пример #4
0
 public void Add(Airspace _airspace, Owner _owner)
 {
     listOwned.Add(new OwnedAirspace(_airspace, _owner));
 }
Пример #5
0
        public static void LoadFiles()
        {
            if (!Directory.Exists(strDataDirectory))
            {
                Directory.CreateDirectory(strDataDirectory);
            }

            if (!Directory.Exists(strPrefsDirectory))
            {
                Directory.CreateDirectory(strPrefsDirectory);
            }

            List <Task> listStandaloneTasks = new List <Task>();

            listStandaloneTasks.Add(Country.Load(Country.strDataFile));
            listStandaloneTasks.Add(FIR.Load(FIR.strDataFile));

            Task tskFavs = Client.LoadFavs();

            string[] strarrDirectories = Directory.GetDirectories(strDataDirectory);

            for (int i = 0; i < strarrDirectories.Length; i++)
            {
                strarrDirectories[i] = strarrDirectories[i].Split('\\').Last();
            }

            Controller.list = new List <Controller>();
            List <Task> listControllerTasks = new List <Task>();

            foreach (string strStr in strarrDirectories)
            {
                listControllerTasks.Add(Controller.Load(strStr));
            }

            Task.WaitAll(listControllerTasks.ToArray());
            Controller.SortAsync().Wait();

            Task.WaitAll(listStandaloneTasks.ToArray());

            Airport.Load(Airport.strDataFile, Airport.strFavFile).Wait();

            Runway.list = new List <Runway>();
            List <Task> listRunwayTasks = new List <Task>();

            foreach (string strStr in strarrDirectories)
            {
                listRunwayTasks.Add(Runway.Load(strStr));
            }

            Task.WaitAll(listRunwayTasks.ToArray());

            Runway.listSorted = Runway.Sort(Runway.list);
            Runway.LoadCurrents(Runway.strCurrentFile);

            Sector.list = new List <Sector>();
            List <Task> listSectorTasks = new List <Task>();

            foreach (string strStr in strarrDirectories)
            {
                listSectorTasks.Add(Sector.Load(strStr));
            }

            Task.WaitAll(listSectorTasks.ToArray());
            Sector.SortAsync().Wait();

            Airspace.list = new List <Airspace>();
            List <Task> listAirspaceTasks = new List <Task>();

            foreach (string strStr in strarrDirectories)
            {
                listAirspaceTasks.Add(Airspace.Load(strStr));
            }

            Task.WaitAll(listAirspaceTasks.ToArray());
            Airspace.listSorted = Airspace.Sort(Airspace.list);

            Task.WaitAll(tskFavs);
        }