public Eu4Province(Eu4World world, int ID, PdxSublist history) { this.World = world; this.ProvinceID = ID; Cores = new List <Eu4CountryBase>(); Modifiers = new List <string>(); LatentTradeGoods = new List <string>(); if (history.KeyValuePairs.ContainsKey("trade_goods")) { TradeGood = history.KeyValuePairs["trade_goods"]; } history.Sublists.ForEach("latent_trade_goods", (sub => { LatentTradeGoods.AddRange(sub.Values); })); if (history.FloatValues.ContainsKey("center_of_trade")) { CentreOfTradeWeight += 0.25f * history.GetFloat("center_of_trade"); } history.Sublists.ForEach("add_permanent_province_modifier", (sub) => { var mod = sub.KeyValuePairs["name"]; if (mod.Contains("estuary_modifier")) { CentreOfTradeWeight += 0.25f; } Modifiers.Add(mod); }); }
static void Main(string[] args) { var keepStartDate = !args.Contains("1444"); var save = new CK2Save("convert_it.ck2", string.Empty, keepStartDate); var eu4 = new Eu4World(save); Console.WriteLine("Done."); Console.Read(); }
public Eu4Country(Eu4World world, CK2CharacterBase holder, string tag, string file, bool vanilla, CK2Title title = null) : base(world) { title = title ?? holder.PrimaryTitle; this.title = title; DisplayNoun = title.DisplayName; DisplayAdj = title.DisplayAdj; IsVanilla = vanilla; CountryTag = tag; World = world; FileName = file; Subjects = new List <string>(); this.holder = holder; GovernmentRank = (byte)((title.Rank == TitleRank.kingdom) ? 2 : (title.Rank == TitleRank.empire ? 3 : 1)); //if (world.TitleGovernmentMapper.ContainsKey(title.Name)) //{ // Government = world.TitleGovernmentMapper[title.Name]; //} //else //{ // //TODO: proper government flavour stuff ////world.GovernmentMapper // //Government = "feudal_monarchy"; //world.GovernmentMapper[holder.GovernmentType]; //} if (holder != null) { var prov = holder.Titles.Where(t => t.Rank == TitleRank.county).Select(t => t.Province).FirstOrDefault(); PrimaryCulture = holder.Culture == prov?.Culture ? World.MapCulture(prov).Name : World.MapCulture(holder.Culture).Name; Religion = World.MapReligion(holder.Religion)?.Name; } AcceptedCultures = new List <string>(); CalcEffects(); Government = GovernmentTypeWeights.OrderByDescending(w => w.Value).First().Key; Reforms = new List <string>(); Reforms.Add(GovernmentReformWeights.OrderByDescending(w => w.Value).First().Key); }