예제 #1
0
 private static void OpenRunways(XElement CurrentSection)
 {
     foreach (XElement element in CurrentSection.Elements())
     {
         Runway item = new Runway {
             Number            = element.Attribute("Number").Value.ToString(),
             ReciprocalNumber  = element.Attribute("ReciprocalNumber").Value.ToString(),
             Heading           = int.Parse(element.Attribute("Heading").Value.ToString()),
             ReciprocalHeading = int.Parse(element.Attribute("ReciprocalHeading").Value.ToString()),
             StartLatitude     = GetIntFromCoord(element.Attribute("StartLatitude").Value.ToString()),
             StartLongitude    = GetIntFromCoord(element.Attribute("StartLongitude").Value.ToString()),
             EndLatitude       = GetIntFromCoord(element.Attribute("EndLatitude").Value.ToString()),
             EndLongitude      = GetIntFromCoord(element.Attribute("EndLongitude").Value.ToString())
         };
         MySector.Runways.Add(item);
     }
 }
예제 #2
0
        private static void OpenRunwaysForAirports(XElement CurrentSection)
        {
            foreach (XElement element in CurrentSection.Elements())
            {
                Runway item = new Runway {
                    Number            = element.Attribute("Number").Value.ToString(),
                    ReciprocalNumber  = element.Attribute("ReciprocalNumber").Value.ToString(),
                    Heading           = int.Parse(element.Attribute("Heading").Value.ToString()),
                    ReciprocalHeading = int.Parse(element.Attribute("ReciprocalHeading").Value.ToString()),
                    StartLatitude     = GetIntFromCoord(element.Attribute("StartLatitude").Value.ToString()),
                    StartLongitude    = GetIntFromCoord(element.Attribute("StartLongitude").Value.ToString()),
                    EndLatitude       = GetIntFromCoord(element.Attribute("EndLatitude").Value.ToString()),
                    EndLongitude      = GetIntFromCoord(element.Attribute("EndLongitude").Value.ToString())
                };
                MySector.Airports[MySector.Airports.Count - 1].Runways.Add(item);
                foreach (XElement element2 in element.Elements())
                {
                    string str = element2.Name.LocalName;
                    if (str != null)
                    {
                        if (!(str == "SIDs"))
                        {
                            if (str == "STARs")
                            {
                                goto Label_0194;
                            }
                        }
                        else if (element2.HasElements)
                        {
                            OpenSIDsForRunway(element2);
                        }
                    }
                    continue;
Label_0194:
                    if (element2.HasElements)
                    {
                        OpenSTARsForRunway(element2);
                    }
                }
            }
        }