Exemple #1
0
        /// <summary>
        /// Manually invokes this bind, raising the Pressed event and invoking the Action associated with it if Handled was false.
        /// </summary>
        internal void Invoke(BindState State)
        {
            this._State = State;
            var EventArgs = new BindPressEventArgs()
            {
                Action  = this._Action,
                Handled = false,
                Player  = InputManager.Player
            };

            if (State == BindState.Pressed)
            {
                if (this.Pressed != null)
                {
                    this.Pressed(this, EventArgs);
                }
            }
            else if (State == BindState.Released)
            {
                if (this.Released != null)
                {
                    this.Released(this, EventArgs);
                }
            }
            if (!EventArgs.Handled)
            {
                this.Action(State);
            }
        }
Exemple #2
0
 /// <summary>
 /// Manually invokes this bind, raising the Pressed event and invoking the Action associated with it if Handled was false.
 /// </summary>
 internal void Invoke(BindState State)
 {
     this._State = State;
     var EventArgs = new BindPressEventArgs() {
         Action = this._Action,
         Handled = false,
         Player = InputManager.Player
     };
     if(State == BindState.Pressed) {
         if(this.Pressed != null)
             this.Pressed(this, EventArgs);
     } else if(State == BindState.Released) {
         if(this.Released != null)
             this.Released(this, EventArgs);
     }
     if(!EventArgs.Handled)
         this.Action(State);
 }