ASAPCabinetFE
 
Loading...
Searching...
No Matches
dependency_factory.h
Go to the documentation of this file.
1
14#ifndef DEPENDENCY_FACTORY_H
15#define DEPENDENCY_FACTORY_H // Header guard to prevent multiple inclusions
16
17#include <memory>
18#include <string> // For std::string in file paths and settings
19#include "iwindow_manager.h" // Interface for window management
20#include "ui/imgui_manager.h" // GUI manager for ImGui rendering
21#include "render/iasset_manager.h" // Interface for asset management
22#include "tables/table_data.h" // Table data structure for asset loading
23#include "render/irenderer.h" // Renderer for playfield, backglass, and DMD
24#include "keybinds/iinput_manager.h" // Input manager for keybind handling
25#include "config/iconfig_service.h" // Interface for configuration service
26#include "config/ui/config_ui.h" // Configuration UI for user settings
27#include "capture/iscreenshot_manager.h" // Interface for screenshot management
28#include "sound/isound_manager.h" // Interface for sound management
30#include "launcher/itable_launcher.h" // Interface for launching tables
31
40class App;
41
54public:
55 static std::unique_ptr<IKeybindProvider> createKeybindProvider();
67 static std::unique_ptr<IWindowManager> createWindowManager(const Settings& settings);
68
81 static std::unique_ptr<ImGuiManager> createImGuiManager(IWindowManager* windowManager, IConfigService* configService);
82
99 static std::unique_ptr<IAssetManager> createAssetManager(IWindowManager* windowManager, TTF_Font* font,
100 IConfigService* configService, size_t index,
101 const std::vector<TableData>& tables,
102 ISoundManager* soundManager);
103
114 static std::unique_ptr<IRenderer> createRenderer(IWindowManager* windowManager);
115
126 static std::unique_ptr<ISoundManager> createSoundManager(const Settings& settings);
127
138 static std::unique_ptr<IConfigService> createConfigService(const std::string& configPath, IKeybindProvider* keybindProvider);
152 static std::unique_ptr<IScreenshotManager> createScreenshotManager(const std::string& exeDir, IConfigService* configService,
153 IKeybindProvider* keybindProvider, ISoundManager* soundManager);
154
161 static std::unique_ptr<IInputManager> createInputManager(IKeybindProvider* keybindProvider);
162
179 static std::unique_ptr<ConfigUI> createConfigUI(IConfigService* configService, IKeybindProvider* keybindProvider,
180 IAssetManager* assets, size_t* currentIndex, std::vector<TableData>* tables,
181 App* app, bool& showConfig);
182
183 static std::unique_ptr<ITableLauncher> createTableLauncher(IConfigService* configService);
184
193 static std::unique_ptr<ITableCallbacks> createTableCallbacks(IConfigService* configService);
194};
195
196#endif // DEPENDENCY_FACTORY_H
Main application controller for ASAPCabinetFE.
Definition app.h:57
Static factory for creating component instances.
Definition dependency_factory.h:53
static std::unique_ptr< IInputManager > createInputManager(IKeybindProvider *keybindProvider)
Creates an input manager instance.
Definition dependency_factory.cpp:160
static std::unique_ptr< IAssetManager > createAssetManager(IWindowManager *windowManager, TTF_Font *font, IConfigService *configService, size_t index, const std::vector< TableData > &tables, ISoundManager *soundManager)
Creates an asset manager instance.
Definition dependency_factory.cpp:77
static std::unique_ptr< ConfigUI > createConfigUI(IConfigService *configService, IKeybindProvider *keybindProvider, IAssetManager *assets, size_t *currentIndex, std::vector< TableData > *tables, App *app, bool &showConfig)
Creates a configuration UI instance.
Definition dependency_factory.cpp:180
static std::unique_ptr< IWindowManager > createWindowManager(const Settings &settings)
Creates a window manager instance.
Definition dependency_factory.cpp:43
static std::unique_ptr< ImGuiManager > createImGuiManager(IWindowManager *windowManager, IConfigService *configService)
Creates a GUI manager instance.
Definition dependency_factory.cpp:57
static std::unique_ptr< ITableCallbacks > createTableCallbacks(IConfigService *configService)
Creates a table callbacks instance.
Definition dependency_factory.cpp:190
static std::unique_ptr< IConfigService > createConfigService(const std::string &configPath, IKeybindProvider *keybindProvider)
Creates a configuration service instance.
Definition dependency_factory.cpp:131
static std::unique_ptr< IRenderer > createRenderer(IWindowManager *windowManager)
Creates a renderer instance.
Definition dependency_factory.cpp:101
static std::unique_ptr< ISoundManager > createSoundManager(const Settings &settings)
Creates a sound manager instance.
Definition dependency_factory.cpp:117
static std::unique_ptr< IScreenshotManager > createScreenshotManager(const std::string &exeDir, IConfigService *configService, IKeybindProvider *keybindProvider, ISoundManager *soundManager)
Creates a screenshot manager instance.
Definition dependency_factory.cpp:147
The IAssetManager interface provides methods to manage and access various assets used in the applicat...
Definition iasset_manager.h:36
Interface for configuration services (forward declaration).
Definition iconfig_service.h:30
Interface for keybind providers (forward declaration).
Definition ikeybind_provider.h:30
Interface for managing sound operations.
Definition isound_manager.h:14
Interface for managing SDL windows and renderers.
Definition iwindow_manager.h:27
Defines the ConfigUI class for managing the ImGui-based configuration UI in ASAPCabinetFE.
Defines the IAssetManager interface for managing assets in ASAPCabinetFE.
Defines the IConfigService interface for managing configuration in ASAPCabinetFE.
Defines the IInputManager interface for handling input events in ASAPCabinetFE.
Defines the IKeybindProvider interface for managing input bindings in ASAPCabinetFE.
Defines the IScreenshotManager interface for screenshot capture operations in ASAPCabinetFE.
Defines the ITableLauncher interface for launching VPX tables.
Defines the IWindowManager interface for managing SDL windows and renderers in ASAPCabinetFE.
Definition settings.h:12
Defines the TableData struct for storing VPX table metadata and media paths.