From 88c386d74d7d94ec16d4d84ed674eb51e31647ac Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sun, 9 Jun 2024 12:18:17 +0200 Subject: Refactoring of game features for better management. (#2043) --- src/gamefeaturesproxy.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/gamefeaturesproxy.h (limited to 'src/gamefeaturesproxy.h') diff --git a/src/gamefeaturesproxy.h b/src/gamefeaturesproxy.h new file mode 100644 index 00000000..9ffd6b04 --- /dev/null +++ b/src/gamefeaturesproxy.h @@ -0,0 +1,34 @@ +#ifndef GAMEFEATURESPROXY_H +#define GAMEFEATURESPROXY_H + +#include "igamefeatures.h" + +class GameFeatures; +class OrganizerProxy; + +class GameFeaturesProxy : public MOBase::IGameFeatures +{ +public: + GameFeaturesProxy(OrganizerProxy* coreProxy, GameFeatures& gameFeatures); + + bool registerFeature(QStringList const& games, + std::shared_ptr feature, int priority, + bool replace) override; + bool registerFeature(MOBase::IPluginGame* game, + std::shared_ptr feature, int priority, + bool replace) override; + bool registerFeature(std::shared_ptr feature, int priority, + bool replace) override; + bool unregisterFeature(std::shared_ptr feature) override; + +protected: + std::shared_ptr + gameFeatureImpl(std::type_info const& info) const override; + int unregisterFeaturesImpl(std::type_info const& info) override; + +private: + GameFeatures& m_Features; + OrganizerProxy& m_CoreProxy; +}; + +#endif -- cgit v1.3.1