Files
rem-essentials-pub/include/rem/feature_manager.h
T

44 lines
821 B
C++

#pragma once
#include <windows.h>
#include <string>
#include <vector>
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<Feature> features_;
};
}