fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling - Improve link styling with underline decoration - Hide leaf nodes from tree, only show directories - Fix log file path for packaged app
This commit is contained in:
28
docs/api/resources/dependencygraph/topologicalsort.md
Normal file
28
docs/api/resources/dependencygraph/topologicalsort.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# ResourceDependencyGraph::TopologicalSort
|
||||
|
||||
```cpp
|
||||
Containers::Array<ResourceGUID> TopologicalSort() const
|
||||
```
|
||||
|
||||
拓扑排序。按依赖顺序返回所有节点,确保被依赖的资源排在依赖者之前。用于确定正确的加载和卸载顺序。
|
||||
|
||||
**参数:** 无
|
||||
|
||||
**返回:** 按依赖顺序排序的 GUID 数组
|
||||
|
||||
**复杂度:** O(n + e),n 为节点数,e 为边数
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
auto loadOrder = graph.TopologicalSort();
|
||||
// loadOrder[0] 是最底层依赖(如 Texture)
|
||||
// loadOrder[last] 是最顶层资源(如 Material)
|
||||
for (const auto& guid : loadOrder) {
|
||||
ResourceManager::Get().Load(guid);
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [ResourceDependencyGraph 总览](dependencygraph.md) - 返回类总览
|
||||
Reference in New Issue
Block a user