当前位置: 首页>>代码示例>>C#>>正文


C# Design.AgentType类代码示例

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


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

示例1: InspectObject

        public void InspectObject(AgentType agentType, string agentFullname, Nodes.Node node)
        {
            _agentFullname = agentFullname;

            preLayout();

            deleteAllRowControls();

            if (agentType != null)
            {
                IList<PropertyDef> properties = agentType.GetProperties();
                foreach (PropertyDef p in properties)
                {
                    addRowControl(p, null);
                }
            }
            else if (node != null)
            {
                List<ParInfo> allPars = node.Pars;
                foreach (ParInfo par in allPars)
                {
                    addRowControl(null, par);
                }
            }

            postLayout();
        }
开发者ID:KeyleXiao,项目名称:behaviac,代码行数:27,代码来源:ParametersPanel.cs

示例2: MetaMethodDialog

        public MetaMethodDialog(AgentType agent, MethodDef method, MemberType memberType)
        {
            InitializeComponent();

            this.Owner = MainWindow.Instance;

            this.metaMethodPanel.Initialize(true, agent, method, memberType);
        }
开发者ID:675492062,项目名称:behaviac,代码行数:8,代码来源:MetaMethodDialog.cs

示例3: MetaPropertyDialog

        public MetaPropertyDialog(bool canBeEdited, AgentType agent, CustomizedStruct customizedStruct, PropertyDef prop, bool canBePar)
        {
            InitializeComponent();

            this.Owner = MainWindow.Instance;

            this.metaPropertyPanel.Initialize(canBeEdited, agent, customizedStruct, prop, canBePar);
        }
开发者ID:675492062,项目名称:behaviac,代码行数:8,代码来源:MetaPropertyDialog.cs

示例4: Inspect

        internal static void Inspect(AgentType agentType, string agentName, string agentFullName, FrameStatePool.PlanningState nodeState) {
            ParametersDock dock = findParametersDock(agentType, agentName);

            if (dock == null) {
                dock = new ParametersDock();
                dock.Show(MainWindow.Instance.DockPanel, WeifenLuo.WinFormsUI.Docking.DockState.DockBottom);
            }

            dock.InspectObject(agentType, agentName, agentFullName, nodeState);
        }
开发者ID:675492062,项目名称:behaviac,代码行数:10,代码来源:ParametersDock.cs

示例5: ResetMembers

        public override bool ResetMembers(bool check, AgentType agentType, bool clear, MethodDef method = null, PropertyDef property = null)
        {
            bool bReset = false;

            if (this._frames != null)
            {
                bReset |= this._frames.ResetMembers(check, agentType, clear, method, property);
            }

            bReset |= base.ResetMembers(check, agentType, clear, method, property);

            return bReset;
        }
开发者ID:675492062,项目名称:behaviac,代码行数:13,代码来源:WaitFramesState.cs

