#pragma once #include #include #include namespace rem { class Config; enum class RuntimeSide { Always, Client, Server, }; struct Feature { std::string name; void (*init)(); void (*cleanup)(); RuntimeSide side; bool enabled; bool initialized; }; class FeatureManager { public: void Register(const char* name, void (*init)(), void (*cleanup)(), RuntimeSide side, bool defaultEnabled); bool SetEnabled(const char* name, bool enabled); void ApplyConfig(const Config& config); void InitFeatures(); void CleanupFeatures(); private: bool Applies(const Feature& feature) const; std::vector features_; }; }