Ejemplo n.º 1
0
 public virtual void CheckForErrors(Behaviac.Design.Nodes.BehaviorNode rootBehavior, List <Behaviac.Design.Nodes.Node.ErrorCheck> result)
 {
     if (!this.IsPrecondition && !this.IsEffector)
     {
         //flagStr = "event";
     }
     else if (this.IsPrecondition)
     {
         //flagStr = "precondition";
         if (this.IsEffector)
         {
             result.Add(new Nodes.Node.ErrorCheck(this.Node, this.Id, this.Label, Nodes.ErrorCheckLevel.Error, "the attachment can only be a Precondition or an Effector!"));
         }
     }
     else if (this.IsEffector)
     {
         //flagStr = "effector";
         if (this.IsPrecondition)
         {
             result.Add(new Nodes.Node.ErrorCheck(this.Node, this.Id, this.Label, Nodes.ErrorCheckLevel.Error, "the attachment can only be a Precondition or an Effector!"));
         }
     }
     else
     {
         Debug.Check(false);
     }
 }
Ejemplo n.º 2
0
        private List <ParInfo> getPars()
        {
            List <ParInfo> pars = new List <ParInfo>();

            Nodes.Node             node   = _object as Nodes.Node;
            Attachments.Attachment attach = _object as Attachments.Attachment;

            if (node != null || attach != null || this._root != null)
            {
                Behaviac.Design.Nodes.BehaviorNode bn = (node != null ? node.Behavior : null);
                if (bn == null)
                {
                    bn = (attach != null ? attach.Behavior : null);
                }
                if (bn == null && this._root != null)
                {
                    bn = this._root.Behavior;
                }

                List <ParInfo> allPars = new List <ParInfo>();
                ((Nodes.Node)bn).GetAllPars(ref allPars);
                foreach (ParInfo par in allPars)
                {
                    if (!string.IsNullOrEmpty(par.Name))
                    {
                        if (Plugin.IsCompatibleType(FilterType, par.Type))
                        {
                            pars.Add(par);
                        }
                    }
                }
            }

            return(pars);
        }
Ejemplo n.º 3
0
        public override NodeViewData CreateNodeViewData(NodeViewData parent, Behaviac.Design.Nodes.BehaviorNode rootBehavior)
        {
            NodeViewDataStyled nvd = new NodeViewDataStyled(parent, rootBehavior, this, null, __defaultBackgroundBrush, _label, _description);

            nvd.ChangeShape(NodeShape.Rectangle);

            return(nvd);
        }
Ejemplo n.º 4
0
        public override void CheckForErrors(Behaviac.Design.Nodes.BehaviorNode rootBehavior, List <ErrorCheck> result)
        {
            if (_condition.Child == null)
            {
                result.Add(new Behaviac.Design.Nodes.Node.ErrorCheck(this, Behaviac.Design.Nodes.ErrorCheckLevel.Error,
                                                                     "You have to specify the condition"));
            }

            if (_if.Child == null)
            {
                result.Add(new Behaviac.Design.Nodes.Node.ErrorCheck(this, Behaviac.Design.Nodes.ErrorCheckLevel.Error,
                                                                     "'If' is not specified"));
            }

            if (_else.Child == null)
            {
                result.Add(new Behaviac.Design.Nodes.Node.ErrorCheck(this, Behaviac.Design.Nodes.ErrorCheckLevel.Error,
                                                                     "'Else' is not specified"));
            }

            base.CheckForErrors(rootBehavior, result);
        }
Ejemplo n.º 5
0
 void RootNode_WasSaved(Behaviac.Design.Nodes.BehaviorNode node)
 {
     Text = TabText = ((Nodes.Node)node).Label;
 }
Ejemplo n.º 6
0
 public virtual void CheckForErrors(Behaviac.Design.Nodes.BehaviorNode rootBehavior, List <Behaviac.Design.Nodes.Node.ErrorCheck> result)
 {
 }