示例#1
0
        public void RebuildFunctionNodes()
        {
            if (m_nodes.Count < 2)
            {
                throw new Exception("A function graph always needs at least 2 nodes, Entry and Return");
            }
            CFunctionGraphEntryNode entryNode = m_nodes[0] as CFunctionGraphEntryNode;

            if (entryNode == null)
            {
                throw new Exception("First node in the function graph was not a entry node");
            }
            entryNode.RebuildNode(InputParameters);

            CFunctionGraphReturnNode returnNode = m_nodes[1] as CFunctionGraphReturnNode;

            if (returnNode == null)
            {
                throw new Exception("Second node in the function graph was not a return node");
            }
            returnNode.RebuildNode(OutputParameters);

            NumInputValues  = InputParameters.Count;
            NumOutputValues = OutputParameters.Count;

            FunctionNodesRebuilt?.Invoke();
        }
示例#2
0
        public CCustomFunctionGraph()
        {
            CFunctionGraphEntryNode entryNode = new CFunctionGraphEntryNode(InputParameters);

            m_nodes.Add(entryNode);

            CFunctionGraphReturnNode returnNode = new CFunctionGraphReturnNode(OutputParameters);

            returnNode.NodePosX = 400;
            m_nodes.Add(returnNode);

            NumInputValues  = InputParameters.Count;
            NumOutputValues = OutputParameters.Count;
        }
        public CInterfaceFunctionGraph(CKlaxScriptInterfaceFunction interfaceFunction)
        {
            InterfaceFunctionGuid = interfaceFunction.Guid;

            CFunctionGraphEntryNode entryNode = new CFunctionGraphEntryNode(interfaceFunction.InputParameters);

            m_nodes.Add(entryNode);

            CFunctionGraphReturnNode returnNode = new CFunctionGraphReturnNode(interfaceFunction.OutputParameters);

            returnNode.NodePosX = 400;
            m_nodes.Add(returnNode);

            NumInputValues  = interfaceFunction.InputParameters.Count;
            NumOutputValues = interfaceFunction.OutputParameters.Count;
        }