コード例 #1
0
ファイル: Match.cs プロジェクト: rowanlittlefield/SharpChess
        private Navigation _playTick(UserAction userAction)
        {
            switch (userAction)
            {
            case UserAction.Enter:
                _board.SelectCursorPosition(_currentPlayer);
                break;

            case UserAction.Start:
                var command = new SaveMatchCommand(this);
                return(new Navigation(NavigationAction.Push, new MatchStartMenu(command)));

            case UserAction.ToggleTheme:
                _board.ToggleTheme();
                break;

            case UserAction.FlipBoard:
                _board.FlipBoard();
                break;

            case UserAction.Undo:
                _history.Back(_board);
                break;

            case UserAction.Redo:
                _history.Forward(_board);
                break;

            default:
                _board.MoveCursor(userAction);
                break;
            }

            return(new Navigation(NavigationAction.Null, NullGameComponent.GetInstance()));
        }
コード例 #2
0
 public MatchStartMenu(SaveMatchCommand saveMatchCommand)
 {
     OptionsIndex      = 0;
     _saveMatchCommand = saveMatchCommand;
 }