1
0
mirror of https://github.com/ncblakely/GiantsTools synced 2024-05-31 22:31:46 +02:00
GiantsTools/Sdk/Include/Core/Public/ConfigEvents.h
2021-01-23 15:40:09 -08:00

45 lines
716 B
C++

#pragma once
/// <summary>
/// Event types for <see cref="IConfig">.
/// </summary>
enum class ConfigEventType
{
None = 0,
ConfigLoaded,
ConfigSaving
};
struct ConfigEvent
{
public:
virtual ~ConfigEvent() = default;
ConfigEvent(ConfigEventType type) noexcept { this->type = type; }
private:
ConfigEventType type;
};
struct ConfigLoadedEvent : ConfigEvent
{
ConfigLoadedEvent(struct IConfig& config) noexcept
: ConfigEvent(ConfigEventType::ConfigLoaded),
config(config)
{
}
struct IConfig& config;
};
struct ConfigSavingEvent : ConfigEvent
{
ConfigSavingEvent(struct IConfig& config) noexcept
: ConfigEvent(ConfigEventType::ConfigSaving),
config(config)
{
}
struct IConfig& config;
};