GeWuYou 0c0ddaab7f feat(setting): 添加设置重置功能并重构Godot设置类
- 在SettingsModel中添加Reset<T>()和ResetAll()方法
- 在SettingsSystem中添加异步Reset<T>()和ResetAll()方法
- 扩展ISettingsModel和ISettingsSystem接口以支持重置操作
- 重构GodotAudioSettings、GodotGraphicsSettings和GodotLocalizationSettings类
- 将直接依赖设置对象改为依赖ISettingsModel接口
- 实现IResettable接口以支持设置重置功能
- [release ci]
2026-01-29 21:51:41 +08:00

41 lines
1.3 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.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();
/// <summary>
/// 重置指定类型的设置
/// </summary>
/// <typeparam name="T">设置类型必须继承自class并实现IPersistentApplyAbleSettings接口</typeparam>
/// <returns>表示异步操作的任务</returns>
Task Reset<T>() where T : class, IPersistentApplyAbleSettings, new();
/// <summary>
/// 重置所有设置
/// </summary>
/// <returns>表示异步操作的任务</returns>
Task ResetAll();
}