xbmc
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 ADDON
20 {
21 class CAddonMgr;
22 } // namespace ADDON
23 
24 namespace PERIPHERALS
25 {
26 class CPeripherals;
27 }
28 
29 namespace KODI
30 {
31 namespace RETRO
32 {
33 class CGUIGameRenderManager;
34 }
35 
36 namespace SHADER
37 {
38 class CShaderPresetFactory;
39 }
40 
41 namespace GAME
42 {
43 class CGameAgentManager;
44 class CControllerManager;
45 class CGameSettings;
46 
51 {
52 public:
53  CGameServices(CControllerManager& controllerManager,
54  RETRO::CGUIGameRenderManager& renderManager,
55  PERIPHERALS::CPeripherals& peripheralManager,
56  const CProfileManager& profileManager,
57  CInputManager& inputManager,
58  ADDON::CAddonMgr& addons);
59  ~CGameServices();
60 
61  ControllerPtr GetController(const std::string& controllerId);
62  ControllerPtr GetDefaultController();
63  ControllerPtr GetDefaultKeyboard();
64  ControllerPtr GetDefaultMouse();
65  ControllerVector GetControllers();
66 
76  std::string TranslateFeature(const std::string& controllerId, const std::string& featureName);
77 
78  std::string GetSavestatesFolder() const;
79 
80  CGameSettings& GameSettings() { return *m_gameSettings; }
81 
82  RETRO::CGUIGameRenderManager& GameRenderManager() { return m_gameRenderManager; }
83 
84  CGameAgentManager& GameAgentManager() { return *m_gameAgentManager; }
85 
86  SHADER::CShaderPresetFactory& VideoShaders() { return *m_videoShaders; }
87 
88 private:
89  // Construction parameters
90  CControllerManager& m_controllerManager;
91  RETRO::CGUIGameRenderManager& m_gameRenderManager;
92  const CProfileManager& m_profileManager;
93 
94  // Game services
95  std::unique_ptr<CGameSettings> m_gameSettings;
96  std::unique_ptr<CGameAgentManager> m_gameAgentManager;
97  std::unique_ptr<SHADER::CShaderPresetFactory> m_videoShaders;
98 };
99 } // namespace GAME
100 } // namespace KODI
Class - CAddonMgr Holds references to all addons, enabled or otherwise.
Definition: AddonManager.h:79
Main input processing class.
Definition: InputManager.h:63
Definition: RetroPlayerInput.h:15
Definition: GameSettings.h:27
Definition: GameSettings.h:16
Definition: GameServices.h:50
Class to manage game-playing agents for a running game client.
Definition: GameAgentManager.h:55
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
Definition: ShaderPresetFactory.h:31
Class to safely route commands between the GUI and RetroPlayer.
Definition: GUIGameRenderManager.h:69
Definition: Addon.cpp:39
Definition: Peripherals.h:53
std::vector< ControllerPtr > ControllerVector
Vector of smart pointers to a game controller (CController)
Definition: ControllerTypes.h:32