public void TokenCallback(ParadoxParser parser, string token) { switch (token) { case "id": Id = parser.ReadInt32(); break; case "type": Type = parser.ReadInt32(); break; } }
public void TokenCallback(ParadoxParser parser, string token) { if (token == "id") { Id = parser.ReadInt32(); } else if (token == "type") { Type = parser.ReadInt32(); } }
private static void ParseMiscRules(ParadoxParser parser, string tag) { switch (tag) { case "liege_culture_chance": m_ruleset.LiegeCultureChance = parser.ReadInt32(); break; case "liege_religion_chance": m_ruleset.LiegeReligionChance = parser.ReadInt32(); break; case "female_ruler_chance": m_ruleset.FemaleRulerChance = parser.ReadInt32(); break; case "ruler_spouse_chance": m_ruleset.RulerSpouseChance = parser.ReadInt32(); break; case "reps_force_custom_duchies": m_ruleset.RepsForceCustomDuchies = parser.ReadBool(); break; case "rep_expand_chance": m_ruleset.RepublicExpandChance = parser.ReadInt32(); break; case "rep_expand_max": m_ruleset.RepublicExpandMax = parser.ReadInt32(); break; case "empire_min_size": m_ruleset.EmpireMinSize = parser.ReadInt32(); break; case "kingdom_min_size": m_ruleset.KingdomMinSize = parser.ReadInt32(); break; case "duchy_min_size": m_ruleset.DuchyMinSize = parser.ReadInt32(); break; case "clear_characters": m_ruleset.ClearCharacters = parser.ReadBool(); break; case "character_start_id": m_ruleset.CharacterStartID = parser.ReadInt32(); break; } }
public void TokenCallback(ParadoxParser parser, string token) { switch (token) { case "actual_added_value": actualAddedValue = parser.ReadInt32(); break; case "value": value = parser.ReadInt32(); break; case "from": from = parser.ReadInt32(); break; case "modifier": modifier = parser.Parse(new Cid()); break; } }
public void TokenCallback(ParadoxParser parser, string token) { switch (token) { case "adm_tech": AdmTech = parser.ReadInt32(); break; case "dip_tech": DipTech = parser.ReadInt32(); break; case "mil_tech": MilTech = parser.ReadInt32(); break; } }
private static void ParseCultureGenRules(ParadoxParser parser, string tag) { switch (tag) { case "dynasty_prefix": m_ruleset.CulGenDynastyPrefix = parser.ReadInt32(); break; case "bastard_prefix": m_ruleset.CulGenBastardPrefix = parser.ReadInt32(); break; case "patronym_is_prefix": m_ruleset.CulGenPatronymIsPrefix = parser.ReadInt32(); break; case "male_patronym": m_ruleset.CulGenMalePatronym = parser.ReadInt32(); break; case "female_patronym": m_ruleset.CulGenFemalePatronym = parser.ReadInt32(); break; case "ancestor_name": m_ruleset.CulGenAncestorName = parser.ReadInt32(); break; case "disinherit_from_blinding": m_ruleset.CulGenDisinheritFromBlinding = parser.ReadInt32(); break; case "dukes_called_kings": m_ruleset.CulGenDukesCalledKings = parser.ReadInt32(); break; case "founder_names_dynasty": m_ruleset.CulGenFounderNamesDynasty = parser.ReadInt32(); break; case "dynasty_title_names": m_ruleset.CulGenDynastyTitleNames = parser.ReadInt32(); break; } }
private void ParseProvinceData(ParadoxParser parser, string tag) { if (tag.StartsWith("b_")) { m_curProv.Settlements.Add(new Settlement(tag, parser.ReadString())); return; } if (Char.IsDigit(tag[0])) { // Should be an event date. Option.ParseGeneric(parser, tag); m_curProv.History.Add((EventOption)Option.GetLastRoot()); return; } switch (tag) { case "max_settlements": m_curProv.MaxSettlements = parser.ReadInt32(); break; case "title": m_curProv.Title = parser.ReadString(); break; case "culture": m_curProv.Culture = parser.ReadString(); break; case "religion": m_curProv.Religion = parser.ReadString(); break; case "terrain": m_curProv.Terrain = parser.ReadString(); break; } }
private void ParseMap(ParadoxParser parser, string s) { IList <int> intList; switch (s) { case "max_provinces": MaxProvinces = parser.ReadInt32(); break; #region File List case "definitions": Definitions = parser.ReadString(); break; case "provinces": Provinces = parser.ReadString(); break; case "positions": Positions = parser.ReadString(); break; case "terrain": Terrain = parser.ReadString(); break; case "rivers": Rivers = parser.ReadString(); break; case "terrain_definition": TerrainDefinition = parser.ReadString(); break; case "heightmap": Heightmap = parser.ReadString(); break; case "tree_definition": TreeDefinition = parser.ReadString(); break; case "continent": Continent = parser.ReadString(); break; case "adjacencies": Adjacencies = parser.ReadString(); break; case "climate": Climate = parser.ReadString(); break; case "region": Region = parser.ReadString(); break; case "static": Static = parser.ReadString(); break; #endregion case "sea_zones": intList = parser.ReadIntList(); SeaZones.Add(new SeaZone(intList[0], intList[1])); break; case "ocean_region": parser.ReadString(); OceanRegions.Add(parser.ReadIntList().ToList()); break; case "tree": Tree.AddRange(parser.ReadIntList().ToList()); break; case "major_rivers": MajorRivers.AddRange(parser.ReadIntList()); break; } }
public void TokenCallback(ParadoxParser parser, string token) { value = parser.ReadInt32() + 1; }
private static void ParseMiscRules( ParadoxParser parser, string tag ) { switch ( tag ) { case "liege_culture_chance": m_ruleset.LiegeCultureChance = parser.ReadInt32(); break; case "liege_religion_chance": m_ruleset.LiegeReligionChance = parser.ReadInt32(); break; case "female_ruler_chance": m_ruleset.FemaleRulerChance = parser.ReadInt32(); break; case "ruler_spouse_chance": m_ruleset.RulerSpouseChance = parser.ReadInt32(); break; case "reps_force_custom_duchies": m_ruleset.RepsForceCustomDuchies = parser.ReadBool(); break; case "rep_expand_chance": m_ruleset.RepublicExpandChance = parser.ReadInt32(); break; case "rep_expand_max": m_ruleset.RepublicExpandMax = parser.ReadInt32(); break; case "empire_min_size": m_ruleset.EmpireMinSize = parser.ReadInt32(); break; case "kingdom_min_size": m_ruleset.KingdomMinSize = parser.ReadInt32(); break; case "duchy_min_size": m_ruleset.DuchyMinSize = parser.ReadInt32(); break; case "clear_characters": m_ruleset.ClearCharacters = parser.ReadBool(); break; case "character_start_id": m_ruleset.CharacterStartID = parser.ReadInt32(); break; } }
private static void ParseCultureGenRules( ParadoxParser parser, string tag ) { switch ( tag ) { case "dynasty_prefix": m_ruleset.CulGenDynastyPrefix = parser.ReadInt32(); break; case "bastard_prefix": m_ruleset.CulGenBastardPrefix = parser.ReadInt32(); break; case "patronym_is_prefix": m_ruleset.CulGenPatronymIsPrefix = parser.ReadInt32(); break; case "male_patronym": m_ruleset.CulGenMalePatronym = parser.ReadInt32(); break; case "female_patronym": m_ruleset.CulGenFemalePatronym = parser.ReadInt32(); break; case "ancestor_name": m_ruleset.CulGenAncestorName = parser.ReadInt32(); break; case "disinherit_from_blinding": m_ruleset.CulGenDisinheritFromBlinding = parser.ReadInt32(); break; case "dukes_called_kings": m_ruleset.CulGenDukesCalledKings = parser.ReadInt32(); break; case "founder_names_dynasty": m_ruleset.CulGenFounderNamesDynasty = parser.ReadInt32(); break; case "dynasty_title_names": m_ruleset.CulGenDynastyTitleNames = parser.ReadInt32(); break; } }
void ReadInto(ParadoxParser x, ref int?tech, ref double?progress) { tech = x.ReadInt32(); progress = x.ReadDouble(); }
public void TokenCallback(ParadoxParser parser, string token) { if (token == "id") Id = parser.ReadInt32(); else if (token == "type") Type = parser.ReadInt32(); }
public void TokenCallback(ParadoxParser parser, string token) { if (token[1] == '_') // Like e_something or c_something { LandedTitleDefinition landedTitle = new LandedTitleDefinition(); landedTitle.Entity.ParentId = Entity.Id; landedTitle.Entity.Id = token; Entity.Children.Add(parser.Parse(landedTitle).Entity); return; } switch (token) { // TODO: Implement these case "allow": case "coat_of_arms": case "gain_effect": case "pagan_coa": parser.ReadInsideBrackets((p) => { }); break; case "assimilate": Entity.AllowsAssimilation = parser.ReadBool(); break; case "color": Entity.PrimaryColour = parser.ReadIntList().ToArray(); break; case "color2": Entity.SecondaryColour = parser.ReadIntList().ToArray(); break; case "caliphate": Entity.IsCaliphate = parser.ReadBool(); break; case "capital": Entity.CapitalId = parser.ReadInt32(); break; case "controls_religion": Entity.ControlledReligionId = parser.ReadString(); break; case "creation_requires_capital": Entity.CreationRequiresCapital = parser.ReadBool(); break; case "culture": Entity.CultureId = parser.ReadString(); break; case "dignity": Entity.Dignity = parser.ReadInt32(); break; case "dynasty_title_names": Entity.UseDynastyTitleNames = parser.ReadBool(); break; case "female_names": Entity.FemaleNames = parser.ReadStringList(); break; case "foa": Entity.TitleFormOfAddress = parser.ReadString(); break; case "graphical_culture": Entity.GraphicalCulture = parser.ReadString(); break; case "has_top_de_jure_capital": Entity.HasTopDeJureCapital = parser.ReadBool(); break; case "holy_order": Entity.IsHolyOrder = parser.ReadBool(); break; case "holy_site": Entity.HolySites.Add(parser.ReadString()); break; case "independent": Entity.IsIndependent = parser.ReadBool(); break; case "landless": Entity.IsLandless = parser.ReadBool(); break; case "location_ruler_title": Entity.TitleContainsCapital = parser.ReadBool(); break; case "male_names": Entity.MaleNames = parser.ReadStringList(); break; case "mercenary": Entity.IsMercenaryGroup = parser.ReadBool(); break; case "mercenary_type": Entity.MercenaryType = parser.ReadString(); break; case "monthly_income": Entity.MonthlyIncome = parser.ReadInt32(); break; case "name_tier": Entity.TitleNameTierId = parser.ReadString(); break; case "pirate": Entity.IsPirate = parser.ReadBool(); break; case "primary": Entity.IsPrimaryTitle = parser.ReadBool(); break; case "purple_born_heirs": Entity.HasPurpleBornHeirs = parser.ReadBool(); break; case "religion": Entity.ReligionId = parser.ReadString(); break; case "short_name": Entity.UseShortName = parser.ReadBool(); break; case "strength_growth_per_century": Entity.StrengthGrowthPerCentury = parser.ReadFloat(); break; case "title": Entity.TitleLocalisationId = parser.ReadString(); break; case "title_female": Entity.TitleLocalisationFemaleId = parser.ReadString(); break; case "title_prefix": Entity.TitleLocalisationPrefixId = parser.ReadString(); break; case "tribe": Entity.IsTribe = parser.ReadBool(); break; default: string stringValue = parser.ReadString(); int intValue; if (int.TryParse(stringValue, out intValue)) { Entity.ReligiousValues.AddOrUpdate(token, intValue); } else { Entity.DynamicNames.AddOrUpdate(token, stringValue); } break; } }