using System; using System.Collections.Generic; namespace Core; /// /// 资源定义接口(用于 .tres/.res 的内容加载) /// 设计说明: /// 1) 资源负责“序列化友好”,模型负责“运行时友好”。 /// 2) 通过 ToDefinition 映射到纯数据模型,保持解耦。 /// 注意事项: /// - 资源字段尽量使用 Godot 可序列化的基础类型与 Array。 /// 未来扩展: /// - 可加入验证器,确保 Id/路径等关键字段符合规范。 /// public interface IContentResource { /// /// 获取定义类型 /// /// 类型 Type GetDefinitionType(); /// /// 转换为定义对象 /// /// 定义对象 object ToDefinition(); } /// /// 资源集合接口 /// public interface IContentResourceCollection { /// /// 获取资源项集合 /// /// 资源项集合 IEnumerable GetItems(); }