예제 #1
0
        public RunwayUse GetUse(string designator)
        {
            RunwayUse ru = RunwayUses.SingleOrDefault(rwu => rwu.Designator == designator);

            if (ru == null)
            {
                ru = new RunwayUse(designator);
                RunwayUses.Add(ru);
            }
            return(ru);
        }
예제 #2
0
        public void ParseRunwayVfrUse(string line, List <Runway> runways)
        {
            string[]  tokens = line.Split(_splitters, StringSplitOptions.RemoveEmptyEntries);
            RunwayUse ru     = GetUse(tokens[1]);

            ru.Arrivals   = true;
            ru.Departures = true;
            ru.XpTypes.Add(XPlaneAircraftType.Prop); // Very cautious, though types from other rules for this runway will be added as well.

            Runway r = runways.SingleOrDefault(rw => rw.Designator == tokens[1]);

            if (r != null)
            {
                r.AvailableForVFR = true;
            }
        }
예제 #3
0
        public void ParseRunwayUse(string line, List <Runway> runways)
        {
            string[]  tokens = line.Split(_splitters, StringSplitOptions.RemoveEmptyEntries);
            RunwayUse ru     = GetUse(tokens[1]);

            ru.Arrivals   |= (tokens[3].Contains("arr"));
            ru.Departures |= (tokens[3].Contains("dep"));
            ru.XpTypes.AddRange(AircraftTypeConverter.XPlaneTypesFromStrings(tokens[4].Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries)));

            Runway r = runways.SingleOrDefault(rw => rw.Designator == ru.Designator);

            if (r != null)
            {
                if (ru.Arrivals)
                {
                    r.AvailableForLanding = true;
                }

                if (ru.Departures)
                {
                    r.AvailableForTakeOff = true;
                }
            }
        }