Exemplo n.º 1
0
        // Methods
        public override bool BeforeEnteringRabbitHole()
        {
            ProSports job = OmniCareer.Career <ProSports>(Actor.Occupation);

            if (job == null)
            {
                return(false);
            }

            if (!job.IsAllowedToWork() && job.IsAllowedToWorkThisTime(ProSports.kGameStartTime, ProSports.kGameLength))
            {
                return(job.WaitForWork(Actor, Target));
            }
            return(true);
        }
Exemplo n.º 2
0
        public override bool InRabbitHole()
        {
            try
            {
                bool succeeded = false;
                BeginCommodityUpdates();

                try
                {
                    ProSports career = OmniCareer.Career <ProSports>(Actor.OccupationAsCareer);

                    if (career.IsAllowedToWork())
                    {
                        career.StartWorking();
                        career.StartGame();
                        succeeded = DoLoop(~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached), new Interaction <Sim, RabbitHole> .InsideLoopFunction(GameLoop), null);
                        career.FinishWorking();
                        if (!succeeded)
                        {
                            career.mActorLeftGame = true;
                        }
                        if (!succeeded)
                        {
                            EventTracker.SendEvent(EventTypeId.kWorkCanceled, Actor);
                        }
                    }
                }
                finally
                {
                    EndCommodityUpdates(succeeded);
                }

                return(succeeded);
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }