Пример #1
0
        private static List <NodeFieldDesc> _GetNodeOutPutEnvKeyList(NodeProto nodeProto, NodeProto inputNode, NodeFieldDesc desc = null)
        {
            if (nodeProto.Id >= inputNode.Id)
            {
                return(new List <NodeFieldDesc>());
            }
            List <NodeFieldDesc> list = new List <NodeFieldDesc>();

            if (desc == null)
            {
                list = NodeMetaHelper.GetNodeFieldInOutPutDescList(nodeProto.Name, typeof(NodeOutputAttribute));
            }
            else
            {
                list = NodeMetaHelper.GetNodeFieldInOutPutFilterDescList(nodeProto.Name, typeof(NodeOutputAttribute), desc.envKeyType);
            }
            for (int i = 0; i < list.Count; i++)
            {
                object value = nodeProto.Args.Get(list[i].name);
                list[i].value = value;
            }

            foreach (NodeProto childProto in nodeProto.children)
            {
                list.AddRange(_GetNodeOutPutEnvKeyList(childProto, inputNode, desc));
            }
            return(list);
        }
Пример #2
0
        public List <string> GetSelectNodeInputValueList(NodeProto nodeProto)
        {
            List <string>        resultList = new List <string>();
            List <NodeFieldDesc> list       = NodeMetaHelper.GetNodeFieldInOutPutDescList(nodeProto.Name, typeof(NodeInputAttribute));

            foreach (NodeFieldDesc desc in list)
            {
                string value = nodeProto.Args.Get(desc.name)?.ToString();
                resultList.Add(value);
            }
            return(resultList);
        }
Пример #3
0
        public bool IsHighLight(BehaviorNodeData node)
        {
            NodeProto            nodeProto = this.BehaviorNodeDataToNodeProto(node);
            List <NodeFieldDesc> list      = NodeMetaHelper.GetNodeFieldInOutPutDescList(nodeProto.Name, typeof(NodeOutputAttribute));

            foreach (NodeFieldDesc desc in list)
            {
                if (!nodeProto.Args.ContainsKey(desc.name))
                {
                    continue;
                }
                string        value      = nodeProto.Args.Get(desc.name)?.ToString();
                List <string> resultList = inputValueList.FindAll(str => { return(str == value); });
                if (resultList.Count > 0)
                {
                    return(true);
                }
            }
            return(false);
        }
Пример #4
0
        public bool CheckNodeInput(NodeProto nodeProto)
        {
            List <NodeFieldDesc> list = NodeMetaHelper.GetNodeFieldInOutPutDescList(nodeProto.Name, typeof(NodeInputAttribute));

            foreach (NodeFieldDesc desc in list)
            {
                List <string> canInputList = GetCanInPutEnvKeyList(this.NodeProtoToBehaviorNodeData(nodeProto), desc);
                string        value        = nodeProto.Args.Get(desc.name)?.ToString();
                List <string> resultList   = canInputList.FindAll(str => str == value);
                if (resultList.Count == 0)
                {
                    Log.Error($"{nodeProto.Name}节点(id:{nodeProto.Id})的{value}输入值非法!");
                    return(false);
                }
            }
            foreach (NodeProto child in nodeProto.children)
            {
                if (!CheckNodeInput(child))
                {
                    return(false);
                }
            }
            return(true);
        }