Example #1
0
        protected void Add(Occupation job, int value)
        {
            if (job == null)
            {
                return;
            }

            if (job is SkillBasedCareer)
            {
                return;
            }

            if (job is Retired)
            {
                return;
            }

            if (value < 0)
            {
                if (job.mDaysOff == 0)
                {
                    return;
                }

                job.mDaysOff += value;
                if (job.mDaysOff < 0)
                {
                    job.mDaysOff = 0;
                }

                job.SetHoursUntilWork();
            }
            else
            {
                job.TakePaidTimeOff(value);
            }
        }
Example #2
0
        public static void EnsureVacationDays(Occupation ths, float hours)
        {
            int count = (int)hours / 24;

            bool flag = false;

            while ((ths.HoursUntilWork <= hours) && (count >= 0))
            {
                ths.mUnpaidDaysOff++;
                ths.SetHoursUntilWork();
                flag = true;

                count--;
            }

            if (flag)
            {
                Sim ownerSim = ths.OwnerSim;
                if (ownerSim != null)
                {
                    EventTracker.SendEvent(EventTypeId.kOccupationTookUnpaidTimeOff, ownerSim);
                }
            }
        }
        public static void EnsureVacationDays(Occupation ths, float hours)
        {
            int count = (int)hours / 24;

            bool flag = false;
            while ((ths.HoursUntilWork <= hours) && (count >= 0))
            {
                ths.mUnpaidDaysOff++;
                ths.SetHoursUntilWork();
                flag = true;

                count--;
            }

            if (flag)
            {
                Sim ownerSim = ths.OwnerSim;
                if (ownerSim != null)
                {
                    EventTracker.SendEvent(EventTypeId.kOccupationTookUnpaidTimeOff, ownerSim);
                }
            }
        }