Beispiel #1
0
            public SetAccountingKey(Household household, string key)
            {
                mHouse = household;

                mManager = NRaas.StoryProgression.Main.Money;

                if (!mManager.mAccountKeys.TryGetValue(mHouse, out mOriginal))
                {
                    mOriginal = null;
                }

                mManager.mAccountKeys[mHouse] = key;
            }
Beispiel #2
0
        public void ProcessAbandonHouse(Household oldHouse, Household newHouse)
        {
            if (HouseholdsEx.NumHumans(oldHouse) != 1)
            {
                return;
            }

            Lots.ProcessAbandonLot(oldHouse.LotHome);

            foreach (PropertyData data in oldHouse.RealEstateManager.AllProperties)
            {
                ManagerMoney.TransferProperty(oldHouse, newHouse, data);
            }
        }
Beispiel #3
0
        public override void Startup(PersistentOptionBase vOptions)
        {
            try
            {
                mManagers = new List <Manager>();

                Castes = new ManagerCaste(this);

                Lots = new ManagerLot(this);

                Households = new ManagerHousehold(this);

                Sims = new ManagerSim(this);

                Money = new ManagerMoney(this);

                Deaths = new ManagerDeath(this);

                Skills = new ManagerSkill(this);

                Careers = new ManagerCareer(this);

                Pregnancies = new ManagerPregnancy(this);

                Romances = new ManagerRomance(this);

                Flirts = new ManagerFlirt(this);

                Friends = new ManagerFriendship(this);

                Situations = new ManagerSituation(this);

                Personalities = new ManagerPersonality(this);

                Scenarios = new ManagerScenario(this);

                Scoring = new ManagerScoring(this);

                Stories = new ManagerStory(this);

                mManagerLookup = new Dictionary <Type, Manager>();
                mManagerLookup.Add(GetType(), this);

                mManagerByName = new Dictionary <string, Manager>();
                mManagerByName.Add(GetTitlePrefix(PrefixType.Pure), this);

                foreach (Manager manager in mManagers)
                {
                    mManagerLookup.Add(manager.GetType(), manager);
                    mManagerByName.Add(manager.GetTitlePrefix(PrefixType.Pure), manager);
                }

                InstallOptions(sInitialInstall);

                foreach (Manager manager in mManagers)
                {
                    manager.InstallOptions(sInitialInstall);
                }

                if (Common.IsAwayFromHomeworld())
                {
                    // Stop persistence for the moment
                    OptionStore optionStore = sOptions;
                    sOptions = null;

                    List <IAdjustForVacationOption> options = new List <IAdjustForVacationOption>();
                    GetOptions(options, false, null);

                    foreach (IAdjustForVacationOption option in options)
                    {
                        option.AdjustForVacationTown();
                    }

                    sOptions = optionStore;
                }

                Options.Restore();

                Common.kDebugging = GetValue <DebuggingOption, bool>();

                base.Startup(Options);

                RemoveStats();

                foreach (Manager manager in mManagers)
                {
                    try
                    {
                        manager.Startup(Options);
                    }
                    catch (Exception exception)
                    {
                        BooterLogger.AddError(exception.ToString());
                    }
                }

                if (DebuggingEnabled)
                {
                    TestOptionNameUniqueness();
                }

                sInitialInstall = false;

                mFirst = true;
                mTask  = new Common.AlarmTask(1f, TimeUnit.Seconds, OnTimer, 10f, TimeUnit.Minutes);
            }
            catch (Exception exception)
            {
                Common.Exception("Startup", exception);
            }
        }