mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 19:03:29 +08:00
- 添加 IDataRepository 依赖注入支持泛型仓库 - 实现 SaveAll 方法用于保存所有设置数据到存储库 - 为 ApplyAll 和 Apply<T> 方法添加返回值类型注释 - 添加 SettingsApplyingEvent 事件发送功能 - 优化代码结构使用泛型约束和空合并运算符 - 添加 Repository 属性确保仓库实例不为空
28 lines
851 B
C#
28 lines
851 B
C#
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();
|
||
} |