| 1 |
/* |
| 2 |
* Copyright (C) 2017-2024 Team Kodi |
| 3 |
* This file is part of Kodi - https://kodi.tv |
| 4 |
* |
| 5 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
* See LICENSES/README.md for more information. |
| 7 |
*/ |
| 8 |
#pragma once |
| 9 |
|
| 10 |
#include "XBDateTime.h" |
| 11 |
#include "games/controllers/ControllerTypes.h" |
| 12 |
#include "peripherals/PeripheralTypes.h" |
| 13 |
|
| 14 |
#include <memory> |
| 15 |
#include <string> |
| 16 |
|
| 17 |
namespace KODI |
| 18 |
{ |
| 19 |
namespace GAME |
| 20 |
{ |
| 21 |
class CAgentJoystick; |
| 22 |
class CAgentKeyboard; |
| 23 |
class CAgentMouse; |
| 24 |
|
| 25 |
/*! |
| 26 |
* \ingroup games |
| 27 |
* |
| 28 |
* \brief Class to represent the controller of a game player (a.k.a. agent) |
| 29 |
* |
| 30 |
* The term "agent" is used to distinguish game players from the myriad of other |
| 31 |
* uses of the term "player" in Kodi, such as media players and player cores. |
| 32 |
*/ |
| 33 |
class CAgentController |
| 34 |
{ |
| 35 |
public: |
| 36 |
CAgentController(PERIPHERALS::PeripheralPtr peripheral); |
| 37 |
~CAgentController(); |
| 38 |
|
| 39 |
// Lifecycle functions |
| 40 |
void Initialize(); |
| 41 |
void Deinitialize(); |
| 42 |
|
| 43 |
// Input properties |
| 44 |
PERIPHERALS::PeripheralPtr GetPeripheral() const { return m_peripheral; } |
| 45 |
std::string GetPeripheralName() const; |
| 46 |
const std::string& GetPeripheralLocation() const; |
| 47 |
ControllerPtr GetController() const; |
| 48 |
CDateTime LastActive() const; |
| 49 |
float GetActivation() const; |
| 50 |
void ClearButtonState(); |
| 51 |
|
| 52 |
private: |
| 53 |
// Construction parameters |
| 54 |
const PERIPHERALS::PeripheralPtr m_peripheral; |
| 55 |
|
| 56 |
// Input parameters |
| 57 |
std::unique_ptr<CAgentJoystick> m_joystick; |
| 58 |
std::unique_ptr<CAgentKeyboard> m_keyboard; |
| 59 |
std::unique_ptr<CAgentMouse> m_mouse; |
| 60 |
}; |
| 61 |
|
| 62 |
} // namespace GAME |
| 63 |
} // namespace KODI |