ECSTASY
All in the name
Loading...
Searching...
No Matches
Gamepads.hpp
Go to the documentation of this file.
1
11
12#ifndef ECSTASY_INTEGRATIONS_EVENT_INPUTS_GAMEPADS_HPP_
13#define ECSTASY_INTEGRATIONS_EVENT_INPUTS_GAMEPADS_HPP_
14
15#include "Gamepad.hpp"
17
19{
27 public:
29 static const size_t GamepadCount = 4;
30
37 Gamepads() noexcept
38 {
39 for (size_t i = 0; i < GamepadCount; i++)
40 _gamepads[i] = Gamepad(i);
41 }
42
49 ~Gamepads() noexcept = default;
50
65 [[nodiscard]] Gamepad &get(std::size_t i)
66 {
67 return _gamepads[i];
68 }
69
84 [[nodiscard]] const Gamepad &get(std::size_t i) const
85 {
86 return _gamepads[i];
87 }
88
89 private:
92 };
93} // namespace ecstasy::integration::event
94
95#endif /* !ECSTASY_INTEGRATIONS_EVENT_INPUTS_GAMEPADS_HPP_ */
Base class of all registry resources.
Base class of all registry resources.
Definition IResource.hpp:33
Current Gamepads states.
Definition Gamepads.hpp:26
Gamepad & get(std::size_t i)
Fetch a gamepad.
Definition Gamepads.hpp:65
const Gamepad & get(std::size_t i) const
Fetch a gamepad.
Definition Gamepads.hpp:84
static const size_t GamepadCount
Number of supported gamepads.
Definition Gamepads.hpp:29
~Gamepads() noexcept=default
Default destructor.
std::array< Gamepad, GamepadCount > _gamepads
Array of gamepads.
Definition Gamepads.hpp:91
Gamepads() noexcept
Construct a new Gamepads Resource.
Definition Gamepads.hpp:37
Event integration.
Definition Event.hpp:25