Initial public release of rem-essentials
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
#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_;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user