Пример #1
0
        public override Job CreateJob()
        {
            var job = JobGenerator.CreateJobMoveAndClickMouse(_jobGenerator.Form, Globals.CloseServerConnectFail, true);

            job.AddSubJob(new JobWaitTime(_jobGenerator.Form, 750));
            return(job);
        }
Пример #2
0
        protected override void MakeActionSequenceTree()
        {
            ActionSequenceTree fromMain =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[fromMain]");
                AddSubJob(new JobMovePage(_form, Globals.MainPage, Globals.Mail, Globals.MailPage));
            });

            ActionSequenceTree fromMail =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[fromMail]");
                AddSubJob(new JobWaitTime(_form, 500, true));
                AddSubJob(JobGenerator.CreateJobMoveAndClickMouse(_form, Globals.RecvAllInMailPage));
                AddSubJob(new JobWaitTime(_form, 500, true));

                AddSubJob(new JobMovePage(_form, Globals.MailPage, Globals.OutFromMailPage, Globals.MainPage));
            });


            fromMain.Completed         = fromMail;
            fromMain.ActionOnCompleted = () => { _returnState = State.Completed; };

            _currentAction = fromMain;

            // make repair map
            _repairMap[Globals.MailPage] = fromMail;
        }
Пример #3
0
        public override Job CreateJob()
        {
            var job = JobGenerator.CreateJobMoveAndClickMouse(_jobGenerator.Form, Globals.KeepGoingInStopPage, true);

            job.AddSubJob(new JobWaitTime(_jobGenerator.Form, 750));
            return(job);
        }
Пример #4
0
        public override Job CreateJob()
        {
            var job = JobGenerator.CreateJobMoveAndClickMouse(_jobGenerator.Form, Globals.OutFromTraverseDeadPage, true);

            job.AddSubJob(new JobWaitTime(_jobGenerator.Form, 750));
            return(job);
        }
Пример #5
0
        public override Job CreateJob()
        {
            var job1 = JobGenerator.CreateJobMoveAndClickMouse(_jobGenerator.Form, Globals.DontSeeInOneFlus, true);

            job1.AddSubJob(new JobWaitTime(_jobGenerator.Form, 750));

            var job2 = JobGenerator.CreateJobMoveAndClickMouse(_jobGenerator.Form, Globals.ExitOneFlusAdvertise, true);

            job2.AddSubJob(new JobWaitTime(_jobGenerator.Form, 750));

            job1.AddSubJob(job2);

            return(job1);
        }
Пример #6
0
        public MainForm()
        {
            InitializeComponent();
            LoadMatchPages();
            LoadSubImages();
            InitTimers();

            HookStates hookState;

            HookProcessHandle(VirtualMachineProcess, out hookState);

            _currentPageName = Globals.UnknownPage;
            _prevPageName    = Globals.UnknownPage;
            _jobGenerator    = new Jobs.JobGenerator(this);
        }
Пример #7
0
        public override State Process()
        {
            ActivateIfInActive();

            var    endTime = DateTime.Now;
            double elapsed = (endTime - _startTime).TotalMilliseconds;

            if (elapsed > 300000 && _subJobs.Count > 0)
            {
                string term = "[JobMovePage] have no action for too long time!!!! remove self  time : " + endTime + "\n";

                return(_status = State.Failed);
            }

            if (!_waitFinished)
            {
                var status = ProcessSubJobs();

                if (status == State.Completed)
                {
                    _waitFinished = true;
                }

                return(_status = State.Active);
            }
            else
            {
                var pageName = _form.CurrentPageName;

                Console.WriteLine("[" + pageName + "] " + Type + " from : \"" + _from + "\"   clickUI : \"" + _ui + "\"   to : " + _debugToPageString);

                if (Check(pageName))
                {
                    return(_status = State.Completed);
                }

                if (_subJobs.Count == 0 && pageName == _from)
                {
                    AddSubJob(JobGenerator.CreateJobMoveAndClickMouse(_form, _ui, true));
                    AddSubJob(new JobWaitTime(_form, _clickDelay));
                }

                ProcessSubJobs();

                return(_status = State.Active);
            }
        }
