Beispiel #1
0
        public World(string xmlFile, string historyFile, string sitesAndPopulationsFile, string mapFile)
        {
            ParsingErrors = new ParsingErrors();
                Log = new StringBuilder();
                Log.AppendLine("Start: " + DateTime.Now.ToLongTimeString());

                CreateUnknowns();

                XMLParser xml = new XMLParser(this, xmlFile);
                xml.Parse();
                HistoryParser history = new HistoryParser(this, historyFile);
                Log.Append(history.Parse());
                SitesAndPopulationsParser sitesAndPopulations = new SitesAndPopulationsParser(this, sitesAndPopulationsFile);
                sitesAndPopulations.Parse();
                ProcessHFtoEntityLinks();

                HistoricalFigure.Filters = new List<string>();
                Site.Filters = new List<string>();
                WorldRegion.Filters = new List<string>();
                UndergroundRegion.Filters = new List<string>();
                Entity.Filters = new List<string>();
                War.Filters = new List<string>();
                Battle.Filters = new List<string>();
                SiteConquered.Filters = new List<string>();
                Era.Filters = new List<string>();
                BeastAttack.Filters = new List<string>();
                Artifact.Filters = new List<string>();

                GenerateCivIdenticons();

                GenerateMaps(mapFile);

                Log.AppendLine(ParsingErrors.Print());
                Log.AppendLine("Finish: " + DateTime.Now.ToLongTimeString());
        }
Beispiel #2
0
        public World(string xmlFile, string historyFile, string sitesAndPopulationsFile, string mapFile)
        {
            ParsingErrors = new ParsingErrors();
                Log = new StringBuilder();
                Log.AppendLine("Start: " + DateTime.Now.ToLongTimeString());

                CreateUnknowns();

                XMLParser xml = new XMLParser(this, xmlFile);
                xml.Parse();
                HistoryParser history = new HistoryParser(this, historyFile);
                Log.Append(history.Parse());
                SitesAndPopulationsParser sitesAndPopulations = new SitesAndPopulationsParser(this, sitesAndPopulationsFile);
                sitesAndPopulations.Parse();

                HistoricalFigure.Filters = new List<string>();
                Site.Filters = new List<string>();
                WorldRegion.Filters = new List<string>();
                UndergroundRegion.Filters = new List<string>();
                Entity.Filters = new List<string>();
                War.Filters = new List<string>();
                Battle.Filters = new List<string>();
                SiteConquered.Filters = new List<string>();
                Era.Filters = new List<string>();
                BeastAttack.Filters = new List<string>();
                Artifact.Filters = new List<string>();

                GenerateCivIdenticons();

                GenerateMaps(mapFile);

                //DeathCauses = Events.OfType<LegendsViewer.HFDied>().Select(death => death.Cause).GroupBy(death => death).Select(death => death.Key).OrderBy(death => death.GetDescription()).ToList();
                Log.AppendLine(ParsingErrors.Print());
                Log.AppendLine("Finish: " + DateTime.Now.ToLongTimeString());
        }
Beispiel #3
0
        private List <Property> EntityEntityLinks      = new List <Property>(); // legends_plus.xml

        public World(string xmlFile, string historyFile, string sitesAndPopulationsFile, string mapFile)
        {
            MainRaces.Clear();
            ParsingErrors = new ParsingErrors();
            Log           = new StringBuilder();
            Log.AppendLine("Start: " + DateTime.Now.ToLongTimeString());
            Log.AppendLine();

            CreateUnknowns();

            XMLParser xml = new XMLParser(this, xmlFile);

            xml.Parse();
            HistoryParser history = new HistoryParser(this, historyFile);

            Log.Append(history.Parse());
            SitesAndPopulationsParser sitesAndPopulations = new SitesAndPopulationsParser(this, sitesAndPopulationsFile);

            sitesAndPopulations.Parse();
            ProcessHFtoEntityLinks();

            HistoricalFigure.Filters  = new List <string>();
            Site.Filters              = new List <string>();
            WorldRegion.Filters       = new List <string>();
            UndergroundRegion.Filters = new List <string>();
            Entity.Filters            = new List <string>();
            War.Filters           = new List <string>();
            Battle.Filters        = new List <string>();
            SiteConquered.Filters = new List <string>();
            Era.Filters           = new List <string>();
            BeastAttack.Filters   = new List <string>();
            Artifact.Filters      = new List <string>();

            GenerateCivIdenticons();

            GenerateMaps(mapFile);

            Log.AppendLine(ParsingErrors.Print());
            Log.AppendLine("Finish: " + DateTime.Now.ToLongTimeString());
        }
Beispiel #4
0
        private readonly List <Property> _entityEntityLinks      = new List <Property>(); // legends_plus.xml

        public World(string xmlFile, string historyFile, string sitesAndPopulationsFile, string mapFile, string xmlPlusFile)
        {
            Stopwatch sw = new Stopwatch();

            sw.Start();

            MainRaces.Clear();
            ParsingErrors = new ParsingErrors();
            Log           = new StringBuilder();

            CreateUnknowns();

            XmlParser xml = new XmlParser(this, xmlFile);

            xml.Parse();

            if (!string.IsNullOrEmpty(xmlPlusFile))
            {
                var xmlPlus = new XmlPlusParser(this, xmlPlusFile);
                xmlPlus.Parse();
            }

            HistoryParser history = new HistoryParser(this, historyFile);

            Log.Append(history.Parse());
            SitesAndPopulationsParser sitesAndPopulations = new SitesAndPopulationsParser(this, sitesAndPopulationsFile);

            sitesAndPopulations.Parse();

            ProcessHFtoEntityLinks();
            ResolveStructureProperties();
            ResolveMountainPeakToRegionLinks();
            ResolveSiteToRegionLinks();
            ResolveHfToEntityPopulation();
            ResolveArtifactProperties();
            ResolveArtformEventsProperties();

            HistoricalFigure.Filters  = new List <string>();
            Site.Filters              = new List <string>();
            WorldRegion.Filters       = new List <string>();
            UndergroundRegion.Filters = new List <string>();
            Entity.Filters            = new List <string>();
            War.Filters           = new List <string>();
            Battle.Filters        = new List <string>();
            SiteConquered.Filters = new List <string>();
            List <string> eraFilters = new List <string>();

            foreach (var eventInfo in AppHelpers.EventInfo)
            {
                eraFilters.Add(eventInfo[0]);
            }
            Era.Filters               = eraFilters;
            BeastAttack.Filters       = new List <string>();
            Artifact.Filters          = new List <string>();
            WrittenContent.Filters    = new List <string>();
            WorldConstruction.Filters = new List <string>();
            Structure.Filters         = new List <string>();

            GenerateCivIdenticons();

            GenerateMaps(mapFile);

            Log.AppendLine(ParsingErrors.Print());

            sw.Stop();
            Log.AppendLine($"Duration: {sw.Elapsed.Seconds + sw.Elapsed.Minutes * 60} secs, {sw.Elapsed.Milliseconds:D3} ms ");
        }