示例#1
0
        private Dictionary <Type, ICommand> GetButtonMappings(IGameState gameState)
        {
            ItemSelectionGameState gameStateCast = (ItemSelectionGameState)gameState;

            return(new Dictionary <Type, ICommand>
            {
                { typeof(ArrowWoodInventoryButton), new ChangeSecondaryToItem(gameStateCast.InventoryMenu, Link.LinkConstants.ItemType.Rupee) },
                { typeof(BombInventoryButton), new ChangeSecondaryToItem(gameStateCast.InventoryMenu, Link.LinkConstants.ItemType.Bomb) },
                { typeof(BoomerangWoodInventoryButton), new ChangeSecondaryToItem(gameStateCast.InventoryMenu, Link.LinkConstants.ItemType.Boomerang) },
                { typeof(BowInventoryButton), new ChangeSecondaryToItem(gameStateCast.InventoryMenu, Link.LinkConstants.ItemType.Rupee) },
            });
        }
示例#2
0
        public Dictionary <Keys, ICommand> GetKeyboardMappings(IGameState gameState)
        {
            ItemSelectionGameState gameStateCast = (ItemSelectionGameState)gameState;

            return(new Dictionary <Keys, ICommand>
            {
                { Keys.Tab, new ResumeGameCommand(gameState) },
                { Keys.D0, new ResumeGameCommand(gameState) },
                { Keys.W, new MoveSelectorCommand(gameStateCast.InventoryMenu, Constants.Direction.Up) },
                { Keys.D, new MoveSelectorCommand(gameStateCast.InventoryMenu, Constants.Direction.Right) },
                { Keys.S, new MoveSelectorCommand(gameStateCast.InventoryMenu, Constants.Direction.Down) },
                { Keys.A, new MoveSelectorCommand(gameStateCast.InventoryMenu, Constants.Direction.Left) },
                { Keys.I, new MoveSelectorCommand(gameStateCast.InventoryMenu, Constants.Direction.Up) },
                { Keys.L, new MoveSelectorCommand(gameStateCast.InventoryMenu, Constants.Direction.Right) },
                { Keys.K, new MoveSelectorCommand(gameStateCast.InventoryMenu, Constants.Direction.Down) },
                { Keys.J, new MoveSelectorCommand(gameStateCast.InventoryMenu, Constants.Direction.Left) }
            });
        }
示例#3
0
        private Dictionary <Buttons, ICommand> GetGamepadMappings(IGameState gameState)
        {
            ItemSelectionGameState gameStateCast = (ItemSelectionGameState)gameState;
            ICommand resumeGameCommand           = new ResumeGameCommand(gameState);

            return(new Dictionary <Buttons, ICommand>
            {
                { Buttons.B, resumeGameCommand },
                { Buttons.X, resumeGameCommand },
                { Buttons.LeftThumbstickUp, new MoveSelectorCommand(gameStateCast.InventoryMenu, Constants.Direction.Up) },
                { Buttons.LeftThumbstickRight, new MoveSelectorCommand(gameStateCast.InventoryMenu, Constants.Direction.Right) },
                { Buttons.LeftThumbstickDown, new MoveSelectorCommand(gameStateCast.InventoryMenu, Constants.Direction.Down) },
                { Buttons.LeftThumbstickLeft, new MoveSelectorCommand(gameStateCast.InventoryMenu, Constants.Direction.Left) },
                { Buttons.DPadUp, new MoveSelectorCommand(gameStateCast.InventoryMenu, Constants.Direction.Up) },
                { Buttons.DPadRight, new MoveSelectorCommand(gameStateCast.InventoryMenu, Constants.Direction.Right) },
                { Buttons.DPadDown, new MoveSelectorCommand(gameStateCast.InventoryMenu, Constants.Direction.Down) },
                { Buttons.DPadLeft, new MoveSelectorCommand(gameStateCast.InventoryMenu, Constants.Direction.Left) }
            });
        }