예제 #1
0
        public void DumpLog()
        {
            Common.StringBuilder debugging = new Common.StringBuilder("Homemaker Stipend " + OwnerDescription.FullName);

            foreach (KeyValuePair <DaysOfTheWeek, StipendCalculation> day in mStipend)
            {
                debugging += Common.NewLine + "Day: " + day.Key;

                StipendGrade dayGrade = day.Value.CalculateGrade(this, ref debugging);

                debugging += Common.NewLine + " Grade: " + dayGrade;
            }

            Common.DebugWriteLog(debugging);
        }
예제 #2
0
        private void StipendAlarmCallback()
        {
            int bonus = 0;

            int payPerHourOrStipend = (int)TotalCareerMoneyEarned();

            if (mStipend.Count == 7)
            {
                Common.StringBuilder debugging = new Common.StringBuilder("Homemaker Stipend " + OwnerDescription.FullName);

                int positive = 0, negative = 0;

                foreach (KeyValuePair <DaysOfTheWeek, StipendCalculation> day in mStipend)
                {
                    debugging += Common.NewLine + "Day: " + day.Key;

                    StipendGrade dayGrade = day.Value.CalculateGrade(this, ref debugging);

                    debugging += Common.NewLine + " Grade: " + dayGrade;

                    switch (dayGrade)
                    {
                    case StipendGrade.A:
                    case StipendGrade.B:
                        positive++;
                        break;

                    case StipendGrade.C:
                        // C is a day with no change up or down
                        break;

                    case StipendGrade.D:
                    case StipendGrade.F:
                        negative++;
                        break;
                    }
                }

                StipendGrade grade = StipendGrade.F;

                if (negative >= 5)
                {
                    grade = StipendGrade.F;

                    if ((Level > 1) || (SimTypes.IsSelectable(OwnerDescription)))
                    {
                        DemoteSim();
                    }

                    mXp = 0;
                }
                else if (positive >= 5)
                {
                    grade = StipendGrade.A;

                    // Get the base value defining the bonus
                    bonus = (int)base.PayPerHourOrStipend;
                }
                else
                {
                    if (positive > negative)
                    {
                        grade = StipendGrade.B;
                    }
                    else
                    {
                        grade = StipendGrade.C;
                    }
                }

                Common.DebugWriteLog(debugging);

                if (SimTypes.IsSelectable(OwnerDescription))
                {
                    Common.Notify(OwnerDescription, Common.Localize("Homemaker:Grade" + grade, OwnerDescription.IsFemale, new object[] { OwnerDescription, payPerHourOrStipend, bonus }));
                }

                mStipend.Clear();
            }
            else if (payPerHourOrStipend > 0)
            {
                if (SimTypes.IsSelectable(OwnerDescription))
                {
                    Common.Notify(OwnerDescription, Common.Localize("Homemaker:GrantNotice", OwnerDescription.IsFemale, new object[] { OwnerDescription, payPerHourOrStipend }));
                }
            }

            UpdateXp(payPerHourOrStipend + bonus);

            PayOwnerSim(payPerHourOrStipend + bonus, GotPaidEvent.PayType.kCareerNormalPay);

            mDiscount = 0;
        }