24 lines
753 B
C#
24 lines
753 B
C#
using System.Collections.Generic;
|
|
|
|
namespace Engine.Core.Config;
|
|
|
|
public interface IConfiguration
|
|
{
|
|
static IConfiguration System { get; set; } = new SystemConfiguration();
|
|
static IConfiguration Shared { get; set; } = new BasicConfiguration();
|
|
|
|
Event<IConfiguration, ConfigUpdateArguments> OnAdded { get; }
|
|
Event<IConfiguration, ConfigUpdateArguments> OnSet { get; }
|
|
Event<IConfiguration, ConfigUpdateArguments> OnRemoved { get; }
|
|
|
|
IReadOnlyDictionary<string, object?> Values { get; }
|
|
|
|
bool Has(string key);
|
|
object? Get(string key);
|
|
T? Get<T>(string key, T? defaultValue = default);
|
|
void Set<T>(string key, T value);
|
|
void Remove<T>(string key);
|
|
|
|
readonly record struct ConfigUpdateArguments(string Key);
|
|
}
|