1
0
mirror of https://github.com/ncblakely/GiantsTools synced 2024-11-23 06:35:37 +01:00
GiantsTools/Sdk/Include/ConfigEvents.h
Nick Blakely 80343ee84b Sync
2020-09-21 22:30:26 -07: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;
};