kodi
GameServices.h
1 /*
2  * Copyright (C) 2017-2018 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 
9 #pragma once
10 
11 #include "controllers/ControllerTypes.h"
12 
13 #include <memory>
14 #include <string>
15 
16 class CInputManager;
17 class CProfileManager;
18 
19 namespace PERIPHERALS
20 {
21 class CPeripherals;
22 }
23 
24 namespace KODI
25 {
26 namespace RETRO
27 {
28 class CGUIGameRenderManager;
29 }
30 
31 namespace GAME
32 {
33 class CAgentInput;
34 class CControllerManager;
35 class CGameSettings;
36 
41 {
42 public:
43  CGameServices(CControllerManager& controllerManager,
44  RETRO::CGUIGameRenderManager& renderManager,
45  PERIPHERALS::CPeripherals& peripheralManager,
46  const CProfileManager& profileManager,
47  CInputManager& inputManager);
48  ~CGameServices();
49 
50  ControllerPtr GetController(const std::string& controllerId);
51  ControllerPtr GetDefaultController();
52  ControllerPtr GetDefaultKeyboard();
53  ControllerPtr GetDefaultMouse();
54  ControllerVector GetControllers();
55 
65  std::string TranslateFeature(const std::string& controllerId, const std::string& featureName);
66 
67  std::string GetSavestatesFolder() const;
68 
69  CGameSettings& GameSettings() { return *m_gameSettings; }
70 
71  RETRO::CGUIGameRenderManager& GameRenderManager() { return m_gameRenderManager; }
72 
73  CAgentInput& AgentInput() { return *m_agentInput; }
74 
75 private:
76  // Construction parameters
77  CControllerManager& m_controllerManager;
78  RETRO::CGUIGameRenderManager& m_gameRenderManager;
79  const CProfileManager& m_profileManager;
80 
81  // Game services
82  std::unique_ptr<CGameSettings> m_gameSettings;
83  std::unique_ptr<CAgentInput> m_agentInput;
84 };
85 } // namespace GAME
86 } // namespace KODI
Class to manage game-playing agents for a running game client.
Definition: AgentInput.h:65
Main input processing class.
Definition: InputManager.h:68
Definition: RetroPlayerInput.h:15
Definition: GameSettings.h:27
Definition: GameSettings.h:16
Definition: GameServices.h:40
Definition: ControllerManager.h:31
Definition: AudioDecoder.h:18
std::shared_ptr< CController > ControllerPtr
Smart pointer to a game controller (CController)
Definition: ControllerTypes.h:25
Definition: ProfileManager.h:25
Class to safely route commands between the GUI and RetroPlayer.
Definition: GUIGameRenderManager.h:69
Definition: Peripherals.h:56
std::vector< ControllerPtr > ControllerVector
Vector of smart pointers to a game controller (CController)
Definition: ControllerTypes.h:32