Beispiel #1
0
        public PdxSublist GetHistoryCountryFile(Vic2World world)
        {
            var data = new PdxSublist(null);

            data.AddValue("capital", Capital.ToString());
            data.AddValue("primary_culture", PrimaryCulture);
            AcceptedCultures.ForEach(c => data.AddValue("culture", c));
            data.AddValue("religion", Religion);
            data.AddValue("government", Government);
            data.AddValue("plurality", Plurality.ToString());
            if (NationalValues != null)
            {
                data.AddValue("nationalvalue", NationalValues.Value);
            }
            data.AddValue("literacy", Literacy.ToString());
            data.AddValue("civilized", IsCivilised ? "yes" : "no");

            data.AddValue("prestige", Prestige.ToString());
            if (Reforms != null)
            {
                Reforms.AddData(data);
            }
            if (Technologies != null)
            {
                Technologies.ForEach(t => data.AddValue(t, "1"));
            }
            data.AddValue("consciousness", Consciousness.ToString());
            // todo
            data.AddValue("nonstate_consciousness", (Consciousness / 3).ToString());
            if (RulingParty != null)
            {
                data.AddValue("ruling_party", RulingParty.Name);
            }
            data.AddDate("last_election", LastElection);
            if (UpperHouse != null)
            {
                data.AddSublist("upper_house", UpperHouse.GetData(data));
            }
            if (TechSchools != null)
            {
                data.AddValue("schools", Enum.GetName(typeof(TechSchool), TechSchools.TechSchool));
            }

            if (FemaleLeaders && (Reforms.vote_franschise == vote_franschise.universal_voting || Reforms.vote_franschise == vote_franschise.universal_weighted_voting))
            {
                var entry = new PdxSublist();
                entry.AddValue("decision", "enact_female_suffrage");

                data.AddSublist(world.StartDate, entry);
            }
            return(data);
        }
Beispiel #2
0
        private void CalcEffects(Vic2World vic2World)
        {
            NationalValues = new NV();

            TechSchools = new TechSchoolValues();

            Reforms = new Reforms();
            var reforms = new Dictionary <Type, float>();

            UpperHouse = new UHouse();

            PoliticalParties  = new List <PoliticalParty>();
            BasePartyModifier = new IdeologyModifier();

            Technologies = new List <string>();
            var techInvestment = new Dictionary <string, float>();
            var femaleLeaders  = 0f;

            foreach (var techCategory in vic2World.TechOrder.Keys)
            {
                techInvestment.Add(techCategory, 0);
            }
            IterateEffects(vic2World, (Dictionary <string, float> effects) =>
            {
                CalcNationalValues(effects);
                CalcTechSchool(effects);
                CalcReforms(effects, reforms);
                CalcUpperHouse(effects);
                CalcPoliticalParties(effects, BasePartyModifier);
                CalcLiteracy(effects);
                CalcConsciousness(effects);
                CalcMilitancy(effects);
                CalcTechnology(effects, techInvestment);
                femaleLeaders = CalcFemaleLeaders(effects, femaleLeaders);
            });
            FinaliseReforms(reforms);
            FinalisePoliticalParties(vic2World, BasePartyModifier);
            FinaliseTechnology(techInvestment, vic2World.TechOrder);
            FinaliseFemaleLeaders(femaleLeaders);
        }