kodi
AgentController.h
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 
34 {
35 public:
36  CAgentController(PERIPHERALS::PeripheralPtr peripheral);
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
Class to represent the controller of a game player (a.k.a. agent)
Definition: AgentController.h:33
Definition: AudioDecoder.h:18
std::shared_ptr< CController > ControllerPtr
Smart pointer to a game controller (CController)
Definition: ControllerTypes.h:25
DateTime class, which uses FileTime as it&#39;s base.
Definition: XBDateTime.h:63