Ejemplo n.º 1
0
        private void TellIfWantsToConnect(InputListener listener)
        {
            foreach (var button in MappedGamePadButtons)
            {
                if (GamePadButtonsPressedOnce[button])
                {
                    Player.InputType = InputType.Gamepad;
                    listener.PlayerGamePadConnectionRequested(Player, button);
                    return;
                }
            }


            if (Inputs.PlayersController.MouseInUse)
                return;

            foreach (var button in MappedMouseButtons)
            {
                if (MouseButtonsPressedOnce[button])
                {
                    Player.InputType = InputType.Mouse;
                    listener.PlayerMouseConnectionRequested(Player, button);
                    return;
                }
            }


            foreach (var key in MappedKeys)
            {
                if (KeysPressedOnce[key])
                {
                    Player.InputType = InputType.Mouse;
                    listener.PlayerKeyboardConnectionRequested(Player, key);
                    return;
                }
            }
        }