summaryrefslogtreecommitdiff
path: root/source/game/input/InputManager.cs
blob: 1bd3e38eba6728e3a7cd25603796aff3f3f571ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using Microsoft.Xna.Framework;

namespace Celesteia.Game.Input {
    public class InputManager : GameComponent {
        private new GameInstance Game => (GameInstance) base.Game;
        public InputManager(GameInstance Game) : base(Game) {}

        public override void Initialize()
        {
            base.Initialize();
        }

        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
        }

        public override void Update(GameTime gameTime)
        {
            if (!Enabled) return;

            KeyboardHelper.Update();
            GamepadHelper.Update();
            MouseHelper.Update();

            base.Update(gameTime);
        }

        public bool GetAny() {
            return KeyboardHelper.AnyKey() || GamepadHelper.AnyButton();
        }
    }
}