GFramework/GFramework.Game/setting/events/SettingsBatchChangedEvent.cs
GeWuYou 0b7c64fd99 feat(data): 添加数据仓库功能并重构设置系统接口
- 新增 DataRepository 类实现数据存储和读取功能
- 添加数据仓库配置选项类 DataRepositoryOptions
- 定义 IData 接口作为通用数据标记接口
- 实现数据加载、保存、删除等异步操作方法
- 添加数据事件系统包括加载、保存、删除等事件类型
- 将 ISettingsData 接口重命名为 IResettable 并更新相关实现
- 更新 SettingsModel 和 SettingsPersistence 使用新的接口
- 修改 SettingsBatchChangedEvent 和 SettingsBatchSavedEvent 使用 IResettable 类型
- 重构 AudioSettings、GraphicsSettings、LocalizationSettings 继承新接口
- 更新 IPersistentApplyAbleSettings 接口依赖为 IResettable
2026-01-28 20:08:34 +08:00

31 lines
1.0 KiB
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="settings">发生变更的设置数据集合</param>
public class SettingsBatchChangedEvent(IEnumerable<IResettable> settings) : ISettingsChangedEvent
{
/// <summary>
/// 获取发生变更的具体设置数据列表
/// </summary>
public IEnumerable<IResettable> ChangedSettings { get; } = settings.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;
}