Example #1
0
 public Eu4Culture(string name, Eu4CultureGroup group, Eu4WorldBase world)
 {
     if (Name == "russian_culture")
     {
         Console.WriteLine();
     }
     IsVanilla    = true;
     Name         = name;
     Group        = group;
     MaleNames    = new List <string>();
     FemaleNames  = new List <string>();
     DynastyNames = new List <string>();
 }
Example #2
0
        public Eu4Culture(PdxSublist data, Eu4CultureGroup group, Eu4WorldBase world)
        {
            IsVanilla   = true;
            Name        = data.Key;
            DisplayName = world.Localisation.ContainsKey(Name) ? world.Localisation[Name] : Name;
            if (Name == "russian_culture")
            {
                Console.WriteLine();
            }
            if (Name == "english")
            {
                Console.WriteLine();
            }
            Group = group;
            var capital = 0;

            if (data.KeyValuePairs.ContainsKey("primary"))
            {
                PrimaryNation = data.GetString("primary");
                if (world.Countries.ContainsKey(PrimaryNation))
                {
                    capital = world.Countries[PrimaryNation].Capital;
                }
            }
            if (capital == 0)
            {
                // highest development continent out of all eu4 provinces with that culture in 1444
                Continent = world.Provinces.Values.Where(p => p.OriginalCulture == Name).GroupBy(p => p.Continent).OrderByDescending(g => g.Sum(p => p.Development)).FirstOrDefault()?.Key;
            }
            else
            {
                Continent = world.Provinces[capital].Continent;
            }

            MaleNames = new List <string>();
            data.Sublists.ForEach("male_names", (sub) =>
            {
                MaleNames.AddRange(sub.Values);
            });            // ? data.GetSublist("male_names").Values : new List<string>();
            FemaleNames = new List <string>();
            data.Sublists.ForEach("female_names", (sub) =>
            {
                FemaleNames.AddRange(sub.Values);
            });

            DynastyNames = data.Sublists.ContainsKey("dynasty_names") ? data.GetSublist("dynasty_names").Values : new List <string>();
        }