public Story PrintFormattedSummary(Manager manager, string storyKey, string summaryKey, SimDescription sim, List <SimDescription> sims, string[] extended, StoryLogging logging) { List <object> parameters = new List <object>(); parameters.Add(sim); foreach (SimDescription other in sims) { if (sim == other) { continue; } parameters.Add(other); } string nameString = ManagerStory.CreateNameString(sims, sim).ToString(); List <object> objs = AddGenderNouns(sim); objs.Add(nameString); parameters.Add(nameString); return(PrintFormattedStory(manager, manager.Localize(storyKey + "Summary", false, objs.ToArray()), summaryKey, parameters.ToArray(), extended, logging)); }
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); } }