GeWuYou 2896f35c67 feat(setting): 更新设置系统支持数据持久化和泛型仓库
- 添加 IDataRepository 依赖注入支持泛型仓库
- 实现 SaveAll 方法用于保存所有设置数据到存储库
- 为 ApplyAll 和 Apply<T> 方法添加返回值类型注释
- 添加 SettingsApplyingEvent 事件发送功能
- 优化代码结构使用泛型约束和空合并运算符
- 添加 Repository 属性确保仓库实例不为空
2026-01-28 23:01:46 +08:00

28 lines
851 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.Core.Abstractions.system;
namespace GFramework.Game.Abstractions.setting;
/// <summary>
/// 定义设置系统的接口,提供应用各种设置的方法
/// </summary>
public interface ISettingsSystem : ISystem
{
/// <summary>
/// 应用所有可应用的设置
/// </summary>
/// <returns>表示异步操作的任务</returns>
Task ApplyAll();
/// <summary>
/// 应用指定类型的设置(泛型版本)
/// </summary>
/// <typeparam name="T">设置类型必须是class且实现IApplyAbleSettings接口</typeparam>
/// <returns>表示异步操作的任务</returns>
Task Apply<T>() where T : class, IApplyAbleSettings;
/// <summary>
/// 保存所有设置
/// </summary>
/// <returns>表示异步操作的任务</returns>
Task SaveAll();
}