protected virtual void RegularWorkDayTwoHourBeforeStartAlarmHandler(){ DateAndTime queryTime = SimClock.CurrentTime(); queryTime.Ticks += SimClock.ConvertToTicks(3.1f, TimeUnit.Hours); if (this.ShouldBeAtWork(queryTime)) { Sim createdSim = this.OwnerDescription.CreatedSim; if ((createdSim != null) && (this.mCurLevel != null)) { if ((!createdSim.IsSelectable || !this.mbCarpoolEnabled) || !this.mCurLevel.HasCarpool) { queryTime = SimClock.CurrentTime(); float num = ((this.mCurLevel.StartTime - queryTime.Hour) + 24f) % 24f; float time = num - this.AverageTimeToReachWork; if (time < 0f) { time = 0f; } this.mRegularWorkDayGoToWorkHandle = AlarmManager.Global.AddAlarm(time, TimeUnit.Hours, new AlarmTimerCallback(this.RegularWorkDayGoToWorkHandle), "Career: time to push go to work", AlarmType.AlwaysPersisted, this.OwnerDescription); } else { StyledNotification.Format format = new StyledNotification.Format(Localization.LocalizeString("Gameplay/Objects/Vehicles/CarpoolManager:CarpoolComing", new object[] { createdSim }), ObjectGuid.InvalidObjectGuid, createdSim.ObjectId, StyledNotification.NotificationStyle.kTip); StyledNotification.Show(format, this.CareerIconColored); } } }}
public static void RegularWorkDayGoToWorkHandle(Sims3.Gameplay.Careers.Career career) { Sim createdSim = career.OwnerDescription.CreatedSim; if (((createdSim != null) && ((AutonomyRestrictions.GetLevel() >= AutonomyLevel.Two) || createdSim.IsNPC)) && !createdSim.InteractionQueue.HasInteractionOfType(career.WorkInteractionDefinition)) { // Update the HoursUntilWork() career.SetHoursUntilWork(); VisitSituation.AnnounceTimeToGoToWork(createdSim); createdSim.InteractionQueue.AddNext(career.CreateWorkInteractionInstance()); } }