Beispiel #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();
        }
        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);
        }
 public TourDefinitionLoader(IHtmlToXMLLoader loader)
 {
     _definitions = new TourDefinitions();
     _loader      = loader;
 }