Пример #8
0
        protected override void MakeActionSequenceTree()
        {
            ActionSequenceTree fromLogin =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[fromLogin]");
                // #fix - to page
                AddSubJob(new JobMovePage(_form, Globals.LoginPage, _signInWith, Globals.FacebookPage));

                if (_signInWith == Globals.Facebook)
                {
                    AddSubJob(new JobCheckUntilMeetPage(_form, new string[] { Globals.FacebookPage }));
                }
                else if (_signInWith == Globals.Google)
                {
                    //AddSubJob(new JobCheckCurrentPage(_form, new string[] { Globals.GooglePage }));
                }
                else if (_signInWith == Globals.Guest)
                {
                    //AddSubJob(new JobCheckCurrentPage(_form, new string[] { Globals.FacebookPage }));
                }
            });

            ActionSequenceTree fromFacebookLogin =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[fromFacebookLogin]");

                AddSubJob(JobGenerator.CreateJobMoveAndClickMouse(_form, Globals.EmailInFacebook, true));
                AddSubJob(new JobWaitTime(_form, 1000));

                AddSubJob(new JobPressKeyboard(_form, _email));
                AddSubJob(new JobWaitTime(_form, 500));

                AddSubJob(JobGenerator.CreateJobMoveAndClickMouse(_form, Globals.PasswordInFacebook, true));
                AddSubJob(new JobWaitTime(_form, 1000));

                AddSubJob(new JobPressKeyboard(_form, _password));
                AddSubJob(new JobWaitTime(_form, 500));

                AddSubJob(new JobMovePage(_form, Globals.FacebookPage, Globals.LoginInFacebook, Globals.FacebookConfirmPage, 2000, 2000));

                AddSubJob(new JobCheckUntilMeetPage(_form, new string[] { Globals.FacebookConfirmPage }));
            });

            ActionSequenceTree fromFacebookConfirm =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[fromFacebookConfirm]");
                AddSubJob(new JobMovePage(_form, Globals.FacebookConfirmPage, Globals.YesInFacebook, Globals.StartGamePage));

                AddSubJob(new JobCheckUntilMeetPage(_form, new string[] { Globals.StartGamePage }));
            });


            ActionSequenceTree fromStartGame =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[fromStartGame]");
                AddSubJob(new JobMovePage(_form, Globals.StartGamePage, Globals.ClickOnStartGamePage, Globals.CharacterSelectPage));
            });

            ActionSequenceTree fromCharacterSelect =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[fromCharacterSelect]");
                AddSubJob(new JobMovePage(_form, Globals.CharacterSelectPage, Globals.StartGameInSelectPage, Globals.NotifyPage));
            });

            ActionSequenceTree closeNotifyPage =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[closeNotifyPage]");
                AddSubJob(new JobMovePage(_form, Globals.NotifyPage, Globals.CloseNotify, Globals.MainPage));
            });

            fromLogin.Completed           = fromFacebookLogin;
            fromFacebookLogin.Completed   = fromFacebookConfirm;
            fromFacebookConfirm.Completed = fromStartGame;
            fromStartGame.Completed       = fromCharacterSelect;
            fromCharacterSelect.Completed = closeNotifyPage;

            _currentAction = fromLogin;

            // make repair map
            _repairMap[Globals.LoginPage]           = fromLogin;
            _repairMap[Globals.FacebookPage]        = fromFacebookLogin;
            _repairMap[Globals.FacebookConfirmPage] = fromFacebookConfirm;
            _repairMap[Globals.StartGamePage]       = fromStartGame;
            _repairMap[Globals.CharacterSelectPage] = fromCharacterSelect;
        }
Пример #9
0
 public CheckMailEvaluator(JobGenerator generator)
     : base(generator)
 {
 }
Пример #10
0
 public PlayRaidEvaluator(JobGenerator generator)
     : base(generator)
 {
 }
Пример #11
0
 public OutFromTraverseDeadEvaluator(JobGenerator generator)
     : base(generator)
 {
 }
Пример #12
0
 public PlayWeekEvaluator(JobGenerator generator)
     : base(generator)
 {
     Reset();
 }
