• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Nodes.Node类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Behaviac.Design.Nodes.Node的典型用法代码示例。如果您正苦于以下问题:C# Node类的具体用法?C# Node怎么用?C# Node使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Node类属于Behaviac.Design.Nodes命名空间,在下文中一共展示了Node类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GenerateMethod

        protected override void GenerateMethod(Node node, StreamWriter stream, string indent)
        {
            base.GenerateMethod(node, stream, indent);

            ReferencedBehavior referencedBehavior = node as ReferencedBehavior;
            if (referencedBehavior == null)
                return;

            stream.WriteLine("{0}\t\tvirtual const char* GetReferencedTree(const Agent* pAgent) const", indent);
            stream.WriteLine("{0}\t\t{{", indent);
            stream.WriteLine("{0}\t\t\tBEHAVIAC_UNUSED_VAR(pAgent);", indent);

            string retStr = RightValueCppExporter.GenerateCode(referencedBehavior.ReferenceBehavior, stream, indent + "\t\t\t", "const char*", string.Empty, "_referencedBehavior");

            bool bConst = false;
            if (referencedBehavior.ReferenceBehavior.Var != null && referencedBehavior.ReferenceBehavior.Var.IsConst)
            {
                bConst = true;
            }

            if (!bConst)
            {
                stream.WriteLine("{0}\t\t\tif (pAgent) {{", indent);
            }

            stream.WriteLine("{0}\t\t\treturn {1};", indent, retStr);

            if (!bConst)
            {
                stream.WriteLine("{0}\t\t\t}}", indent);
                stream.WriteLine("{0}\t\t\treturn 0;", indent);
            }

            stream.WriteLine("{0}\t\t}}", indent);
        }
开发者ID:Just4F,项目名称:behaviac,代码行数:35,代码来源:ReferencedBehaviorCppExporter.cs


示例2: GenerateConstructor

        protected override void GenerateConstructor(Node node, StreamWriter stream, string indent, string className)
        {
            base.GenerateConstructor(node, stream, indent, className);

            DecoratorIterator iterator = node as DecoratorIterator;
            if (iterator == null)
                return;

            if (iterator.Opl != null || iterator.Opr != null)
            {
                if (iterator.Opl != null)
                {
                    stream.WriteLine("{0}\t\t\tthis.m_opl = Condition.LoadLeft(\"{1}\");", indent, iterator.Opl.GetExportValue());
                    stream.WriteLine("{0}\t\t\tDebug.Check(this.m_opl != null);", indent);
                }

                stream.WriteLine("{0}\t\t\tstring typeName = null;", indent);

                if (iterator.Opr != null)
                {
                    stream.WriteLine("{0}\t\t\tthis.m_opr = Condition.LoadRight(\"{1}\", ref typeName);", indent, iterator.Opr.GetExportValue());
                    stream.WriteLine("{0}\t\t\tDebug.Check(this.m_opr != null);", indent);
                }
            }
        }
开发者ID:675492062,项目名称:behaviac,代码行数:25,代码来源:DecoratorIteratorCsExporter.cs


示例3: CloneProperties

        protected override void CloneProperties(Node newnode)
        {
            base.CloneProperties(newnode);

            DecoratorLog dec = (DecoratorLog)newnode;
            dec._logMessage = _logMessage;
        }
开发者ID:675492062,项目名称:behaviac,代码行数:7,代码来源:DecoratorLog.cs


示例4: CloneProperties

        protected override void CloneProperties(Node newnode)
        {
            base.CloneProperties(newnode);

            DecoratorLoopUntil node = (DecoratorLoopUntil)newnode;
            node._until = this._until;
        }
开发者ID:675492062,项目名称:behaviac,代码行数:7,代码来源:DecoratorLoopUntil.cs


示例5: ExportAttachment

        private void ExportAttachment(StreamWriter file, string btClassName, string agentType, string parentName, Node node, string indent)
        {
            if (node.Attachments.Count > 0)
            {
                file.WriteLine("{0}// attachments", indent);
                foreach (Behaviac.Design.Attachments.Attachment attach in node.Attachments)
                {
                    file.WriteLine("{0}{{", indent);

                    string nodeName = string.Format("attach{0}", attach.Id);

                    // export its instance and the properties
                    AttachmentCsExporter attachmentExporter = AttachmentCsExporter.CreateInstance(attach);
                    attachmentExporter.GenerateInstance(attach, file, indent, nodeName, agentType, btClassName);

                    ExportPars(file, nodeName, attach, indent);

                    file.WriteLine("{0}\t{1}.Attach({2});", indent, parentName, nodeName);
                    if (attach is Behaviac.Design.Attachments.Event)
                    {
                        file.WriteLine("{0}\t{1}.SetHasEvents({1}.HasEvents() | ({2} is Event));", indent, parentName, nodeName);
                    }
                    file.WriteLine("{0}}}", indent);
                }
            }
        }
