Files
LifeProject/LifeGraphics/shaders/IShaderGraphNodeFactory.cpp
2025-05-13 02:46:21 +03:00

19 lines
473 B
C++

#include "shaders/IShaderGraphNodeFactory.h"
namespace LifeGraphics
{
void IShaderGraphNodeFactory::RegisterNode(const String& name, NodeFactoryFunc func)
{
if(FactoryFuncs.find(name) != FactoryFuncs.end())
return;
FactoryFuncs[name] = func;
}
IShaderGraphNode* IShaderGraphNodeFactory::Build(const String& name)
{
if(FactoryFuncs.find(name) == FactoryFuncs.end())
return 0;
IShaderGraphNode* n = FactoryFuncs[name]();
n->Name = name;
return n;
}
}