Exemple #1
0
 public void EngineStop()
 {
     PullController.Stop();
     Stuck.Stop();
     Navigator.Stop();
     Navigation = null;
     Navigator  = null;
     _states    = null;
     CombatHandler.CombatStatusChanged -= CombatChanged;
     GC.Collect();
 }
Exemple #2
0
        public bool EngineStart()
        {
            GrindingSettings.LoadSettings();
            if (!ObjectManager.InGame)
            {
                Logging.Write(LogType.Info, "【地面战斗】先登录游戏");
                return(false);
            }
            if (ObjectManager.MyPlayer.IsDead && ObjectManager.MyPlayer.IsGhost)
            {
                Logging.Write(LogType.Info, "【地面战斗】先复活吧");
                return(false);
            }
            if (CurrentProfile == null)
            {
                Logging.Write(LogType.Info, "【地面战斗】先读取一个Profile文件");
                return(false);
            }
            Navigator  = new GrindingNavigator();
            Navigation = new GrindingNavigation(CurrentProfile);
            GrindingSettings.LoadSettings();
            ToTown.SetToTown(false);
            switch (CurrentMode)
            {
            case Mode.TestToTown:
                Logging.Write(LogType.Warning,
                              "Starting Grinding engine in TestToTown mode, next start will be in normal mode THIS IS TODO");
                //TODO
                break;

            default:
                _states = new List <MainState>
                {
                    new StatePull(),
                    new StateLoot(),
                    new StateMoving(),
                    new StateTrainer(),
                    new StateResting(),
                    new StateResurrect(),
                    new StateCombat(),
                    new StateToTown(),
                    new StateVendor(),
                };
                break;
            }
            Stuck.Run();
            CurrentMode = Mode.Normal;
            CombatHandler.CombatStatusChanged += CombatChanged;
            CloseWindows();
            loots      = 0;
            _kills     = 0;
            _death     = 0;
            _xpInitial = ObjectManager.MyPlayer.Experience;
            _startTime = DateTime.Now;

            /*
             * if (GrindingSettings.ShouldTrain)
             * {
             *  ShouldTrain = GrindingShouldTrain.ShouldTrain();
             * }*/
            PullController.Start();
            return(true);
        }