Files
XCSDD/src/data/sampleData.ts

181 lines
5.3 KiB
TypeScript
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.
export interface Subsystem {
id: string;
name: string;
responsibilities: string[];
provides: string[];
depends_on: string[];
}
export interface Module {
id: string;
name: string;
parent_subsystem: string;
responsibility: string;
public_api: {
fn: string;
params: { name: string; type: string }[];
returns: { type: string };
}[];
}
export interface SystemMeta {
name: string;
version: string;
type: string;
description: string;
target_runtime: string;
}
export interface BlueprintData {
meta: SystemMeta;
subsystems: Subsystem[];
modules: Module[];
}
export const sampleBlueprint: BlueprintData = {
meta: {
name: 'UnityEngine',
version: '0.1.0',
type: 'game-engine',
description: '轻量级3D游戏引擎支持场景管理、渲染、物理、脚本系统',
target_runtime: 'C++17 / C#'
},
subsystems: [
{
id: 'Core',
name: 'Core',
responsibilities: ['基础数据类型和算法', '内存管理', '平台抽象层'],
provides: ['IAllocator', 'IPlatform', 'IFileSystem'],
depends_on: []
},
{
id: 'Rendering',
name: 'Rendering',
responsibilities: ['渲染管线管理', '渲染资源管理', 'Shader管理', 'Camera管理'],
provides: ['IRenderPipeline', 'IRenderResource', 'IShader', 'ICamera'],
depends_on: ['Core']
},
{
id: 'Physics',
name: 'Physics',
responsibilities: ['物理模拟', '碰撞检测', '刚体/关节系统'],
provides: ['IPhysicsWorld', 'ICollider', 'IRigidbody'],
depends_on: ['Core']
},
{
id: 'Scripting',
name: 'Scripting',
responsibilities: ['脚本生命周期管理', 'C#运行时集成', '组件系统'],
provides: ['IScriptRuntime', 'IMonoBehaviour', 'IComponent'],
depends_on: ['Core']
},
{
id: 'Scene',
name: 'Scene',
responsibilities: ['场景图管理', 'GameObject层级管理', '变换层级'],
provides: ['IScene', 'IGameObject', 'ITransform'],
depends_on: ['Core']
},
{
id: 'Asset',
name: 'Asset',
responsibilities: ['资源加载/卸载', '资源引用计数', '资源格式支持'],
provides: ['IAssetLoader', 'IAssetDatabase'],
depends_on: ['Core']
},
{
id: 'Input',
name: 'Input',
responsibilities: ['输入事件采集', '输入映射'],
provides: ['IInputSystem'],
depends_on: ['Core']
},
{
id: 'Platform',
name: 'Platform',
responsibilities: ['平台特定实现', '窗口管理', '主循环'],
provides: ['IWindow', 'IApplication'],
depends_on: ['Core']
}
],
modules: [
{
id: 'RHI',
name: 'RHI',
parent_subsystem: 'Rendering',
responsibility: '渲染硬件抽象层',
public_api: [
{ fn: 'CreateGraphicsPipeline', params: [{ name: 'desc', type: 'GraphicsPipelineDesc' }], returns: { type: 'IPipeline' } },
{ fn: 'Draw', params: [{ name: 'pipeline', type: 'IPipeline' }, { name: 'mesh', type: 'IMesh' }], returns: { type: 'void' } }
]
},
{
id: 'RenderPipeline',
name: 'RenderPipeline',
parent_subsystem: 'Rendering',
responsibility: '渲染管线调度',
public_api: [
{ fn: 'Render', params: [{ name: 'scene', type: 'IScene' }, { name: 'camera', type: 'ICamera' }], returns: { type: 'void' } }
]
},
{
id: 'ShaderManager',
name: 'ShaderManager',
parent_subsystem: 'Rendering',
responsibility: 'Shader编译和缓存',
public_api: [
{ fn: 'LoadShader', params: [{ name: 'path', type: 'string' }], returns: { type: 'IShader' } }
]
},
{
id: 'PhysicsWorld',
name: 'PhysicsWorld',
parent_subsystem: 'Physics',
responsibility: '物理世界模拟',
public_api: [
{ fn: 'Step', params: [{ name: 'dt', type: 'float' }], returns: { type: 'void' } }
]
},
{
id: 'MonoBehaviour',
name: 'MonoBehaviour',
parent_subsystem: 'Scripting',
responsibility: '脚本组件基类',
public_api: [
{ fn: 'Awake', params: [], returns: { type: 'void' } },
{ fn: 'Start', params: [], returns: { type: 'void' } },
{ fn: 'Update', params: [{ name: 'dt', type: 'float' }], returns: { type: 'void' } }
]
},
{
id: 'Transform',
name: 'Transform',
parent_subsystem: 'Scene',
responsibility: '变换层级管理',
public_api: [
{ fn: 'SetParent', params: [{ name: 'parent', type: 'ITransform' }], returns: { type: 'void' } },
{ fn: 'LocalToWorld', params: [{ name: 'localPos', type: 'vec3' }], returns: { type: 'vec3' } }
]
},
{
id: 'GameObject',
name: 'GameObject',
parent_subsystem: 'Scene',
responsibility: '场景对象管理',
public_api: [
{ fn: 'AddComponent', params: [{ name: 'type', type: 'type_info' }], returns: { type: 'IComponent' } },
{ fn: 'GetComponent', params: [{ name: 'type', type: 'type_info' }], returns: { type: 'IComponent' } }
]
},
{
id: 'AssetLoader',
name: 'AssetLoader',
parent_subsystem: 'Asset',
responsibility: '资源异步加载',
public_api: [
{ fn: 'LoadAsync', params: [{ name: 'path', type: 'string' }], returns: { type: 'AssetFuture' } }
]
}
]
};