public static Composite ChooseCharacterAndPressPlay(CharacterPositionDelegate characterPositionDelegate) { return(new DecoratorContinue(x => GameController.Game.IsSelectCharacterState == true, new Action(delegate(object context) { for (int i = 0; i < 6; i++) { InputWrapper.KeyPress(Keys.Up); Thread.Sleep(40); } for (int i = 1; i < characterPositionDelegate(context); i++) { InputWrapper.KeyPress(Keys.Down); Thread.Sleep(40); } Mouse.SetCursorPosAndLeftOrRightClick(playButtonRect2560x1600, 250); ControlTimer.Restart(); while (ControlTimer.ElapsedMilliseconds < 6000 && GameController.Game.IsSelectCharacterState) { Thread.Sleep(50); } if (GameController.Game.IsSelectCharacterState == false) { return RunStatus.Success; } return RunStatus.Failure; }) )); }
public static Composite TryEnterGameFromLoginScreen(CharacterPositionDelegate characterPositionDelegate) { return(new Sequence( Login(), ChooseCharacterAndPressPlay(characterPositionDelegate) )); }