Skip to content

Class Engine::InputManager

ClassList > Engine > InputManager

Central input management resource storing and updating player controllers. More...

  • #include <InputManager.hpp>

Public Functions

Type Name
void AddPlayer (int playerId, std::unique_ptr< IController > controller)
Associates a player ID with a specific controller device.
IController * GetController (int playerId)
Retrieves the controller assigned to a given player ID.
InputManager ()
void Update ()
Updates all registered controllers for the current frame.
~InputManager ()

Detailed Description

Registered as a global resource in the ECS Registry. Polled during Application::PreUpdate to refresh all registered player controllers.

Public Functions Documentation

function AddPlayer

Associates a player ID with a specific controller device.

void Engine::InputManager::AddPlayer (
    int playerId,
    std::unique_ptr< IController > controller
) 

Parameters:

  • playerId Identifier for the player (e.g. 1, 2).
  • controller Unique pointer to an IController instance.

function GetController

Retrieves the controller assigned to a given player ID.

IController * Engine::InputManager::GetController (
    int playerId
) 

Parameters:

  • playerId Identifier for the player.

Returns:

Pointer to IController if found, nullptr otherwise.


function InputManager

Engine::InputManager::InputManager () 

function Update

Updates all registered controllers for the current frame.

void Engine::InputManager::Update () 


function ~InputManager

Engine::InputManager::~InputManager () 


The documentation for this class was generated from the following file /home/runner/work/r-type/r-type/Engine/include/Inputs/InputManager.hpp