NodePipeline/NodePipeline.Configuration.Yaml/Loader/YamlGraphLoader.cs
2026-01-02 20:55:25 +03:00

18 lines
787 B
C#

using NodePipeline.Configuration.Abstractions;
using NodePipeline.Configuration.Abstractions.Interfaces;
using NodePipeline.Configuration.Abstractions.Models.Execute;
namespace NodePipeline.Configuration.Yaml.Loader;
public class YamlGraphLoader(IEditorPipelineConfigLoader? editorPipelineConfigLoader = null) : IPipelineConfigLoader
{
private readonly IEditorPipelineConfigLoader _editorPipelineConfigLoader = editorPipelineConfigLoader
?? new YamlEditorConfigLoader();
public PipelineConfig Load(Stream stream)
{
var editorConfig = _editorPipelineConfigLoader.Load(stream);
var config = EditorToRuntimePipelineConverter.ToRuntime(editorConfig);
return config;
}
}