Exemple #1
0
        public static bool PerformAfterschoolPostLoop(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
        {
            AfterschoolActivityData data = AfterschoolActivityBooter.GetActivity(activity.CurrentActivityType);

            data.PerformPostLoop(interaction, activity);
            return(true);
        }
Exemple #2
0
        public static bool AddNewActivity(SimDescription actor, AfterschoolActivityType activityType)
        {
            School school = actor.CareerManager.School;

            if (school.AfterschoolActivities == null)
            {
                school.AfterschoolActivities = new List <AfterschoolActivity>();
            }
            else if (AlreadyHasChildActivity(actor) || HasAfterschoolActivityOfType(actor, activityType))
            {
                return(false);
            }

            // Custom
            school.AfterschoolActivities.Add(AfterschoolActivityBooter.GetActivity(activityType).mActivity);

            string name = activityType.ToString();

            if (actor.CreatedSim != null)
            {
                actor.CreatedSim.ShowTNSIfSelectable(TNSNames.SignUpForAfterschoolActivityTNS, actor, null, null, actor.IsFemale, actor.IsFemale, new object[] { actor, AfterschoolActivity.LocalizeString(actor.IsFemale, name, new object[0x0]), AfterschoolActivity.LocalizeString(actor.IsFemale, name + "Description", new object[0x0]) });
                actor.CareerManager.UpdateCareerUI();
            }
            return(true);
        }
Exemple #3
0
        public static bool AlreadyHasChildActivity(SimDescription actor)
        {
            if (!actor.Child)
            {
                return(false);
            }

            School school = actor.CareerManager.School;

            if (school != null)
            {
                List <AfterschoolActivity> afterschoolActivities = school.AfterschoolActivities;
                if (afterschoolActivities != null)
                {
                    foreach (AfterschoolActivity activity2 in afterschoolActivities)
                    {
                        AfterschoolActivityData data = AfterschoolActivityBooter.GetActivity(activity2.CurrentActivityType);
                        if (data == null)
                        {
                            continue;
                        }

                        if (data.IsChild)
                        {
                            return(true);
                        }
                    }
                }
            }

            return(false);
        }
Exemple #4
0
 public static DaysOfTheWeek GetDaysForActivityType(AfterschoolActivityType activityType)
 {
     return(AfterschoolActivityBooter.GetActivity(activityType).mActivity.DaysForActivity);
 }
Exemple #5
0
        public static InteractionInstance.InsideLoopFunction PerformAfterschoolLoop(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
        {
            AfterschoolActivityData data = AfterschoolActivityBooter.GetActivity(activity.CurrentActivityType);

            return(data.LoopDelegate(interaction, activity));
        }
Exemple #6
0
 public static bool IsValidSimForSimPicker(SimDescription actor, AfterschoolActivityType activityToCheck)
 {
     return(AfterschoolActivityBooter.GetActivity(activityToCheck).IsValidFor(actor));
 }
Exemple #7
0
 public static bool IsChildActivity(AfterschoolActivityType type)
 {
     return(AfterschoolActivityBooter.GetActivity(type).IsChild);
 }