Пример #1
0
        public Registry()
        {
            PilotNamesSet   = new HashSet <string>();
            SquadNamesSet   = new HashSet <string>();
            ModelSet        = new HashSet <string>();
            TourDefinitions = new TourDefinitions();

            _pilotDictionary  = new CaseInsensitiveDictionary <PilotStats>();
            _pilotScoreObjMap = new CaseInsensitiveDictionary <SortableList <AcesHighPilotScore> >();
            _pilotStatsObjMap = new CaseInsensitiveDictionary <SortableList <AcesHighPilotStats> >();
            _squadList        = new List <Squad>();

            PopulatePilotList();
            PopulateSquadList();
            BuildStatsRegistry();
        }
Пример #2
0
        public TourDefinitions GetTourDefinitions(string scoresUrl, ProxySettingsDTO proxySettings)
        {
            var definitions = new TourDefinitions();

            var xDoc = _loader.LoadHtmlPageAsXmlByGet(scoresUrl, proxySettings);

            var xformer = new XSLT2Transformer(xDoc, new XmlTextReader(@"TourListTransform.xslt"));
            var transformedTourListDoc = xformer.DoTransform();

            foreach (XmlNode xNode in transformedTourListDoc.SelectNodes("/AHTourList/AHTourNode"))
            {
                definitions.AddTourToMap(new TourNode(xNode));
            }

            if (!definitions.IsTourDefinitionsComplete())
            {
                throw new ApplicationException("Failed to build Tour Map!");
            }

            return(definitions);
        }
Пример #3
0
 public TourDefinitionLoader(IHtmlToXMLLoader loader)
 {
     _definitions = new TourDefinitions();
     _loader      = loader;
 }