public void GenerateRec(AbsUnderNode node, World world) { node.Build(world); foreach (var n in node.children) { GenerateRec(n, world); } }
// TODO: Build and cache this, DO NOT build this everytime OMG ... AbsUnderNode buildNodeRec(AbsNode node) { AbsUnderNode result = node._Build(); LinkedList <AbsUnderNode> children = new LinkedList <AbsUnderNode>(); foreach (var o in node.Outputs) { foreach (var c in o.GetConnections()) { if (c.node is AbsNode) { children.AddLast(buildNodeRec(c.node as AbsNode)); } } } result.children = children; return(result); }
public AbsUnderNode _Build() { AbsUnderNode n = Build(); n.Init(); built = true; return(n); }