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); } } } } }
public override void UpdateInheritors(IGenericLevelOption option) { base.UpdateInheritors(option); foreach (Household house in Household.sHouseholdList) { HouseholdOptions options = GetHouseOptions(house); if (!IsValidOption(option)) { options.RemoveOption(option); } options.UpdateInheritors(option); } }