GFramework/GFramework.Game/setting/events/SettingsAllLoadedEvent.cs
GeWuYou 9ae0f63324 feat(setting): 添加设置事件系统和改进设置模型接口
- 新增 SettingsAllLoadedEvent 事件类,用于表示所有设置加载完成
- 新增 SettingsAppliedEvent 事件类,用于表示设置应用完成状态
- 新增 SettingsApplyingEvent 事件类,用于表示设置正在应用过程
- 新增 SettingsBatchChangedEvent 事件类,用于表示批量设置变更
- 新增 SettingsBatchSavedEvent 事件类,用于表示批量设置保存
- 新增 SettingsChangedEvent 通用设置变更事件类
- 新增 SettingsLoadedEvent 和 SettingsSavedEvent 事件类
- 在 SettingsModel 中添加对 GFramework.Core.extensions 的引用
- 更新 RegisterApplicator 方法支持链式调用并改进注释说明
- 新增 ISettingsChangedEvent 接口定义设置变更事件基础结构
- 修改 ISettingsModel 接口使 RegisterApplicator 方法支持链式调用
- 修改 ISettingsPersistence 接口继承 IContextUtility 接口
2026-01-17 13:16:50 +08:00

30 lines
959 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using GFramework.Game.Abstractions.setting;
namespace GFramework.Game.setting.events;
/// <summary>
/// 表示所有设置已加载完成的事件
/// </summary>
/// <param name="all">包含所有设置节的可枚举集合</param>
public class SettingsAllLoadedEvent(IEnumerable<ISettingsSection> all) : ISettingsChangedEvent
{
/// <summary>
/// 获取所有设置节的只读集合
/// </summary>
public IReadOnlyCollection<ISettingsSection> AllSettings { get; } = all.ToList();
/// <summary>
/// 获取设置类型,始终返回 ISettingsSection 类型
/// </summary>
public Type SettingsType => typeof(ISettingsSection);
/// <summary>
/// 获取具体的设置节,此事件中始终为 null
/// </summary>
public ISettingsSection Settings => null!;
/// <summary>
/// 获取事件发生的时间UTC时间
/// </summary>
public DateTime ChangedAt { get; } = DateTime.UtcNow;
}