public Eu4Culture AddCulture(PdxSublist data, Eu4WorldBase world) { var culture = new Eu4Culture(data, this, world); Cultures.Add(culture); return(culture); }
public Eu4Religion AddReligion(PdxSublist value, Eu4WorldBase world) { var religion = new Eu4Religion(value, this, world); Religions.Add(religion); return(religion); }
public Eu4Religion AddReligion(string name, Eu4WorldBase world) { var religion = new Eu4Religion(name, this, world); Religions.Add(religion); return(religion); }
public Eu4Culture AddCulture(string name, Eu4WorldBase world, bool vanilla = true, string display = null) { var culture = new Eu4Culture(name, this, world); culture.DisplayName = display; Cultures.Add(culture); if (!vanilla) { culture.IsVanilla = false; } return(culture); }
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>(); }
public Eu4CultureGroup(PdxSublist data, Eu4WorldBase world) : this(data.Key) { GraphicalCulture = data.KeyValuePairs.ContainsKey("graphical_culture") ? data.GetString("graphical_culture") : null; DisplayName = world.Localisation[data.Key]; //foreach(var sub in data.Sublists) //{ // if (sub.Value.KeyValuePairs.ContainsKey("primary")) // { // Cultures.Add(new Eu4Culture(sub.Value, this)); // } //} }
public Eu4SuperRegion(string name, PdxSublist value, Eu4WorldBase world) { Name = name; Regions = new HashSet <Eu4Region>(value.Values.Where(an => world.Regions.ContainsKey(an)).Select(an => world.Regions[an])); foreach (var region in Regions) { if (region.SuperRegion != null) { System.Console.WriteLine($"WARNING: {region.Name} exists in multiple regions!"); } region.SuperRegion = this; } }
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>(); }
public Eu4Region(string name, PdxSublist value, Eu4WorldBase world) { Name = name; if (value.Sublists.ContainsKey("areas")) { Areas = new HashSet <Eu4Area>(value.Sublists["areas"].Values.Where(an => world.Areas.ContainsKey(an)).Select(an => world.Areas[an])); foreach (var area in Areas) { if (area.Region != null) { System.Console.WriteLine($"WARNING: {area.Name} exists in multiple regions!"); } area.Region = this; } } }
public Eu4CountryBase(Eu4WorldBase world) { World = world; }
public Eu4ReligionGroup(string name, Eu4WorldBase world, string displayName) { Name = name; Religions = new List <Eu4Religion>(); DisplayName = displayName; }
public Eu4ReligionGroup(string name, Eu4WorldBase world) : this(name, world, world.Localisation[name]) { }
public Eu4Religion(string name, Eu4ReligionGroup group, Eu4WorldBase world) { Name = name; Group = group; }
public Eu4Religion(PdxSublist data, Eu4ReligionGroup group, Eu4WorldBase world) : this(data.Key, group, world) { Colour = new Colour(data.GetSublist("color").FloatValues[string.Empty]); Icon = (int)data.GetFloat("icon"); DisplayName = world.Localisation[data.Key]; }