1
0
mirror of https://github.com/ncblakely/GiantsTools synced 2024-11-05 14:55:38 +01:00
GiantsTools/Sdk/Include/Core/Public/ConfigEvents.h

45 lines
716 B
C
Raw Normal View History

2020-09-22 07:30:26 +02:00
#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;
};