Bomberman
Public Member Functions | Public Attributes | Private Attributes | List of all members
BBM::GamepadComponent Class Reference

#include <GamepadComponent.hpp>

Inheritance diagram for BBM::GamepadComponent:
Collaboration diagram for BBM::GamepadComponent:

Public Member Functions

WAL::Componentclone (WAL::Entity &entity) const override
 Clone a component for another or the same entity. More...
 
void onStart () override
 The entity or this component has just been enabled. More...
 
 GamepadComponent (WAL::Entity &entity)
 Create a new gampad component using default keys. More...
 
 GamepadComponent (WAL::Entity &entity, int id)
 Create a new PositionComponent at a certain position. More...
 
 GamepadComponent (const GamepadComponent &)=default
 A Gamepad component is copy constructable. More...
 
 ~GamepadComponent () override=default
 default destructor More...
 
GamepadComponentoperator= (const GamepadComponent &)=delete
 A Gamepad component can't be assigned. More...
 
GamepadComponentsetID (int ID)
 Set the ID of the Gamepad the events must be fetch from;. More...
 
int getID () const
 Get the ID of the Gamepad the events must be fetch from;. More...
 
- Public Member Functions inherited from WAL::Component
Componentoperator= (const Component &)=delete
 A component can't be assigned. More...
 
virtual ~Component ()=default
 A virtual destructor. More...
 
virtual void onStop ()
 The entity or this component has just been disable. More...
 

Public Attributes

Button keySecondary = GAMEPAD_BUTTON_RIGHT_FACE_RIGHT
 jump key More...
 
Button keyBomb = GAMEPAD_BUTTON_RIGHT_FACE_DOWN
 bomb key More...
 
Button keyPause = GAMEPAD_BUTTON_MIDDLE
 pause key More...
 
Button keyRight = GAMEPAD_BUTTON_LEFT_FACE_RIGHT
 move right key More...
 
Button keyLeft = GAMEPAD_BUTTON_LEFT_FACE_LEFT
 move left key More...
 
Button keyUp = GAMEPAD_BUTTON_LEFT_FACE_UP
 move up key More...
 
Button keyDown = GAMEPAD_BUTTON_LEFT_FACE_DOWN
 move down key More...
 
Axis LeftStickX = GAMEPAD_AXIS_LEFT_X
 
Axis LeftStickY = GAMEPAD_AXIS_LEFT_Y
 
Axis RightStickX = GAMEPAD_AXIS_RIGHT_X
 
Axis RightStickY = GAMEPAD_AXIS_RIGHT_Y
 

Private Attributes

int _ID
 Identifier of the gamepad, used to fetch events. More...
 

Additional Inherited Members

- Protected Member Functions inherited from WAL::Component
 Component (Entity &entity)
 A component can't be instantiated, it should be derived. More...
 
 Component (const Component &)=default
 A component can't be instantiated, it should be derived. More...
 
- Protected Attributes inherited from WAL::Component
Entity_entity
 The entity that own this component. More...
 

Constructor & Destructor Documentation

◆ GamepadComponent() [1/3]

BBM::GamepadComponent::GamepadComponent ( WAL::Entity entity)
explicit

Create a new gampad component using default keys.

◆ GamepadComponent() [2/3]

BBM::GamepadComponent::GamepadComponent ( WAL::Entity entity,
int  id 
)

Create a new PositionComponent at a certain position.

◆ GamepadComponent() [3/3]

BBM::GamepadComponent::GamepadComponent ( const GamepadComponent )
default

A Gamepad component is copy constructable.

◆ ~GamepadComponent()

BBM::GamepadComponent::~GamepadComponent ( )
overridedefault

default destructor

Member Function Documentation

◆ clone()

WAL::Component * BBM::GamepadComponent::clone ( WAL::Entity entity) const
overridevirtual

Clone a component for another or the same entity.

Parameters
entityThe entity that owns the ne component.

Implements WAL::Component.

◆ getID()

int BBM::GamepadComponent::getID ( ) const

Get the ID of the Gamepad the events must be fetch from;.

◆ onStart()

void BBM::GamepadComponent::onStart ( )
overridevirtual

The entity or this component has just been enabled.

Reimplemented from WAL::Component.

◆ operator=()

GamepadComponent& BBM::GamepadComponent::operator= ( const GamepadComponent )
delete

A Gamepad component can't be assigned.

◆ setID()

GamepadComponent & BBM::GamepadComponent::setID ( int  ID)

Set the ID of the Gamepad the events must be fetch from;.

Member Data Documentation

◆ _ID

int BBM::GamepadComponent::_ID
private

Identifier of the gamepad, used to fetch events.

◆ keyBomb

Button BBM::GamepadComponent::keyBomb = GAMEPAD_BUTTON_RIGHT_FACE_DOWN

bomb key

◆ keyDown

Button BBM::GamepadComponent::keyDown = GAMEPAD_BUTTON_LEFT_FACE_DOWN

move down key

◆ keyLeft

Button BBM::GamepadComponent::keyLeft = GAMEPAD_BUTTON_LEFT_FACE_LEFT

move left key

◆ keyPause

Button BBM::GamepadComponent::keyPause = GAMEPAD_BUTTON_MIDDLE

pause key

◆ keyRight

Button BBM::GamepadComponent::keyRight = GAMEPAD_BUTTON_LEFT_FACE_RIGHT

move right key

◆ keySecondary

Button BBM::GamepadComponent::keySecondary = GAMEPAD_BUTTON_RIGHT_FACE_RIGHT

jump key

◆ keyUp

Button BBM::GamepadComponent::keyUp = GAMEPAD_BUTTON_LEFT_FACE_UP

move up key

◆ LeftStickX

Axis BBM::GamepadComponent::LeftStickX = GAMEPAD_AXIS_LEFT_X

◆ LeftStickY

Axis BBM::GamepadComponent::LeftStickY = GAMEPAD_AXIS_LEFT_Y

◆ RightStickX

Axis BBM::GamepadComponent::RightStickX = GAMEPAD_AXIS_RIGHT_X

◆ RightStickY

Axis BBM::GamepadComponent::RightStickY = GAMEPAD_AXIS_RIGHT_Y

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