Пример #13
0
 public ClearQuestEvaluator(JobGenerator generator)
     : base(generator)
 {
 }
Пример #14
0
 public CompeteBattleEvaluator(JobGenerator generator)
     : base(generator)
 {
 }
Пример #15
0
 public TakeAbrasiveEvaluator(JobGenerator generator)
     : base(generator)
 {
     Reset();
 }
Пример #16
0
 public PlayTraverseEvaluator(JobGenerator generator)
     : base(generator)
 {
 }
Пример #17
0
 public CloseServerConnectFailEvaluator(JobGenerator generator)
     : base(generator)
 {
 }
Пример #18
0
 public JobEvaluator(JobGenerator generator)
 {
     _jobGenerator = generator;
 }
Пример #19
0
 public ExitOneFlusAdvertiseEvaluator(JobGenerator generator)
     : base(generator)
 {
 }
Пример #20
0
 public ExitArisAdvertiseEvaluator(JobGenerator generator)
     : base(generator)
 {
 }
Пример #21
0
 public RestartEmulatorEvaluator(JobGenerator generator)
     : base(generator)
 {
     Reset();
 }
Пример #22
0
        protected override void MakeActionSequenceTree()
        {
            ActionSequenceTree fromTrial =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[fromTrial]");
                AddSubJob(new JobMovePage(_form, Globals.MainPage, Globals.Trial, Globals.TrialPage));
                AddSubJob(new JobCheckUntilMeetPage(_form, new string[] { Globals.TrialPage }));
            });

            ActionSequenceTree findBeforeDrag =
                new ActionSequenceTree(
                    () =>
            {
                Console.WriteLine("[findBeforeDrag]");

                string what = "";
                if (_todo.TryGetValue(_currentState, out what))
                {
                    AddSubJob(new JobTryFindSubImage(_form, what));
                }
            });

            ActionSequenceTree click =
                new ActionSequenceTree(
                    () =>
            {
                Console.WriteLine("[click]");
                OpenCvSharp.Rect rect = (OpenCvSharp.Rect)BlackBoard.Instance.Read(BlackBoard.UIRectBlackBoardID, this);
                var pos = Utils.RectToPos(rect.X + 50, rect.Y + 100, rect.Width, rect.Height);
                AddSubJob(new JobMoveAndClickMouse(_form, pos));
            });


            ActionSequenceTree drag =
                new ActionSequenceTree(
                    () =>
            {
                Console.WriteLine("[drag]");
                AddSubJob(new JobWaitTime(_form, 1500));
                Drag(_form, this, new System.Drawing.Point(0, 0));
                AddSubJob(new JobWaitTime(_form, 1000));
                Drag(_form, this, new System.Drawing.Point(-100, 0));
                AddSubJob(new JobWaitTime(_form, 1000));
            });

            ActionSequenceTree findAfterDrag =
                new ActionSequenceTree(
                    () =>
            {
                Console.WriteLine("[findAfterDrag]");

                string what = "";
                if (_todo.TryGetValue(_currentState, out what))
                {
                    AddSubJob(new JobTryFindSubImage(_form, what));
                }
            });


            ActionSequenceTree fromTrialStage =
                new ActionSequenceTree(
                    () =>
            {
                Console.WriteLine("[fromTrialStage]");
                AddSubJob(new JobWaitTime(_form, 1500));
                Drag(_form, this, new System.Drawing.Point(0, 0));
                AddSubJob(new JobWaitTime(_form, 1000));
                Drag(_form, this, new System.Drawing.Point(-100, 0));
                AddSubJob(new JobWaitTime(_form, 1000));
            });

            ActionSequenceTree getCurrentPage =
                new ActionSequenceTree(
                    () =>
            {
                Console.WriteLine("[getCurrentPage]");
                AddSubJob(new JobWaitTime(_form, 3000));
                _currentPage = _form.CurrentPageName;
            });


            ActionSequenceTree start =
                new ActionSequenceTree(
                    () =>
            {
                Console.WriteLine("[start]  current page : " + _currentPage);

                string ui;
                if (_clickUI.TryGetValue(_currentPage, out ui))
                {
                    AddSubJob(JobGenerator.CreateJobMoveAndClickMouse(_form, ui, true));
                    AddSubJob(new JobWaitTime(_form, 1000));
                    AddSubJob(JobGenerator.CreateJobMoveAndClickMouse(_form, ui, true));
                    AddSubJob(new JobWaitTime(_form, 1000));
                }
            });

            ActionSequenceTree checkNoPageMove =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[checkCurrentPage]");
                AddSubJob(new JobCheckPage(_form, _currentPage, 5000));
            });


            ActionSequenceTree fromResult =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[fromResult]");

                AddSubJob(JobGenerator.CreateJobMoveAndClickMouse(_form, Globals.ToTrialFromTrialResult, true));
                AddSubJob(new JobWaitTime(_form, 1000));
                AddSubJob(JobGenerator.CreateJobMoveAndClickMouse(_form, Globals.ToTrialFromTrialResult, true));
                AddSubJob(new JobWaitTime(_form, 1000));
            });

            ActionSequenceTree checkCurrentPage =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[checkCurrentPage]");
                AddSubJob(new JobCheckPage(_form, Globals.TrialPage, 8000));
            });

            ActionSequenceTree backToTrial =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[backToTrial]");

                AddSubJob(new JobMovePage(_form, _currentPage, Globals.BackInTrialLevelPages, Globals.TrialPage));
            });

            ActionSequenceTree checkCurrentState =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[checkCurrentState]");
                AddSubJob(new JobCheckCondition(_form, () => { return(_currentState == TrialState.Finished); }));
            });

            ActionSequenceTree exitTrial =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[exitTrial]");
                AddSubJob(new JobMovePage(_form, Globals.TrialPage, Globals.BackInTrial, Globals.MainPage));
            });

            fromTrial.Completed = checkCurrentState;

            checkCurrentState.Completed = exitTrial;
            checkCurrentState.Failed    = findBeforeDrag;

            findBeforeDrag.Completed     = click;
            findBeforeDrag.Failed        = drag;
            drag.Completed               = findAfterDrag;
            findAfterDrag.Completed      = click;
            findAfterDrag.Failed         = fromTrial;
            findAfterDrag.ActionOnFailed = () => { UpdateTrialState(); };

            click.Completed          = fromTrialStage;
            fromTrialStage.Completed = getCurrentPage;
            getCurrentPage.Completed = start;
            start.Completed          = checkNoPageMove;

            // not started
            checkNoPageMove.Completed = backToTrial;
            checkNoPageMove.Failed    = fromResult;

            fromResult.Completed = checkCurrentPage;

            checkCurrentPage.Completed    = fromTrial;
            checkCurrentPage.Failed       = backToTrial;
            backToTrial.Completed         = fromTrial;
            backToTrial.ActionOnCompleted = () => { UpdateTrialState(); };



            exitTrial.ActionOnCompleted = () =>
            {
                if (_currentState == TrialState.Finished)
                {
                    Console.WriteLine("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
                    Console.WriteLine("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
                    Console.WriteLine("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
                    _returnState = State.Completed;
                }
                else
                {
                    Console.WriteLine("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
                    Console.WriteLine("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
                    Console.WriteLine("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
                    _returnState = State.Failed;
                }
            };

            _currentAction = fromTrial;

            // make repair map
            _repairMap[Globals.TrialPage]            = fromTrial;
            _repairMap[Globals.TrialSweepAwayPage]   = fromTrialStage;
            _repairMap[Globals.TrialMansFightPage]   = fromTrialStage;
            _repairMap[Globals.TrialWomansFightPage] = fromTrialStage;
            _repairMap[Globals.TrialTwoDevilPage]    = fromTrialStage;
            //_repairMap[Globals.TrialBattleGodPage] = fromTrialStage;
            _repairMap[Globals.TrialStormEyePage] = fromTrialStage;
            _repairMap[Globals.TrialBloodyPage]   = fromTrialStage;
            _repairMap[Globals.TrialResultPage]   = fromResult;
        }
Пример #23
0
 public UpgradeItemEvaluator(JobGenerator generator)
     : base(generator)
 {
     Reset();
 }
Пример #24
0
 public CloseOptionEvaluator(JobGenerator generator)
     : base(generator)
 {
 }
Пример #25
0
 public PlayPartyEvaluator(JobGenerator generator)
     : base(generator)
 {
 }
Пример #26
0
 public StartInGameStopEvaluator(JobGenerator generator)
     : base(generator)
 {
 }
Пример #27
0
 public PlayTrialEvaluator(JobGenerator generator)
     : base(generator)
 {
 }
Пример #28
0
 public FishingEvaluator(JobGenerator generator)
     : base(generator)
 {
 }
        protected override void MakeActionSequenceTree()
        {
            ActionSequenceTree fromMain =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[fromMain]");
                AddSubJob(new JobMovePage(_form, Globals.MainPage, Globals.Menu, Globals.MenuPage));
            });

            ActionSequenceTree fromMenu =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[fromMenu]");
                AddSubJob(new JobMovePage(_form, Globals.MenuPage, Globals.MenuToItem, Globals.ItemPage));
            });

            ActionSequenceTree fromItem =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[fromItem]");

                AddSubJob(JobGenerator.CreateJobMoveAndClickMouse(_form, Globals.ItemSlot2, true));
                AddSubJob(new JobWaitTime(_form, 750));
                AddSubJob(JobGenerator.CreateJobMoveAndClickMouse(_form, Globals.ItemSlot2, true));
                AddSubJob(new JobWaitTime(_form, 750));
                AddSubJob(JobGenerator.CreateJobMoveAndClickMouse(_form, Globals.ItemSlot2, true));
                AddSubJob(new JobWaitTime(_form, 750));
            });

            ActionSequenceTree selectItem =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[selectItem]");
                if (_upgradeState != UpgradeState.Finished)
                {
                    var item = _upgradeItemOnState[_upgradeState];
                    AddSubJob(new JobMovePage(_form, Globals.ItemPage, item, Globals.ItemDetailPage));
                }
            });


            ActionSequenceTree fromItemDetail =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[fromItemDetail]");
                AddSubJob(new JobMovePage(_form, Globals.ItemDetailPage, Globals.ToUpgrade, Globals.ItemUpgradePage));
                AddSubJob(new JobWaitTime(_form, 750));
            });


            // upgrade
            ActionSequenceTree findItem =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[findItem]");
                AddSubJob(new JobTryFindOneOfSubImages(_form, _itemRanks));
            });

            ActionSequenceTree clickItem =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[clickItem]");
                OpenCvSharp.Rect rect = (OpenCvSharp.Rect)BlackBoard.Instance.Read(BlackBoard.UIRectBlackBoardID, this);

                int addX = 10;
                int addY = 20;

                var pos = Utils.RectToPos(rect.X + addX, rect.Y + addY, rect.Width, rect.Height);

                AddSubJob(new JobMoveAndClickMouse(_form, pos));
                AddSubJob(new JobWaitTime(_form, 500));
            });

            ActionSequenceTree upgrade =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[upgrade]");
                AddSubJob(JobGenerator.CreateJobMoveAndClickMouse(_form, Globals.StartUpgrade, true));
                AddSubJob(new JobWaitTime(_form, 500));
                AddSubJob(new JobCheckPage(_form, Globals.ItemUpgradeResultPage, 5000));
            });

            ActionSequenceTree checkLockPage =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[checkLockPage]");
                AddSubJob(new JobWaitTime(_form, 500));
                AddSubJob(new JobCheckPage(_form, Globals.ItemLockPage, 5000));
            });


            ActionSequenceTree exitResult =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[exitResult]");
                AddSubJob(
                    new JobMovePage(
                        _form,
                        Globals.ItemUpgradeResultPage,
                        Globals.OutFromUpgradeResult, Globals.ItemUpgradePage));
            });


            // exit
            ActionSequenceTree exitItemUpgrade =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[exitItemUpgrade]");
                AddSubJob(
                    new JobMovePage(
                        _form,
                        Globals.ItemUpgradePage,
                        Globals.BackInUpgradePage, Globals.ItemPage));
            });

            ActionSequenceTree checkUpgradeState =
                new ActionSequenceTree(() =>
            {
                AddSubJob(new JobCheckCondition(_form, () => { return(_upgradeState == UpgradeState.Finished); }));
            });

            ActionSequenceTree exitItemPage =
                new ActionSequenceTree(() =>
            {
                AddSubJob(JobGenerator.CreateJobMoveAndClickMouse(_form, Globals.ItemSlot1, true));
                AddSubJob(new JobWaitTime(_form, 750));
                AddSubJob(JobGenerator.CreateJobMoveAndClickMouse(_form, Globals.ItemSlot1, true));
                AddSubJob(new JobWaitTime(_form, 750));
                AddSubJob(JobGenerator.CreateJobMoveAndClickMouse(_form, Globals.ItemSlot1, true));
                AddSubJob(new JobWaitTime(_form, 750));

                Console.WriteLine("[exitItemPage]");
                AddSubJob(
                    new JobMovePage(
                        _form,
                        Globals.ItemPage,
                        Globals.BackInItemPage, Globals.MenuPage));
            });

            ActionSequenceTree exitMenu =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[exitMenu]");
                AddSubJob(
                    new JobMovePage(
                        _form,
                        Globals.MenuPage,
                        Globals.BackInMenu, Globals.MainPage));
            });

            // if repair
            ActionSequenceTree exitLockPage =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[exitLockPage]");
                AddSubJob(
                    new JobMovePage(
                        _form,
                        Globals.ItemLockPage,
                        Globals.NoInItemLockPage, Globals.ItemUpgradePage));
            });

            ActionSequenceTree exitGetVisualPage =
                new ActionSequenceTree(() =>
            {
                Console.WriteLine("[exitGetVisualPage]");
                AddSubJob(
                    new JobMovePage(
                        _form,
                        Globals.ItemGetVisualPage,
                        Globals.ExitItemGetVisual, Globals.ItemDetailPage));
            });


            fromMain.Completed       = fromMenu;
            fromMenu.Completed       = fromItem;
            fromItem.Completed       = selectItem;
            selectItem.Completed     = fromItemDetail;
            fromItemDetail.Completed = findItem;


            // upgrade
            findItem.Completed         = clickItem;
            findItem.ActionOnCompleted = () =>
            {
                _form.ItemUpgradeCnt = _form.ItemUpgradeCnt + 1;
                _nothingToUpgrade    = false;
            };

            clickItem.Completed     = upgrade;
            upgrade.Completed       = exitResult;
            upgrade.Failed          = checkLockPage;
            checkLockPage.Completed = exitLockPage;
            exitLockPage.Completed  = exitItemUpgrade;
            checkLockPage.Failed    = findItem;
            exitResult.Completed    = findItem;

            findItem.Failed = exitItemUpgrade;

            exitItemUpgrade.Completed         = checkUpgradeState;
            exitItemUpgrade.ActionOnCompleted = () =>
            {
                UpdateUpgradeState();
            };

            checkUpgradeState.Completed = exitItemPage;
            checkUpgradeState.Failed    = selectItem;

            exitItemPage.Completed     = exitMenu;
            exitMenu.ActionOnCompleted = () =>
            {
                if (_nothingToUpgrade)
                {
                    _returnState = State.Failed;
                }
                else
                {
                    _returnState = State.Completed;
                }
            };

            _currentAction = fromMain;

            // make repair map
            _repairMap[Globals.MenuPage]              = fromMenu;
            _repairMap[Globals.ItemPage]              = fromItem;
            _repairMap[Globals.ItemDetailPage]        = fromItemDetail;
            _repairMap[Globals.ItemUpgradePage]       = findItem;
            _repairMap[Globals.ItemLockPage]          = exitLockPage;
            _repairMap[Globals.ItemUpgradeResultPage] = exitResult;
            _repairMap[Globals.ItemGetVisualPage]     = exitGetVisualPage;
        }
Пример #30
0
 public CloseLoginFailEvaluator(JobGenerator generator)
     : base(generator)
 {
 }