Example #1
0
        /// <summary>
        /// Adds a conditional binding to the input manager.
        /// </summary>
        /// <param name="condition">The condition upon which the action will be invoked.</param>
        /// <param name="action">The action to invoke.</param>
        /// <returns>Returns the conditional binding instance.</returns>
        public ConditionalInputBinding AddConditionalBinding(Func <InputState, bool> condition, Action <InputState> action)
        {
            ConditionalInputBinding binding = new ConditionalInputBinding(condition, action);

            this.inputBindings.Add(binding);
            return(binding);
        }
Example #2
0
        /// <summary>
        /// Adds a binding to the input manager.
        /// </summary>
        /// <param name="action">The action to invoke.</param>
        /// <returns>Returns the conditional binding instance.</returns>
        public ConditionalInputBinding AddBinding(Action <InputState> action)
        {
            ConditionalInputBinding binding = new ConditionalInputBinding((s) => { return(true); }, action);

            this.inputBindings.Add(binding);
            return(binding);
        }