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 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 CGameAgentManager;
34 class CControllerManager;
35 class CGameSettings;
36 
38 {
39 public:
40  CGameServices(CControllerManager& controllerManager,
41  RETRO::CGUIGameRenderManager& renderManager,
42  PERIPHERALS::CPeripherals& peripheralManager,
43  const CProfileManager& profileManager,
44  CInputManager& inputManager);
45  ~CGameServices();
46 
47  ControllerPtr GetController(const std::string& controllerId);
48  ControllerPtr GetDefaultController();
49  ControllerPtr GetDefaultKeyboard();
50  ControllerPtr GetDefaultMouse();
51  ControllerVector GetControllers();
52 
53  std::string GetSavestatesFolder() const;
54 
55  CGameSettings& GameSettings() { return *m_gameSettings; }
56 
57  RETRO::CGUIGameRenderManager& GameRenderManager() { return m_gameRenderManager; }
58 
59  CGameAgentManager& GameAgentManager() { return *m_gameAgentManager; }
60 
61 private:
62  // Construction parameters
63  CControllerManager& m_controllerManager;
64  RETRO::CGUIGameRenderManager& m_gameRenderManager;
65  const CProfileManager& m_profileManager;
66 
67  // Game services
68  std::unique_ptr<CGameSettings> m_gameSettings;
69  std::unique_ptr<CGameAgentManager> m_gameAgentManager;
70 };
71 } // namespace GAME
72 } // namespace KODI
Main input processing class.
Definition: InputManager.h:63
Definition: RetroPlayerInput.h:15
Definition: GameSettings.h:24
Definition: GameSettings.h:16
Definition: GameServices.h:37
Class to manage game-playing agents for a running game client.
Definition: GameAgentManager.h:53
Definition: ControllerManager.h:22
Controller configuration window.
Definition: AudioDecoder.h:18
Definition: ProfileManager.h:25
Class to safely route commands between the GUI and RetroPlayer.
Definition: GUIGameRenderManager.h:69
Definition: Peripherals.h:49