Ejemplo n.º 1
0
        // GameState collection handling
        internal KeyboardBindingCollection CreateGameBindigs(GameState gs)
        {
            // Create new bindings collection
            KeyboardBindingCollection collection = new KeyboardBindingCollection();

            _gameBindings[gs] = collection;

            // Return collection
            return(collection);
        }
Ejemplo n.º 2
0
        // Constructor(s)
        internal Keyboard()
        {
            // Create key register
            _isKeyDown  = new bool[(int)Key.KeyCount + 1];
            _oldKeyDown = new bool[(int)Key.KeyCount + 1];

            // Create keybinding containers
            _bindings     = new KeyboardBindingCollection();
            _gameBindings = new Dictionary <GameState, KeyboardBindingCollection>();
        }
 public void Dechain(KeyboardBindingCollection bindings)
 {
     // Dechain bindings
     _keyPressed  -= bindings._keyPressed;
     _keyReleased -= bindings._keyReleased;
 }
 // Chain
 public void Chain(KeyboardBindingCollection bindings)
 {
     // Chain bindings
     _keyPressed  += bindings._keyPressed;
     _keyReleased += bindings._keyReleased;
 }