Bomberman
Public Types | Public Member Functions | Private Attributes | List of all members
RAY::Controller::GamePad Class Reference

Entity representing a gamepad controller. More...

#include <Gamepad.hpp>

Collaboration diagram for RAY::Controller::GamePad:

Public Types

typedef ::GamepadButton Button
 
typedef ::GamepadAxis Axis
 

Public Member Functions

 GamePad (int id)
 A default constructor. More...
 
 ~GamePad ()=default
 A default destructor. More...
 
 GamePad (const GamePad &)=default
 A default copy constructor. More...
 
GamePadoperator= (const GamePad &)=default
 An entity is assignable. More...
 
bool isPressed (Button)
 Returns true if Button is pressed on the gamepad. More...
 
bool isDown (Button)
 Returns true if Button is down on the gamepad. More...
 
bool isReleased (Button)
 Returns true if Button is released on the gamepad. More...
 
float getAxisValue (int index)
 Get the value of an axis. More...
 
bool isUp (Button)
 Returns true if Button is up on the gamepad. More...
 
bool isAvailable ()
 Returns true if controller is available. More...
 
void setID (int id)
 Sets gamepad's id. More...
 

Private Attributes

int _id
 The id of the controller, used to fetch buttons' states. More...
 

Detailed Description

Entity representing a gamepad controller.

Member Typedef Documentation

◆ Axis

typedef ::GamepadAxis RAY::Controller::GamePad::Axis

◆ Button

typedef ::GamepadButton RAY::Controller::GamePad::Button

Constructor & Destructor Documentation

◆ GamePad() [1/2]

RAY::Controller::GamePad::GamePad ( int  id)

A default constructor.

Parameters
Theid of the controller

◆ ~GamePad()

RAY::Controller::GamePad::~GamePad ( )
default

A default destructor.

◆ GamePad() [2/2]

RAY::Controller::GamePad::GamePad ( const GamePad )
default

A default copy constructor.

Member Function Documentation

◆ getAxisValue()

float RAY::Controller::GamePad::getAxisValue ( int  index)

Get the value of an axis.

◆ isAvailable()

bool RAY::Controller::GamePad::isAvailable ( )

Returns true if controller is available.

◆ isDown()

bool RAY::Controller::GamePad::isDown ( Button  button)

Returns true if Button is down on the gamepad.

Parameters
ButtonThe keycode of the button

◆ isPressed()

bool RAY::Controller::GamePad::isPressed ( Button  button)

Returns true if Button is pressed on the gamepad.

Parameters
ButtonThe keycode of the button

◆ isReleased()

bool RAY::Controller::GamePad::isReleased ( Button  button)

Returns true if Button is released on the gamepad.

Parameters
ButtonThe keycode of the button

◆ isUp()

bool RAY::Controller::GamePad::isUp ( Button  button)

Returns true if Button is up on the gamepad.

Parameters
ButtonThe keycode of the button

◆ operator=()

GamePad& RAY::Controller::GamePad::operator= ( const GamePad )
default

An entity is assignable.

Returns
A reference to the assigned object

◆ setID()

void RAY::Controller::GamePad::setID ( int  id)

Sets gamepad's id.

Member Data Documentation

◆ _id

int RAY::Controller::GamePad::_id
private

The id of the controller, used to fetch buttons' states.


The documentation for this class was generated from the following files: