protected override bool Allow(SimDescription sim) { if (Sim.CreatedSim == null) { IncStat("Hibernating"); return(false); } else { InteractionInstance instance = null; try { instance = CareerPushScenario.GetWorkInteraction(Job); } catch (Exception e) { Common.DebugException(Sim, e); } if (instance == null) { IncStat("No Interaction"); return(false); } else if (Situations.HasInteraction(Sim.CreatedSim, instance.InteractionDefinition, true)) { IncStat("At Work"); return(false); } } return(base.Allow(sim)); }
protected override bool PrivateUpdate(ScenarioFrame frame) { base.PrivateUpdate(frame); if (mPush) { Sim createdSim = Job.OwnerDescription.CreatedSim; if (createdSim != null) { if ((SimTypes.IsSelectable(Job.OwnerDescription)) || (!NpcParty.IsHostAtNpcParty(createdSim))) { foreach (InteractionInstance instance in createdSim.InteractionQueue.InteractionList) { if (instance is ICountsAsWorking) { IncStat("Already Queued"); return(false); } } VisitSituation.AnnounceTimeToGoToWork(createdSim); createdSim.InteractionQueue.Add(CareerPushScenario.GetWorkInteraction(Job)); } } if (GetValue <AllowGoHomePushOption, bool>(Sim)) { Manager.AddAlarm(new GoHomePushScenario(Sim)); } } return(true); }
protected CareerPushScenario(CareerPushScenario scenario) : base (scenario) { }
protected CareerPushScenario(CareerPushScenario scenario) : base(scenario) { }