private void enqueueCommands(ControllerInputBinding binding, ControllerState currentControllerState, Microsoft.Xna.Framework.Vector2 inputValue) { foreach (Command command in binding.commands) { if (command is CursorMoveCommand) { CursorMoveCommand cmCommand = command as CursorMoveCommand; cmCommand.inputCommandValue = inputValue; cursorMoveCommands.Enqueue(cmCommand); } else { enqueueCommands(binding, currentControllerState); } } }
internal static ControllerInputBinding createStickCursorMoveBinding(ControllerStick stick, Microsoft.Xna.Framework.Vector2 comparisonVector, StickState comparisonState, StickState oldState, MouseMoveType moveType, Types.UIntVector moveScale, CommandTarget commandTarget, InputMode applicableMode) { ControllerInputBinding newBinding = new ControllerInputBinding(); newBinding.stick = new ControllerStickBinding(stick, comparisonVector, comparisonState, oldState); CursorMoveCommand newCommand = new CursorMoveCommand(); newCommand.mouseMove = new MouseMove(); newCommand.mouseMove.commandTarget = commandTarget; newCommand.mouseMove.moveType = moveType; newCommand.mouseMove.moveScale = moveScale; newCommand.applicableMode = applicableMode; newBinding.commands.Add(newCommand); //bindings.Add(newBinding); return(newBinding); }