public MainMenuControllerKeyboard(IMenu menu)
        {
            var selectUp     = new MenuSelectUp(menu);
            var selectDown   = new MenuSelectDown(menu);
            var selectChoice = new MenuSelectChoice(menu);

            _keyupMap = new Dictionary <Keys, ICommand>
            {
                { Keys.Up, selectUp },
                { Keys.Down, selectDown },
                { Keys.Enter, selectChoice }
            };
        }
Пример #2
0
        public GameWinControllerKeyboard(GameStateAgent agent, IMenu winMenu)
        {
            var selectUp     = new MenuSelectUp(winMenu);
            var selectDown   = new MenuSelectDown(winMenu);
            var selectChoice = new MenuSelectChoice(winMenu);

            _keydownOnceMap = new Dictionary <Keys, ICommand>
            {
                { Keys.R, new Reset(agent) },
                { Keys.Q, new Quit(agent) },
                { Keys.Enter, selectChoice },
                { Keys.Down, selectDown },
                { Keys.S, selectDown },
                { Keys.Up, selectUp },
                { Keys.W, selectUp }
            };
        }
        public ControllerPauseKeyboard(GameStateAgent agent, IMenu pauseMenu)
        {
            var selectUp    = new MenuSelectUp(pauseMenu);
            var selectDown  = new MenuSelectDown(pauseMenu);
            var selectRight = new MenuSelectRight(pauseMenu);
            var selectLeft  = new MenuSelectLeft(pauseMenu);

            _pauseDirections = new Dictionary <Keys, ICommand>
            {
                { Keys.W, selectUp },
                { Keys.A, selectLeft },
                { Keys.S, selectDown },
                { Keys.D, selectRight },
                { Keys.Up, selectUp },
                { Keys.Left, selectLeft },
                { Keys.Down, selectDown },
                { Keys.Right, selectRight },

                { Keys.Space, new Resume(agent) },
                { Keys.R, new Reset(agent) },
                { Keys.Q, new Quit(agent) }
            };
        }