mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-24 20:34:29 +08:00
docs(game): 更新游戏设置文档中的代码注释和示例
- 移除 GameSettings 类的 XML 文档注释 - 移除 GameSettings 应用器的 XML 文档注释 - 修正 Factory Pattern 描述中的方法名称格式 - 更新设计模式说明以匹配实际实现细节
This commit is contained in:
parent
7dd9b99e49
commit
cd25f8effe
@ -98,9 +98,6 @@ await settingsSystem.Apply(types);
|
|||||||
### 创建自定义设置
|
### 创建自定义设置
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
/// <summary>
|
|
||||||
/// 游戏设置类
|
|
||||||
/// </summary>
|
|
||||||
public class GameSettings : ISettingsSection
|
public class GameSettings : ISettingsSection
|
||||||
{
|
{
|
||||||
public float GameSpeed { get; set; } = 1.0f;
|
public float GameSpeed { get; set; } = 1.0f;
|
||||||
@ -116,9 +113,6 @@ gameSettings.GameSpeed = 1.5f;
|
|||||||
### 创建可应用设置
|
### 创建可应用设置
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
/// <summary>
|
|
||||||
/// 游戏设置应用器
|
|
||||||
/// </summary>
|
|
||||||
public class GameSettings : ISettingsSection, IApplyAbleSettings
|
public class GameSettings : ISettingsSection, IApplyAbleSettings
|
||||||
{
|
{
|
||||||
public float GameSpeed { get; set; } = 1.0f;
|
public float GameSpeed { get; set; } = 1.0f;
|
||||||
@ -187,7 +181,7 @@ public interface ISettingsSystem
|
|||||||
|
|
||||||
1. **Repository Pattern** - SettingsModel 作为设置数据的仓库
|
1. **Repository Pattern** - SettingsModel 作为设置数据的仓库
|
||||||
2. **Command Pattern** - IApplyAbleSettings 的 Apply 方法作为命令
|
2. **Command Pattern** - IApplyAbleSettings 的 Apply 方法作为命令
|
||||||
3. **Factory Pattern** - Get<T>() 方法创建设置实例
|
3. **Factory Pattern** - Get`<T>`() 方法创建设置实例
|
||||||
4. **Template Method** - AbstractSystem 提供初始化模板
|
4. **Template Method** - AbstractSystem 提供初始化模板
|
||||||
|
|
||||||
## 最佳实践
|
## 最佳实践
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user