示例#1
0
        public override void UpdateInheritors(IGenericLevelOption option)
        {
            base.UpdateInheritors(option);

            InvalidateFilter();

            bool updateAll = ((option is ISimCasteOption) || (GetValue <CasteApplyToHouseOption, bool>()));

            Dictionary <Household, bool> houses = new Dictionary <Household, bool>();

            foreach (SimDescription sim in StoryProgression.Main.Sims.All)
            {
                SimData data = StoryProgression.Main.GetData(sim);

                if (!updateAll)
                {
                    if (!data.Contains(this))
                    {
                        continue;
                    }
                }
                else
                {
                    data.InvalidateCache();
                }

                data.Uncache(option);

                if (!data.IsValidOption(option))
                {
                    data.RemoveOption(option);
                }

                if (sim == SimTypes.HeadOfFamily(sim.Household))
                {
                    if (!houses.ContainsKey(sim.Household))
                    {
                        houses.Add(sim.Household, true);

                        HouseholdOptions options = StoryProgression.Main.GetHouseOptions(sim.Household);
                        if (options != null)
                        {
                            if (updateAll)
                            {
                                options.InvalidateCache();
                            }

                            options.Uncache(option);

                            options.UpdateInheritors(option);
                        }
                    }
                }
            }
        }
示例#2
0
        public override void UpdateInheritors(IGenericLevelOption option)
        {
            base.UpdateInheritors(option);

            if (House == null)
            {
                return;
            }

            foreach (SimDescription sim in Households.All(House))
            {
                SimData data = StoryProgression.Main.GetData(sim);

                data.Uncache(option);

                if (!data.IsValidOption(option))
                {
                    data.RemoveOption(option);
                }
            }
        }