mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 移除架构概览页面的独立文件,将其内容迁移至getting-started目录 - 更新导航菜单中架构概览的链接路径 - 删除game模块中的场景管理文档及其相关引用 - 修复godot模块中相关文档的链接格式 - 清理各个文档末尾的多余链接和许可证信息 - 优化文档间的引用关系,确保链接有效性
1.5 KiB
1.5 KiB
Game Abstractions
GFramework.Game.Abstractions 游戏模块抽象接口定义
概述
GFramework.Game.Abstractions 包含了游戏特定功能的抽象接口,这些接口定义了游戏开发中的通用契约。
存档接口
ISaveSystem
存档系统接口:
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
存档数据接口:
public interface ISaveData
{
int Version { get; }
DateTime Timestamp { get; }
void Validate();
}
设置接口
IGameSettings
游戏设置接口:
public interface IGameSettings
{
AudioSettings Audio { get; }
GraphicsSettings Graphics { get; }
InputSettings Input { get; }
void Save();
void Load();
void ResetToDefaults();
}
场景管理接口
ISceneManager
场景管理器接口:
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
场景接口:
public interface IScene
{
void OnEnter();
void OnExit();
void OnUpdate(float delta);
}
相关文档: