Ejemplo n.º 1
0
        public override void UpdateInheritors(IGenericLevelOption option)
        {
            base.UpdateInheritors(option);

            if (option is ISimCasteOption)
            {
                // Hierarchy changed, invalidate all stored options
                InvalidateCache();
            }

            /*
             * SimDescription sim = SimDescription;
             * if (sim != null)
             * {
             *  foreach (SimDescription child in IsChildScoring.GetFor(sim))
             *  {
             *      if (child.TeenOrAbove) continue;
             *
             *      if (child.Household != sim.Household) continue;
             *
             *      if ((remove) || (!IsValidOption(option)))
             *      {
             *          StoryProgression.Main.GetData(child).RemoveOption(option);
             *      }
             *  }
             * }
             */
        }
Ejemplo n.º 2
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);
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public override void UpdateInheritors(IGenericLevelOption option)
        {
            base.UpdateInheritors(option);

            if (House == null)
            {
                return;
            }

            StoryProgression.Main.GetHouseOptions(House).UpdateInheritors(option);
        }
Ejemplo n.º 4
0
        public override void ApplyOverride(IGenericLevelOption paramOption, OverrideStyle style)
        {
            if ((style & OverrideStyle.MergeSet) == OverrideStyle.MergeSet)
            {
                ResetToDefaultOption option = paramOption as ResetToDefaultOption;

                foreach (GenericOptionBase.DefaultableOption member in option.Value)
                {
                    member.Clear(Manager);
                }
            }
        }
Ejemplo n.º 5
0
        public override bool IsValidOption(IGenericLevelOption option)
        {
            if (option is INotCasteLevelOption)
            {
                return(false);
            }

            if (option is IReadCasteLevelOption)
            {
                return(true);
            }

            return(option is IReadSimLevelOption);
        }
Ejemplo n.º 6
0
        public override bool IsValidOption(IGenericLevelOption option)
        {
            if (option is INotGlobalLevelOption)
            {
                return(false);
            }

            if (option is IWriteHouseLevelOption)
            {
                return(true);
            }

            return(option is IHouseLevelSimOption);
        }
Ejemplo n.º 7
0
        public override bool IsValidOption(IGenericLevelOption option)
        {
            if (option is IReadLotLevelOption)
            {
                return(true);
            }

            if (option is IWriteLotLevelOption)
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 8
0
        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);
            }
        }
Ejemplo n.º 9
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);
                }
            }
        }
Ejemplo n.º 10
0
        public override void ApplyOverride(IGenericLevelOption paramOption, OverrideStyle style)
        {
            if ((style & OverrideStyle.MergeSet) == OverrideStyle.MergeSet)
            {
                AccountingData value = Value;
                if (value == null)
                {
                    return;
                }

                string result = Manager.House.Name;

                result += Common.NewLine + value.ToString();

                int assets = GetValue <AssetsOption, int>();
                int debt   = GetValue <DebtOption, int>();

                result += Common.NewLine + StoryProgression.Localize("Accounting:Assets", false, new object[] { assets });
                result += Common.NewLine + StoryProgression.Localize("Accounting:Debts", false, new object[] { debt });

                Common.Notify(result);
            }
        }
Ejemplo n.º 11
0
 public override bool IsValidOption(IGenericLevelOption option)
 {
     return(option is IReadSimLevelOption);
 }