コード例 #1
0
        private bool IsButtonPressed(InputButton Button, KeyboardState KS, GamePadState GS)
        {
            switch (Button.Type)
            {
            case InputMethod.Key:
                return(KS.IsKeyDown(Button.Key));

            case InputMethod.Button:
                return(GS.IsButtonDown(Button.Button));

            default:
                throw new ArgumentOutOfRangeException("Button.Type");
            }
        }
コード例 #2
0
 /// <summary>
 /// Registers the given InputButton to cause this Bind to be triggered.
 /// </summary>
 public void RegisterButton(InputButton Button)
 {
     this._Buttons.Add(Button);
 }
コード例 #3
0
ファイル: InputManager.cs プロジェクト: Octanum/Corvus
 private bool IsButtonPressed(InputButton Button, KeyboardState KS, GamePadState GS)
 {
     switch(Button.Type) {
         case InputMethod.Key:
             return KS.IsKeyDown(Button.Key);
         case InputMethod.Button:
             return GS.IsButtonDown(Button.Button);
         default:
             throw new ArgumentOutOfRangeException("Button.Type");
     }
 }
コード例 #4
0
ファイル: Bind.cs プロジェクト: Octanum/Corvus
 /// <summary>
 /// Unregisters the given InputButton from triggering this Bind.
 /// </summary>
 public void UnregisterButton(InputButton Button)
 {
     bool result = this._Buttons.Remove(Button);
     if(!result)
         throw new ArgumentException("Button was not associated with this Bind.");
 }
コード例 #5
0
ファイル: Bind.cs プロジェクト: Octanum/Corvus
 /// <summary>
 /// Registers the given InputButton to cause this Bind to be triggered.
 /// </summary>
 public void RegisterButton(InputButton Button)
 {
     this._Buttons.Add(Button);
 }