GFramework/docs/zh-CN/abstractions/game-abstractions.md
GeWuYou 3d656981b4 docs: 更新文档结构和链接配置
- 移除架构概览页面的独立文件,将其内容迁移至getting-started目录
- 更新导航菜单中架构概览的链接路径
- 删除game模块中的场景管理文档及其相关引用
- 修复godot模块中相关文档的链接格式
- 清理各个文档末尾的多余链接和许可证信息
- 优化文档间的引用关系,确保链接有效性
2026-02-11 15:51:48 +08:00

95 lines
1.5 KiB
Markdown
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.

# Game Abstractions
> GFramework.Game.Abstractions 游戏模块抽象接口定义
## 概述
GFramework.Game.Abstractions 包含了游戏特定功能的抽象接口,这些接口定义了游戏开发中的通用契约。
## 存档接口
### ISaveSystem
存档系统接口:
```csharp
public interface ISaveSystem
{
void Save(string slotId, SaveData data);
SaveData Load(string slotId);
bool HasSave(string slotId);
void Delete(string slotId);
List<SaveSlotInfo> GetAllSaveSlots();
}
```
### ISaveData
存档数据接口:
```csharp
public interface ISaveData
{
int Version { get; }
DateTime Timestamp { get; }
void Validate();
}
```
## 设置接口
### IGameSettings
游戏设置接口:
```csharp
public interface IGameSettings
{
AudioSettings Audio { get; }
GraphicsSettings Graphics { get; }
InputSettings Input { get; }
void Save();
void Load();
void ResetToDefaults();
}
```
## 场景管理接口
### ISceneManager
场景管理器接口:
```csharp
public interface ISceneManager
{
void SwitchScene<TScene>() where TScene : IScene;
Task SwitchSceneAsync<TScene>() where TScene : IScene;
void PushScene<TScene>() where TScene : IScene;
void PopScene();
IScene CurrentScene { get; }
}
```
### IScene
场景接口:
```csharp
public interface IScene
{
void OnEnter();
void OnExit();
void OnUpdate(float delta);
}
```
---
**相关文档**
- [Game 概述](../game/index.md)
- [核心抽象](./core-abstractions.md)