mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-21 05:45:10 +00:00
sources and include in the same folder
This commit is contained in:
44
lib/Ray/sources/Controllers/Gamepad.cpp
Normal file
44
lib/Ray/sources/Controllers/Gamepad.cpp
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
** EPITECH PROJECT, 2021
|
||||
** Bomberman
|
||||
** File description:
|
||||
** Gamepad
|
||||
*/
|
||||
|
||||
#include "Controllers/Gamepad.hpp"
|
||||
|
||||
RAY::Controller::GamePad::GamePad(int id):
|
||||
_id(id)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool RAY::Controller::GamePad::isPressed(RAY::Controller::GamePad::Button button)
|
||||
{
|
||||
return IsGamepadButtonPressed(this->_id, button);
|
||||
}
|
||||
|
||||
bool RAY::Controller::GamePad::isDown(RAY::Controller::GamePad::Button button)
|
||||
{
|
||||
return IsGamepadButtonDown(this->_id, button);
|
||||
}
|
||||
|
||||
bool RAY::Controller::GamePad::isReleased(RAY::Controller::GamePad::Button button)
|
||||
{
|
||||
return IsGamepadButtonReleased(this->_id, button);
|
||||
}
|
||||
|
||||
bool RAY::Controller::GamePad::isUp(RAY::Controller::GamePad::Button button)
|
||||
{
|
||||
return IsGamepadButtonUp(this->_id, button);
|
||||
}
|
||||
|
||||
bool RAY::Controller::GamePad::isAvailable()
|
||||
{
|
||||
return IsGamepadAvailable(this->_id);
|
||||
}
|
||||
|
||||
void RAY::Controller::GamePad::setID(int id)
|
||||
{
|
||||
this->_id = id;
|
||||
}
|
||||
Reference in New Issue
Block a user