开发者ID:KeyleXiao,项目名称:behaviac,代码行数:26,代码来源:ExporterCs.cs


示例6: SubItemProperty

 /// <summary>
 /// Creates a new subitem which can show a property on the node.
 /// </summary>
 /// <param name="owner">The node whose property we want to show. MUST be the same as the one the subitem belongs to.</param>
 /// <param name="property">The property we want to show.</param>
 /// <param name="att">The attribute associated with the property.</param>
 public SubItemProperty(Node owner, PropertyInfo property, DesignerProperty att)
     : base(null, null, __font, Brushes.White, Alignment.Center, false)
 {
     _owner = owner;
     _property = property;
     _attribute = att;
 }
开发者ID:KeyleXiao,项目名称:behaviac,代码行数:13,代码来源:NodeViewData.SubItemProperty.cs


示例7: CreateInstance

        public static NodeCppExporter CreateInstance(Node node)
        {
            if (node != null)
            {
                string nodeExporter = "PluginBehaviac.NodeExporters." + node.ExportClass + "CppExporter";
                Type exporterType = Type.GetType(nodeExporter);
                if (exporterType == null)
                {
                    foreach (Assembly assembly in Plugin.GetLoadedPlugins())
                    {
                        string filename = Path.GetFileNameWithoutExtension(assembly.Location);
                        nodeExporter = filename + ".NodeExporters." + node.ExportClass + "CppExporter";
                        exporterType = assembly.GetType(nodeExporter);
                        if (exporterType != null)
                        {
                            break;
                        }
                    }
                }

                if (exporterType != null)
                {
                    return (NodeCppExporter)Activator.CreateInstance(exporterType);
                }
            }

            return new NodeCppExporter();
        }
开发者ID:KeyleXiao,项目名称:behaviac,代码行数:28,代码来源:NodeCppExporter.cs


示例8: SetPar

        public void SetPar(ParInfo par, Nodes.Node rootNode, bool isNewPar)
        {
            Debug.Check(par != null && rootNode != null);

            _isNewPar = isNewPar;
            _initialized = false;

            this.Text = isNewPar ? Resources.NewPar : Resources.EditPar;

            _par = par;
            _parTemp = par.Clone();
            _rootNode = rootNode;

            setParTypes();

            if (par != null) {
                _isArray = Plugin.IsArrayType(par.Type);
                Type type = _isArray ? par.Type.GetGenericArguments()[0] : par.Type;

                nameTextBox.Text = par.Name;
                arrayCheckBox.Checked = _isArray;
                typeComboBox.Text = Plugin.GetMemberValueTypeName(type);
                descTextBox.Text = par.BasicDescription;

                setValue(type);
            }

            enableOkButton();

            _initialized = true;
        }
开发者ID:wuzhen,项目名称:behaviac,代码行数:31,代码来源:ParSettingsDialog.cs


示例9: CloneProperties

        protected override void CloneProperties(Node newnode)
        {
            base.CloneProperties(newnode);

            State state = (State)newnode;

            state._method = this._method;
        }
开发者ID:XyzalZhang,项目名称:behaviac,代码行数:8,代码来源:State.cs


示例10: CloneProperties

        protected override void CloneProperties(Node newnode)
        {
            base.CloneProperties(newnode);

            Wait dec = (Wait)newnode;
            if (_time != null)
                dec._time = (RightValueDef)_time.Clone();
        }
开发者ID:Just4F,项目名称:behaviac,代码行数:8,代码来源:Wait.cs


示例11: CloneProperties

        protected override void CloneProperties(Node newnode)
        {
            base.CloneProperties(newnode);

            ExampleNode dec = (ExampleNode)newnode;
            if (_time != null)
                dec._time = (VariableDef)_time.Clone();
        }
开发者ID:675492062,项目名称:behaviac,代码行数:8,代码来源:ExampleNode.cs


示例12: MayProcessCheckOnly

        /// <summary>
        /// Checks if a node may be processed without running into circular references. The node is not added to the list.
        /// </summary>
        /// <param name="node">The node we want to process.</param>
        /// <returns>Returns true when the node may be processed, if not the calling function has to stop.</returns>
        public bool MayProcessCheckOnly(Node node) {
            ReferencedBehavior refnode = node as ReferencedBehavior;

            if (refnode != null)
            { return !_processedBehaviors.Contains(refnode); }

            return true;
        }
