mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-20 21:35:12 +00:00
sources and include in the same folder
This commit is contained in:
64
lib/Ray/sources/Controllers/Gamepad.hpp
Normal file
64
lib/Ray/sources/Controllers/Gamepad.hpp
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
** EPITECH PROJECT, 2021
|
||||
** Bomberman
|
||||
** File description:
|
||||
** Keyboard
|
||||
*/
|
||||
|
||||
#ifndef GAMEPAD_HPP_
|
||||
#define GAMEPAD_HPP_
|
||||
|
||||
#include <raylib.h>
|
||||
#include <vector>
|
||||
|
||||
namespace RAY
|
||||
::Controller {
|
||||
|
||||
//! @brief Entity representing a gamepad controller
|
||||
class GamePad {
|
||||
public:
|
||||
typedef ::GamepadButton Button;
|
||||
|
||||
//! @brief A default constructor
|
||||
//! @param The id of the controller
|
||||
GamePad(int id);
|
||||
|
||||
//! @brief A default destructor
|
||||
~GamePad() = default;
|
||||
|
||||
//! @brief A default copy constructor
|
||||
GamePad(const GamePad &) = default;
|
||||
|
||||
//! @brief An entity is assignable
|
||||
//! @return A reference to the assigned object
|
||||
GamePad &operator=(const GamePad &) = default;
|
||||
|
||||
//! @brief Returns true if Button is pressed on the gamepad
|
||||
//! @param Button The keycode of the button
|
||||
bool isPressed(Button);
|
||||
|
||||
//! @brief Returns true if Button is down on the gamepad
|
||||
//! @param Button The keycode of the button
|
||||
bool isDown(Button);
|
||||
|
||||
//! @brief Returns true if Button is released on the gamepad
|
||||
//! @param Button The keycode of the button
|
||||
bool isReleased(Button);
|
||||
|
||||
//! @brief Returns true if Button is up on the gamepad
|
||||
//! @param Button The keycode of the button
|
||||
bool isUp(Button);
|
||||
|
||||
//! @brief Returns true if controller is available
|
||||
bool isAvailable();
|
||||
|
||||
//! @brief Sets gamepad's id
|
||||
void setID(int id);
|
||||
|
||||
private:
|
||||
//! @brief The id of the controller, used to fetch buttons' states
|
||||
int _id;
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* !KEYBOARD_HPP_ */
|
||||
Reference in New Issue
Block a user