示例6: Initialize

        public void Initialize(bool canBeEdit, AgentType agent, CustomizedStruct customizedStruct, PropertyDef prop, bool canBePar)
        {
            Debug.Check(agent != null || customizedStruct != null);

            _initialized = false;
            _isModified = false;
            _isNew = (prop == null);
            _agent = agent;
            _customizedStruct = customizedStruct;
            _originalProperty = prop;

            setTypes();

            if (_isNew)
            {
                this.Text = canBeEdit ? Resources.AddProperty : Resources.ViewProperty;

                if (customizedStruct == null)
                    _property = new PropertyDef(agent, null, agent.AgentTypeName, "", "", "");
                else
                    _property = new PropertyDef(null, null, customizedStruct.Name, "", "", "");
            }
            else
            {
                this.Text = canBeEdit ? Resources.EditProperty : Resources.ViewProperty;

                resetProperty(prop, prop.IsPar);
            }

            this.isStaticCheckBox.Visible = (agent != null);
            this.isPublicCheckBox.Visible = !canBeEdit && (agent != null);
            this.isConstcheckBox.Visible = (agent != null);
            this.customizedCheckBox.Visible = !canBeEdit && !_property.IsInherited;
            this.isLocalCheckBox.Checked = customizedStruct == null && _property.IsPar;
            this.isLocalCheckBox.Visible = canBePar && customizedStruct == null && !_property.IsMember;
            this.nameTextBox.Enabled = canBeEdit;
            this.arrayCheckBox.Enabled = canBeEdit || _property.IsChangeableType;
            this.typeComboBox.Enabled = canBeEdit || _property.IsChangeableType;
            this.isStaticCheckBox.Enabled = canBeEdit;
            this.isConstcheckBox.Enabled = canBeEdit;
            this.dispTextBox.Enabled = canBeEdit;
            this.descTextBox.Enabled = canBeEdit;

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

示例7: InspectObject

        public void InspectObject(AgentType agentType, string agentFullname) {
            _agentFullname = agentFullname;

            preLayout();

            deleteAllRowControls();

            if (agentType != null) {
                IList<PropertyDef> properties = agentType.GetProperties();
                foreach(PropertyDef p in properties) {
                    if (!p.IsAddedAutomatically) {
                        addRowControl(p);
                    }
                }
            }

            postLayout();
        }
开发者ID:pjkui,项目名称:behaviac,代码行数:18,代码来源:ParametersPanel.cs

示例8: LoadCustomMembers

        private static void LoadCustomMembers(List<Nodes.Node.ErrorCheck> result, XmlNode rootNode)
        {
            if (rootNode == null)
            { return; }

            // Set the default base agent.
            if (Plugin.AgentTypes.Count == 0) {
                AgentType agent = new AgentType(typeof(Agent), "Agent", false, "Agent", "");
                Plugin.AgentTypes.Add(agent);
            }

            foreach(XmlNode xmlNode in rootNode.ChildNodes) {
                if (xmlNode.Name == "agent") {
                    string agentName = GetAttribute(xmlNode, "type");
                    string agentBase = GetAttribute(xmlNode, "base");
                    int baseIndex = -1;

                    for (int i = 0; i < Plugin.AgentTypes.Count; ++i) {
                        if (Plugin.AgentTypes[i].AgentTypeName == agentBase) {
                            baseIndex = i;
                            break;
                        }
                    }

                    string agentDisp = GetAttribute(xmlNode, "disp");
                    string agentDesc = GetAttribute(xmlNode, "desc");

                    if (string.IsNullOrEmpty(agentDisp))
                    { agentDisp = agentName; }

                    AgentType agent = Plugin.GetAgentType(agentName);

                    if (agent == null) {
                        agent = new AgentType(agentName, (baseIndex > -1) ? Plugin.AgentTypes[baseIndex] : null, agentDisp, agentDesc);
                        Plugin.AgentTypes.Add(agent);
                    }

                    foreach(XmlNode bbNode in xmlNode) {
                        if (bbNode.Name == "properties") {
                            foreach(XmlNode propNode in bbNode) {
                                if (propNode.Name == "property") {
                                    string propName = GetAttribute(propNode, "name");

                                    string isStatic = GetAttribute(propNode, "static");
                                    bool bStatic = false;

                                    if (!string.IsNullOrEmpty(isStatic) && isStatic == "true")
                                    { bStatic = true; }

                                    string isPublic = GetAttribute(propNode, "public");
                                    bool bPublic = false;

                                    if (string.IsNullOrEmpty(isPublic) || isPublic == "true")
                                    { bPublic = true; }

                                    string isReadonly = GetAttribute(propNode, "readonly");
                                    bool bReadonly = false;

                                    if (!string.IsNullOrEmpty(isReadonly) && isReadonly == "true")
                                    { bReadonly = true; }

                                    string propType = GetAttribute(propNode, "type");
                                    Type type = Plugin.GetTypeFromName(propType);

                                    string classname = GetAttribute(propNode, "classname");

                                    if (string.IsNullOrEmpty(classname))
                                    { classname = agent.AgentTypeName; }

                                    string propDisp = GetAttribute(propNode, "disp");

                                    if (string.IsNullOrEmpty(propDisp))
                                    { propDisp = propName; }

                                    string propDesc = GetAttribute(propNode, "desc");

                                    PropertyDef prop = new PropertyDef(agent, type, classname, propName, propDisp, propDesc);
                                    prop.IsStatic = bStatic;
                                    prop.IsPublic = bPublic;
                                    prop.IsReadonly = bReadonly;

                                    string defaultValue = GetAttribute(propNode, "defaultvalue");

                                    if (!string.IsNullOrEmpty(defaultValue)) {
                                        prop.Variable = new VariableDef(null);
                                        Plugin.InvokeTypeParser(result, type, defaultValue, (object value) => prop.Variable.Value = value, null);
                                    }

                                    agent.AddProperty(prop);
                                }
                            }

                        } else if (bbNode.Name == "methods") {
                            foreach(XmlNode methodNode in bbNode) {
                                if (methodNode.Name == "method") {
                                    string methodName = GetAttribute(methodNode, "name");
                                    Type returnType = Plugin.GetTypeFromName(GetAttribute(methodNode, "returntype"));

                                    string isStatic = GetAttribute(methodNode, "static");
                                    bool bStatic = false;
//.........这里部分代码省略.........
开发者ID:pjkui,项目名称:behaviac,代码行数:101,代码来源:Workspace.cs

示例9: agentTypeChanged

        private void agentTypeChanged(AgentType agentType) {
            //CheckErrors(_rootNode.RootBehavior, true);

            //PropertiesDock.UpdatePropertyGrids();

            this.Redraw();
        }
开发者ID:Just4F,项目名称:behaviac,代码行数:7,代码来源:BehaviorTreeView.cs

示例10: MethodDef

 public MethodDef(AgentType agentType, MemberType memberType, bool isChangeableType, bool isPublic, bool isStatic, string classname, string owner, string name, string displayName, string description, string nativeReturnType, Type returnType, bool isActionMethodOnly, List<Param> pars)
 {
     _agentType = agentType;
     _isChangeableType = isChangeableType;
     _isPublic = isPublic;
     _isStatic = isStatic;
     _classname = classname;
     _owner = owner;
     _name = name;
     _displayName = displayName;
     _description = description;
     _nativeReturnType = string.IsNullOrEmpty(nativeReturnType) ? Plugin.GetNativeTypeName(returnType) : nativeReturnType;
     _returnType = returnType;
     _isActionMethodOnly = isActionMethodOnly;
     _params = pars;
     _memberType = memberType;
     _isCustomized = (memberType == Design.MemberType.Task);
 }
开发者ID:Just4F,项目名称:behaviac,代码行数:18,代码来源:DataType.cs

示例11: ResetMembers

        public bool ResetMembers(bool check, AgentType agentType, bool clear, MethodDef method, PropertyDef property)
        {
            if (this.IsMethod && this.Method != null)
            {
                if (method != null && method.OldName == this.Method.Name)
                {
                    if (!check)
                    {
                        if (clear || this.Method.ShouldBeCleared(agentType))
                        { this.m_method = null; }

                        else
                        { this.Method.CopyFrom(method); }
                    }

                    return true;
                }

                return this.Method.ResetMembers(check, agentType, clear, method, property);

            }
            else if (this.Var != null)
            {
                return this.Var.ResetMembers(check, agentType, clear, property);
            }

            return false;
        }
开发者ID:Just4F,项目名称:behaviac,代码行数:28,代码来源:DataType.cs

示例12: ShouldBeCleared

 public bool ShouldBeCleared(AgentType agentType)
 {
     return (this.Owner == VariableDef.kSelf &&
             !Plugin.IsAgentDerived(this.AgentType.AgentTypeName, agentType.AgentTypeName));
 }
开发者ID:Just4F,项目名称:behaviac,代码行数:5,代码来源:DataType.cs

示例13: PropertyDef

 // Meta Property
 public PropertyDef(AgentType agentType, FieldInfo pi, bool isChangeableType, bool isStatic, bool isPublic, bool isProperty, bool isReadonly, string classname, string owner, string name, string nativeType, string displayName, string description)
 {
     _agentType = agentType;
     _propertyInfo = pi;
     _isChangeableType = isChangeableType;
     _isStatic = isStatic;
     _isPublic = isPublic;
     _isProperty = isProperty;
     _isReadonly = isReadonly;
     _classname = classname;
     _owner = owner;
     _name = name;
     _nativeType = nativeType;
     _displayName = displayName;
     _description = description;
 }
开发者ID:Just4F,项目名称:behaviac,代码行数:17,代码来源:DataType.cs

示例14: ResetMembers

        public override bool ResetMembers(bool check, AgentType agentType, bool clear, MethodDef method = null, PropertyDef property = null) {
            bool bReset = false;

            if (this._task != null && method != null && this._task.Name == method.OldName) {
                if (method != null && this._task.Name == method.OldName &&
                    (clear || this._task.ShouldBeCleared(agentType))) {
                    bReset = true;

                    if (!check)
                    { this._task = null; }

                } else {
                    bReset |= this._task.ResetMembers(check, agentType, clear, method, property);
                }
            }

            bReset |= base.ResetMembers(check, agentType, clear, method, property);

            return bReset;
        }
开发者ID:675492062,项目名称:behaviac,代码行数:20,代码来源:Task.cs

示例15: setText

        private void setText(AgentType agentType, string agentName) {
            // Par
            if (agentType == null) {
                Text = TabText = string.IsNullOrEmpty(agentName) ? Resources.Pars : string.Format(Resources.ParsOf, agentName);
            }

            // Global
            else if (Plugin.IsGlobalInstanceAgentType(agentType)) {
                Text = TabText = string.Format(Resources.PropertiesOf, agentType.ToString());
            }

            // Agent
            else {
                Text = TabText = string.Format(Resources.PropertiesOf + "::{1}", agentType.ToString(), agentName);
            }
        }
开发者ID:675492062,项目名称:behaviac,代码行数:16,代码来源:ParametersDock.cs


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