GFramework/GFramework.Game/setting/events/SettingsBatchSavedEvent.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

30 lines
969 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="settings">要保存的设置数据集合</param>
public class SettingsBatchSavedEvent(IEnumerable<IResettable> settings) : ISettingsChangedEvent
{
/// <summary>
/// 获取已保存的设置数据只读集合
/// </summary>
public IReadOnlyCollection<IResettable> SavedSettings { 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;
}