Пример #1
0
        public static void PostInRabbitHoleLoop(GoToSchoolInRabbitHole ths, ref bool succeeded, ref bool detention, ref bool fieldTrip, ref AfterschoolActivity activity, ref bool hasAfterschoolActivity)
        {
            try
            {
                School school = ths.Actor.School;

                ISchoolRabbitHole target = GetTarget(ths);

                activity = ths.GetAfterschoolActivity(ths.Actor, school, target, ref hasAfterschoolActivity);

                fieldTrip = FieldTripSituation.GetFieldTripSituation(ths.Actor) != null;
                detention = school.CurentDetentionStatus == School.DetentionStatus.HasDetention;

                if (detention && !fieldTrip)
                {
                    school.CurentDetentionStatus = School.DetentionStatus.InDetention;
                    float          maxDurationInHours = (school.DayLength + Career.kNumHoursEarlyCanShowUpForWork) + school.SchoolTuning.DetentionLengthInHours;
                    TimeOfDayStage stage = new TimeOfDayStage(Localization.LocalizeString(ths.Actor.IsFemale, "Gameplay/Careers/WorkInRabbitHole:SchoolDetention", new object[0x0]), school.CurLevel.FinishTime() + school.SchoolTuning.DetentionLengthInHours, maxDurationInHours);
                    ths.Stages      = new List <Stage>(new Stage[] { stage });
                    ths.ActiveStage = stage;
                    school.SetTones(ths);
                    ths.Actor.RemoveExitReason(ExitReason.StageComplete);
                    ths.Actor.BuffManager.AddElement(BuffNames.Detention, Origin.FromSchool);
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(ths.Actor, ths.Target, e);
            }
        }
Пример #2
0
        public static bool PerformAfterschoolPostLoop(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
        {
            AfterschoolActivityData data = AfterschoolActivityBooter.GetActivity(activity.CurrentActivityType);

            data.PerformPostLoop(interaction, activity);
            return(true);
        }
Пример #3
0
        public InteractionInstance.InsideLoopFunction LoopDelegate(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
        {
            try
            {
                if (mLoop != null)
                {
                    InteractionInstance.InsideLoopFunction del = (InteractionInstance.InsideLoopFunction)mLoop.Invoke(null, new object[] { interaction, activity });
                    if (del != null)
                    {
                        return(del);
                    }
                }

                return(interaction.AfterschoolActivityLoopDelegate);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(interaction.Actor, interaction.Target, e);
                return(null);
            }
        }
Пример #4
0
 public static void PerformPostLoopChessClub(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
 {
     try
     {
         Chess skill = interaction.Actor.SkillManager.GetSkill <Chess>(SkillNames.Chess);
         if (skill != null)
         {
             if (RandomUtil.CoinFlip())
             {
                 skill.NumberOfWins++;
             }
             else
             {
                 skill.NumberOfLosses++;
             }
         }
     }
     catch (ResetException)
     {
         throw;
     }
     catch (Exception e)
     {
         Common.Exception(interaction.Actor, interaction.Target, e);
     }
 }
Пример #5
0
        public static bool PreInRabbitholeLoop(GoToSchoolInRabbitHole ths, bool allowedToWork)
        {
            try
            {
                LotManager.SetAutoGameSpeed();

                //CancellableByPlayer = false;

                ths.BeginCommodityUpdates();

                if (!allowedToWork)
                {
                    ths.EndCommodityUpdates(false);
                    return(false);
                }

                ths.Actor.School.StartWorking();
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(ths.Actor, ths.Target, e);
                return(false);
            }
        }
Пример #6
0
 // Externalized to MasterController and StoryProgression
 public static InteractionInstance.InsideLoopFunction PerformAfterschoolLoop(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
 {
     try
     {
         return(AfterschoolActivityEx.PerformAfterschoolLoop(interaction, activity));
     }
     catch (Exception e)
     {
         Common.Exception("GetAfterSchoolDelegate", e);
         return(null);
     }
 }
Пример #7
0
 // Externalized to MasterController and StoryProgression
 public static bool PerformAfterschoolPostLoop(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
 {
     try
     {
         return(AfterschoolActivityEx.PerformAfterschoolPostLoop(interaction, activity));
     }
     catch (Exception e)
     {
         Common.Exception("GetAfterSchoolDelegate", e);
         return(false);
     }
 }
Пример #8
0
 public static void PerformPostLoopArtClub(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
 {
     try
     {
         activity.CheckForNewPainting(interaction.Actor);
     }
     catch (ResetException)
     {
         throw;
     }
     catch (Exception e)
     {
         Common.Exception(interaction.Actor, interaction.Target, e);
     }
 }
Пример #9
0
        public static bool PreRouteNearEntranceAndIntoBuilding(GoToSchoolInRabbitHole ths, bool canUseCar, Route.RouteMetaType routeMetaType, OnChangeOutfit changedOutfitFunc)
        {
            try
            {
                // From GoToSchoolInRabbitHole

                GoToSchoolInRabbitHole.Definition interactionDefinition = ths.InteractionDefinition as GoToSchoolInRabbitHole.Definition;
                if ((interactionDefinition != null) && (interactionDefinition.PlayerChosenVehicle != null))
                {
                    ths.Actor.SetReservedVehicle(interactionDefinition.PlayerChosenVehicle);
                }

                bool success = false;

                School school = ths.Actor.School;
                if (school != null)
                {
                    SimOutfit outfit;
                    if (school.TryGetUniformForCurrentLevel(out outfit))
                    {
                        if (ApplyOccupationUniform(ths.Actor.SimDescription, outfit))
                        {
                            success = true;
                        }
                    }
                }

                if ((!success) && (changedOutfitFunc != null))
                {
                    changedOutfitFunc();
                }

                VisitSituation.OnSimLeavingLot(ths.Actor);

                // From RabbitHoleInteraction<TActor, TRabbitHole>
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(ths.Actor, ths.Target, e);
                return(false);
            }
        }
        public static bool PreRouteNearEntranceAndIntoBuilding(GoToSchoolInRabbitHole ths, bool canUseCar, Route.RouteMetaType routeMetaType, OnChangeOutfit changedOutfitFunc)
        {
            try
            {
                // From GoToSchoolInRabbitHole

                GoToSchoolInRabbitHole.Definition interactionDefinition = ths.InteractionDefinition as GoToSchoolInRabbitHole.Definition;
                if ((interactionDefinition != null) && (interactionDefinition.PlayerChosenVehicle != null))
                {
                    ths.Actor.SetReservedVehicle(interactionDefinition.PlayerChosenVehicle);
                }

                bool success = false;

                School school = ths.Actor.School;
                if (school != null)
                {
                    SimOutfit outfit;
                    if (school.TryGetUniformForCurrentLevel(out outfit))
                    {
                        if (ApplyOccupationUniform(ths.Actor.SimDescription, outfit))
                        {
                            success = true;
                        }
                    }
                }
                 
                if ((!success) && (changedOutfitFunc != null))
                {
                    changedOutfitFunc();
                }

                VisitSituation.OnSimLeavingLot(ths.Actor);

                // From RabbitHoleInteraction<TActor, TRabbitHole>
                return true;
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(ths.Actor, ths.Target, e);
                return false;
            }
        }
Пример #11
0
        public static ISchoolRabbitHole GetTarget(GoToSchoolInRabbitHole ths)
        {
            ISchoolRabbitHole target = ths.Target as ISchoolRabbitHole;

            if (target == null)
            {
                SchoolRabbitholeProxy proxy;
                if (!sSchoolRabbitholeProxies.TryGetValue(ths.Target, out proxy))
                {
                    proxy = new SchoolRabbitholeProxy();
                    sSchoolRabbitholeProxies.Add(ths.Target, proxy);
                }

                target = proxy;
            }

            return(target);
        }
Пример #12
0
 public void PerformPreLoop(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
 {
     try
     {
         if (mPreLoop != null)
         {
             mPreLoop.Invoke(null, new object[] { interaction, activity });
         }
     }
     catch (ResetException)
     {
         throw;
     }
     catch (Exception e)
     {
         Common.Exception(interaction.Actor, interaction.Target, e);
     }
 }
Пример #13
0
 public void PerformPreLoop(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
 {
     try
     {
         if (mPreLoop != null)
         {
             mPreLoop.Invoke(null, new object[] { interaction, activity });
         }
     }
     catch (ResetException)
     {
         throw;
     }
     catch (Exception e)
     {
         Common.Exception(interaction.Actor, interaction.Target, e);
     }
 }
Пример #14
0
        public static void PostAfterSchoolLoop(GoToSchoolInRabbitHole ths, bool succeeded, AfterschoolActivity activity, InteractionInstance.InsideLoopFunction afterSchoolLoop)
        {
            try
            {
                if (afterSchoolLoop != null)
                {
                    ths.Target.ClearAmbientSounds(ths.Target);
                    ths.Target.AddAmbientSound("rhole_school_oneshot");

                    foreach (SkillNames names in activity.ActivitySkillNameList)
                    {
                        ths.Actor.SkillManager.StopSkillGain(names);
                    }

                    if (!sCareerPerformAfterschoolPostLoop.Invoke <bool>(new object[] { ths, activity }))
                    {
                        if (activity.CurrentActivityType == AfterschoolActivityType.ArtClub)
                        {
                            activity.CheckForNewPainting(ths.Actor);
                        }
                    }

                    ISchoolRabbitHole target = GetTarget(ths);

                    target.HasAfterschoolActivityToday = false;
                }

                ths.Actor.School.FinishWorking();

                ths.EndCommodityUpdates(succeeded);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(ths.Actor, ths.Target, e);
            }
        }
Пример #15
0
        public static void PerformPreLoopStudyClub(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
        {
            try
            {
                School school = interaction.Actor.School;

                school.AddHomeworkToStudent(false);
                interaction.mHomework = school.OwnersHomework;
                if (interaction.mHomework != null)
                {
                    school.DidHomeworkInStudyClubToday    = true;
                    interaction.mHomework.PercentComplete = 0f;
                    interaction.mHomeworkCompletionRate   = interaction.mHomework.GetCompletionRate(interaction.Actor, false, true);
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(interaction.Actor, interaction.Target, e);
            }
        }
        public static void PostDetentionLoop(GoToSchoolInRabbitHole ths, bool succeeded, bool detention, bool fieldTrip, AfterschoolActivity activity, bool hasAfterschoolActivity, ref InteractionInstance.InsideLoopFunction afterSchoolLoop)
        {
            try
            {
                School school = ths.Actor.School;

                ISchoolRabbitHole target = GetTarget(ths);

                bool flag5 = false;
                bool flag6 = false;
                if (!fieldTrip && !detention)
                {
                    if (hasAfterschoolActivity)
                    {
                        flag5 = true;
                    }
                    else if (!ths.Actor.IsInActiveHousehold && target.HasAfterschoolActivityToday)
                    {
                        flag5 = RandomUtil.CoinFlip();
                        flag6 = true;
                    }
                }

                if (!flag5)
                {
                    school.FinishWorking();

                    ths.EndCommodityUpdates(succeeded);
                    return;
                }

                CommodityChange fun = new CommodityChange(CommodityKind.Fun, 50, false, 25, OutputUpdateType.ContinuousFlow, false, false, UpdateAboveAndBelowZeroType.Either);

                ths.BeginCommodityUpdate(fun, 1);

                ths.mParticipatedInAfterschoolActivity = true;
                string str = flag6 ? AfterschoolActivityType.ArtClub.ToString() : activity.CurrentActivityType.ToString();
                float num3 = (school.DayLength + Career.kNumHoursEarlyCanShowUpForWork) + AfterschoolActivity.kAfterschoolActivityLength;

                string name = null;
                if (Localization.HasLocalizationString("Gameplay/Careers/AfterschoolActivity:" + str))
                {
                    name = Common.LocalizeEAString(ths.Actor.IsFemale, "Gameplay/Careers/AfterschoolActivity:" + str);
                }
                else
                {
                    name = Common.LocalizeEAString(ths.Actor.IsFemale, "Gameplay/Abstracts/Careers/AfterschoolActivity:" + str);
                }

                TimeOfDayStage stage2 = new TimeOfDayStage(name, school.CurLevel.FinishTime() + AfterschoolActivity.kAfterschoolActivityLength, num3);
                ths.Stages = new List<Stage>(new Stage[] { stage2 });
                ths.ActiveStage = stage2;
                ths.SetAvailableTones(null);
                ths.Actor.RemoveExitReason(ExitReason.StageComplete);

                if (!flag6)
                {
                    activity.StartSkillGainForActivity(ths.Actor);

                    activity.StartAmbientSounds(ths.Actor, ths.Target);

                    if (!sCareerPerformAfterschoolPreLoop.Invoke<bool>(new object[] { ths, activity }))
                    {
                        if (activity.CurrentActivityType == AfterschoolActivityType.StudyClub)
                        {
                            school.AddHomeworkToStudent(false);
                            ths.mHomework = school.OwnersHomework;
                            if (ths.mHomework != null)
                            {
                                school.DidHomeworkInStudyClubToday = true;
                                ths.mHomework.PercentComplete = 0f;
                                ths.mHomeworkCompletionRate = ths.mHomework.GetCompletionRate(ths.Actor, false, true);
                            }
                        }
                    }

                    ths.mLastLTRUpdateDateAndTime = SimClock.CurrentTime();

                    afterSchoolLoop = sCareerPerformAfterschoolLoop.Invoke<InteractionInstance.InsideLoopFunction>(new object[] { ths, activity });
                    if (afterSchoolLoop == null)
                    {
                        afterSchoolLoop = ths.AfterschoolActivityLoopDelegate;
                    }
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(ths.Actor, ths.Target, e);
            }
        }
        public static void PostAfterSchoolLoop(GoToSchoolInRabbitHole ths, bool succeeded, AfterschoolActivity activity, InteractionInstance.InsideLoopFunction afterSchoolLoop)
        {
            try
            {
                if (afterSchoolLoop != null)
                {
                    ths.Target.ClearAmbientSounds(ths.Target);
                    ths.Target.AddAmbientSound("rhole_school_oneshot");

                    foreach (SkillNames names in activity.ActivitySkillNameList)
                    {
                        ths.Actor.SkillManager.StopSkillGain(names);
                    }

                    if (!sCareerPerformAfterschoolPostLoop.Invoke<bool>(new object[] { ths, activity }))
                    {
                        if (activity.CurrentActivityType == AfterschoolActivityType.ArtClub)
                        {
                            activity.CheckForNewPainting(ths.Actor);
                        }
                    }

                    ISchoolRabbitHole target = GetTarget(ths);

                    target.HasAfterschoolActivityToday = false;
                }

                ths.Actor.School.FinishWorking();
                
                ths.EndCommodityUpdates(succeeded);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(ths.Actor, ths.Target, e);
            }
        }
Пример #18
0
 public static bool PreInRabbitholeLoop(GoToSchoolInRabbitHole ths)
 {
     return(PreInRabbitholeLoop(ths, ths.Actor.School.IsAllowedToWork()));
 }
        public static ISchoolRabbitHole GetTarget(GoToSchoolInRabbitHole ths)
        {
            ISchoolRabbitHole target = ths.Target as ISchoolRabbitHole;
            if (target == null)
            {
                SchoolRabbitholeProxy proxy;
                if (!sSchoolRabbitholeProxies.TryGetValue(ths.Target, out proxy))
                {
                    proxy = new SchoolRabbitholeProxy();
                    sSchoolRabbitholeProxies.Add(ths.Target, proxy);
                }

                target = proxy;
            }

            return target;
        }
        public static void PostInRabbitHoleLoop(GoToSchoolInRabbitHole ths, ref bool succeeded, ref bool detention, ref bool fieldTrip, ref AfterschoolActivity activity, ref bool hasAfterschoolActivity)
        {
            try
            {
                School school = ths.Actor.School;

                ISchoolRabbitHole target = GetTarget(ths);

                activity = ths.GetAfterschoolActivity(ths.Actor, school, target, ref hasAfterschoolActivity);

                fieldTrip = FieldTripSituation.GetFieldTripSituation(ths.Actor) != null;
                detention = school.CurentDetentionStatus == School.DetentionStatus.HasDetention;

                if (detention && !fieldTrip)
                {
                    school.CurentDetentionStatus = School.DetentionStatus.InDetention;
                    float maxDurationInHours = (school.DayLength + Career.kNumHoursEarlyCanShowUpForWork) + school.SchoolTuning.DetentionLengthInHours;
                    TimeOfDayStage stage = new TimeOfDayStage(Localization.LocalizeString(ths.Actor.IsFemale, "Gameplay/Careers/WorkInRabbitHole:SchoolDetention", new object[0x0]), school.CurLevel.FinishTime() + school.SchoolTuning.DetentionLengthInHours, maxDurationInHours);
                    ths.Stages = new List<Stage>(new Stage[] { stage });
                    ths.ActiveStage = stage;
                    school.SetTones(ths);
                    ths.Actor.RemoveExitReason(ExitReason.StageComplete);
                    ths.Actor.BuffManager.AddElement(BuffNames.Detention, Origin.FromSchool);
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(ths.Actor, ths.Target, e);
            }
        }
Пример #21
0
 // Externalized to MasterController and StoryProgression
 public static bool PerformAfterschoolPostLoop(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
 {
     try
     {
         return AfterschoolActivityEx.PerformAfterschoolPostLoop(interaction, activity);
     }
     catch (Exception e)
     {
         Common.Exception("GetAfterSchoolDelegate", e);
         return false;
     }
 }
Пример #22
0
 public ExplorerLoop(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
     : base(interaction, activity)
 {
 }
Пример #23
0
 public LoopProxy(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
 {
     mInteraction = interaction;
     mActivity    = activity;
 }
Пример #24
0
 public static void PerformPostLoopArtClub(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
 {
     try
     {
         activity.CheckForNewPainting(interaction.Actor);
     }
     catch (ResetException)
     {
         throw;
     }
     catch (Exception e)
     {
         Common.Exception(interaction.Actor, interaction.Target, e);
     }
 }
        public static bool PreInRabbitholeLoop(GoToSchoolInRabbitHole ths, bool allowedToWork)
        {
            try
            {
                LotManager.SetAutoGameSpeed();

                //CancellableByPlayer = false;

                ths.BeginCommodityUpdates();

                if (!allowedToWork)
                {
                    ths.EndCommodityUpdates(false);
                    return false;
                }

                ths.Actor.School.StartWorking();
                return true;
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(ths.Actor, ths.Target, e);
                return false;
            }
        }
Пример #26
0
        public static void PostDetentionLoop(GoToSchoolInRabbitHole ths, bool succeeded, bool detention, bool fieldTrip, AfterschoolActivity activity, bool hasAfterschoolActivity, ref InteractionInstance.InsideLoopFunction afterSchoolLoop)
        {
            try
            {
                School school = ths.Actor.School;

                ISchoolRabbitHole target = GetTarget(ths);

                bool flag5 = false;
                bool flag6 = false;
                if (!fieldTrip && !detention)
                {
                    if (hasAfterschoolActivity)
                    {
                        flag5 = true;
                    }
                    else if (!ths.Actor.IsInActiveHousehold && target.HasAfterschoolActivityToday)
                    {
                        flag5 = RandomUtil.CoinFlip();
                        flag6 = true;
                    }
                }

                if (!flag5)
                {
                    school.FinishWorking();

                    ths.EndCommodityUpdates(succeeded);
                    return;
                }

                CommodityChange fun = new CommodityChange(CommodityKind.Fun, 50, false, 25, OutputUpdateType.ContinuousFlow, false, false, UpdateAboveAndBelowZeroType.Either);

                ths.BeginCommodityUpdate(fun, 1);

                ths.mParticipatedInAfterschoolActivity = true;
                string str  = flag6 ? AfterschoolActivityType.ArtClub.ToString() : activity.CurrentActivityType.ToString();
                float  num3 = (school.DayLength + Career.kNumHoursEarlyCanShowUpForWork) + AfterschoolActivity.kAfterschoolActivityLength;

                string name = null;
                if (Localization.HasLocalizationString("Gameplay/Careers/AfterschoolActivity:" + str))
                {
                    name = Common.LocalizeEAString(ths.Actor.IsFemale, "Gameplay/Careers/AfterschoolActivity:" + str);
                }
                else
                {
                    name = Common.LocalizeEAString(ths.Actor.IsFemale, "Gameplay/Abstracts/Careers/AfterschoolActivity:" + str);
                }

                TimeOfDayStage stage2 = new TimeOfDayStage(name, school.CurLevel.FinishTime() + AfterschoolActivity.kAfterschoolActivityLength, num3);
                ths.Stages      = new List <Stage>(new Stage[] { stage2 });
                ths.ActiveStage = stage2;
                ths.SetAvailableTones(null);
                ths.Actor.RemoveExitReason(ExitReason.StageComplete);

                if (!flag6)
                {
                    activity.StartSkillGainForActivity(ths.Actor);

                    activity.StartAmbientSounds(ths.Actor, ths.Target);

                    if (!sCareerPerformAfterschoolPreLoop.Invoke <bool>(new object[] { ths, activity }))
                    {
                        if (activity.CurrentActivityType == AfterschoolActivityType.StudyClub)
                        {
                            school.AddHomeworkToStudent(false);
                            ths.mHomework = school.OwnersHomework;
                            if (ths.mHomework != null)
                            {
                                school.DidHomeworkInStudyClubToday = true;
                                ths.mHomework.PercentComplete      = 0f;
                                ths.mHomeworkCompletionRate        = ths.mHomework.GetCompletionRate(ths.Actor, false, true);
                            }
                        }
                    }

                    ths.mLastLTRUpdateDateAndTime = SimClock.CurrentTime();

                    afterSchoolLoop = sCareerPerformAfterschoolLoop.Invoke <InteractionInstance.InsideLoopFunction>(new object[] { ths, activity });
                    if (afterSchoolLoop == null)
                    {
                        afterSchoolLoop = ths.AfterschoolActivityLoopDelegate;
                    }
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(ths.Actor, ths.Target, e);
            }
        }
Пример #27
0
 public static void PerformPostLoopChessClub(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
 {
     try
     {
         Chess skill = interaction.Actor.SkillManager.GetSkill<Chess>(SkillNames.Chess);
         if (skill != null)
         {
             if (RandomUtil.CoinFlip())
             {
                 skill.NumberOfWins++;
             }
             else
             {
                 skill.NumberOfLosses++;
             }
         }
     }
     catch (ResetException)
     {
         throw;
     }
     catch (Exception e)
     {
         Common.Exception(interaction.Actor, interaction.Target, e);
     }
 }
Пример #28
0
 public static InteractionInstance.InsideLoopFunction PerformLoopExplorerClub(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
 {
     return new ExplorerLoop(interaction, activity).Perform;
 }
Пример #29
0
 public GeologyLoop(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
     : base(interaction, activity)
 { }
Пример #30
0
 public static InteractionInstance.InsideLoopFunction PerformLoopExplorerClub(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
 {
     return(new ExplorerLoop(interaction, activity).Perform);
 }
Пример #31
0
 public GeologyLoop(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
     : base(interaction, activity)
 {
 }
Пример #32
0
        public static void PerformPreLoopStudyClub(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
        {
            try
            {
                School school = interaction.Actor.School;

                school.AddHomeworkToStudent(false);
                interaction.mHomework = school.OwnersHomework;
                if (interaction.mHomework != null)
                {
                    school.DidHomeworkInStudyClubToday = true;
                    interaction.mHomework.PercentComplete = 0f;
                    interaction.mHomeworkCompletionRate = interaction.mHomework.GetCompletionRate(interaction.Actor, false, true);
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(interaction.Actor, interaction.Target, e);
            }
        }
Пример #33
0
 // Externalized to MasterController and StoryProgression
 public static InteractionInstance.InsideLoopFunction PerformAfterschoolLoop(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
 {
     try
     {
         return AfterschoolActivityEx.PerformAfterschoolLoop(interaction, activity);
     }
     catch (Exception e)
     {
         Common.Exception("GetAfterSchoolDelegate", e);
         return null;
     }
 }
Пример #34
0
        public static bool PerformAfterschoolPostLoop(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
        {
            AfterschoolActivityData data = AfterschoolActivityBooter.GetActivity(activity.CurrentActivityType);

            data.PerformPostLoop(interaction, activity);
            return true;
        }
Пример #35
0
 public LoopProxy(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
 {
     mInteraction = interaction;
     mActivity = activity;
 }
Пример #36
0
        public static InteractionInstance.InsideLoopFunction PerformAfterschoolLoop(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
        {
            AfterschoolActivityData data = AfterschoolActivityBooter.GetActivity(activity.CurrentActivityType);

            return(data.LoopDelegate(interaction, activity));
        }
Пример #37
0
        public InteractionInstance.InsideLoopFunction LoopDelegate(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
        {
            try
            {
                if (mLoop != null)
                {
                    InteractionInstance.InsideLoopFunction del = (InteractionInstance.InsideLoopFunction)mLoop.Invoke(null, new object[] { interaction, activity });
                    if (del != null)
                    {
                        return del;
                    }
                }

                return interaction.AfterschoolActivityLoopDelegate;
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(interaction.Actor, interaction.Target, e);
                return null;
            }
        }
Пример #38
0
        public static InteractionInstance.InsideLoopFunction PerformAfterschoolLoop(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
        {
            AfterschoolActivityData data = AfterschoolActivityBooter.GetActivity(activity.CurrentActivityType);

            return data.LoopDelegate(interaction, activity);
        }
 public static bool PreInRabbitholeLoop(GoToSchoolInRabbitHole ths)
 {
     return PreInRabbitholeLoop(ths, ths.Actor.School.IsAllowedToWork());
 }
Пример #40
0
 public ExplorerLoop(GoToSchoolInRabbitHole interaction, AfterschoolActivity activity)
     : base(interaction, activity)
 { }