feat: IConfiguration for system and other configurations
This commit is contained in:
23
Engine.Core/Config/IConfiguration.cs
Normal file
23
Engine.Core/Config/IConfiguration.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user