开发者ID:Just4F,项目名称:behaviac,代码行数:13,代码来源:ProcessedBehaviors.cs


示例13: CloneProperties

		protected override void CloneProperties(Node newnode)
		{
			base.CloneProperties(newnode);

            DecoratorCount dec = (DecoratorCount)newnode;
            if (_count != null)
                dec._count = (VariableDef)_count.Clone();
		}
开发者ID:675492062,项目名称:behaviac,代码行数:8,代码来源:DecoratorCount.cs


示例14: Branch

        /// <summary>
        /// Branches the list for a node.
        /// </summary>
        /// <param name="node">The node we are branching for.</param>
        /// <returns>A new list which contains the previously processed behaviours for referenced behaviours. For other nodes it returns the same list.</returns>
        public ProcessedBehaviors Branch(Node node)
        {
            ReferencedBehaviorNode refnode= node as ReferencedBehaviorNode;
            if(refnode !=null)
                return new ProcessedBehaviors(this);

            return this;
        }
开发者ID:KeyleXiao,项目名称:behaviac,代码行数:13,代码来源:ProcessedBehaviors.cs


示例15: CloneProperties

        protected override void CloneProperties(Node newnode)
        {
            base.CloneProperties(newnode);

            WaitFrames dec = (WaitFrames)newnode;
            if (_frames != null)
                dec._frames = (RightValueDef)_frames.Clone();
        }
开发者ID:XyzalZhang,项目名称:behaviac,代码行数:8,代码来源:WaitFrames.cs


示例16: CloneProperties

        protected override void CloneProperties(Node newnode)
        {
            base.CloneProperties(newnode);

            DecoratorTime dec = (DecoratorTime)newnode;
            if (_time != null)
                dec._time = (VariableDef)_time.Clone();
        }
开发者ID:KeyleXiao,项目名称:behaviac,代码行数:8,代码来源:DecoratorTime.cs


示例17: GenerateConstructor

        protected override void GenerateConstructor(Node node, StreamWriter stream, string indent, string className)
        {
            base.GenerateConstructor(node, stream, indent, className);

            DecoratorLog decoratorLog = node as DecoratorLog;
            Debug.Check(decoratorLog != null);

            stream.WriteLine("{0}\t\t\tm_message = \"{1}\";", indent, decoratorLog.Log);
        }
开发者ID:nusus,项目名称:behaviac,代码行数:9,代码来源:DecoratorLogCsExporter.cs


示例18: GenerateConstructor

        protected override void GenerateConstructor(Node node, StreamWriter stream, string indent, string className)
        {
            base.GenerateConstructor(node, stream, indent, className);

            Decorator decorator = node as Decorator;
            Debug.Check(decorator != null);

            stream.WriteLine("{0}\t\t\tm_bDecorateWhenChildEnds = {1};", indent, decorator.DecorateWhenChildEnds ? "true" : "false");
        }
开发者ID:KeyleXiao,项目名称:behaviac,代码行数:9,代码来源:DecoratorCppExporter.cs


示例19: GenerateConstructor

        protected override void GenerateConstructor(Node node, StreamWriter stream, string indent, string className)
        {
            base.GenerateConstructor(node, stream, indent, className);

            Wait wait = node as Wait;
            Debug.Check(wait != null);

            stream.WriteLine("{0}\t\t\tm_ignoreTimeScale = {1};", indent, wait.IgnoreTimeScale ? "true" : "false");
        }
开发者ID:nusus,项目名称:behaviac,代码行数:9,代码来源:WaitCppExporter.cs


示例20: GenerateConstructor

        protected override void GenerateConstructor(Node node, StreamWriter stream, string indent, string className)
        {
            base.GenerateConstructor(node, stream, indent, className);

            DecoratorLoopUntil decoratorLoopUntil = node as DecoratorLoopUntil;
            Debug.Check(decoratorLoopUntil != null);

            stream.WriteLine("{0}\t\t\tm_until = {1};", indent, decoratorLoopUntil.Until ? "true" : "false");
        }
开发者ID:KeyleXiao,项目名称:behaviac,代码行数:9,代码来源:DecoratorLoopUntilCppExporter.cs



注:本文中的Behaviac.Design.Nodes.Node类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# BehaviourMachine.FloatVar类代码示例发布时间:2022-05-24
下一篇:
C# Attributes.DesignerPropertyInfo类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap