mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 移除 SettingsResetEvent 中的旧设置属性,改为仅保存新设置 - 删除 SettingsPersistence 中的重置方法,统一通过命令模式处理 - 在 SettingsSystem 中添加 ResetAsync 方法并集成命令模式 - 为 AudioSettings 和 GraphicsSettings 添加 Reset 方法实现 - 扩展 ISettingsData 接口添加 Reset 方法定义 - 从接口中移除重置相关方法定义 - 在 ISettingsSystem 中添加重置相关的异步方法声明 - 为 AudioBusMapSettings 添加 Reset 方法实现 - 新增 ResetSettingsCommand 和 ResetSettingsInput 实现命令模式 - 添加 SettingsData 抽象基类提供默认的 Reset 实现 - [skip ci]
50 lines
1.3 KiB
C#
50 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using GFramework.Core.Abstractions.system;
|
|
|
|
namespace GFramework.Game.Abstractions.setting;
|
|
|
|
/// <summary>
|
|
/// 定义设置系统的接口,提供应用各种设置的方法
|
|
/// </summary>
|
|
public interface ISettingsSystem : ISystem
|
|
{
|
|
/// <summary>
|
|
/// 应用所有可应用的设置
|
|
/// </summary>
|
|
Task ApplyAll();
|
|
|
|
/// <summary>
|
|
/// 应用指定类型的设置
|
|
/// </summary>
|
|
Task Apply(Type settingsType);
|
|
|
|
/// <summary>
|
|
/// 应用指定类型的设置(泛型版本)
|
|
/// </summary>
|
|
Task Apply<T>() where T : class, ISettingsSection;
|
|
|
|
/// <summary>
|
|
/// 批量应用多个设置类型
|
|
/// </summary>
|
|
/// <param name="settingsTypes">设置配置类型集合</param>
|
|
Task Apply(IEnumerable<Type> settingsTypes);
|
|
|
|
/// <summary>
|
|
/// 重置指定类型的设置
|
|
/// </summary>
|
|
/// <param name="settingsType">设置类型</param>
|
|
Task ResetAsync(Type settingsType);
|
|
|
|
/// <summary>
|
|
/// 重置指定类型的设置(泛型版本)
|
|
/// </summary>
|
|
/// <typeparam name="T">设置类型</typeparam>
|
|
Task ResetAsync<T>() where T : class, ISettingsData, new();
|
|
|
|
/// <summary>
|
|
/// 重置所有设置
|
|
/// </summary>
|
|
Task ResetAllAsync();
|
|
} |