示例#1
0
        public override bool AddChild(Connector connector, Node node, int index)
        {
            if (node is DecoratorWeight)
            {
                return base.AddChild(connector, node, index);
            }
            else
            {
                DecoratorWeight weightNode = new DecoratorWeight();
                if (base.AddChild(connector, weightNode, index))
                {
                    bool add = weightNode.AddChild(weightNode.GetConnector(connector.Identifier), node);
                    weightNode.ResetId(true);
                    return add;
                }
            }

            return false;
        }
示例#2
0
        public override bool AddChild(Connector connector, Node node, int index)
        {
            if (node is DecoratorWeight)
            {
                return(base.AddChild(connector, node, index));
            }
            else
            {
                DecoratorWeight weightNode = new DecoratorWeight();
                if (base.AddChild(connector, weightNode, index))
                {
                    bool add = weightNode.AddChild(weightNode.GetConnector(connector.Identifier), node);
                    weightNode.ResetId(true);
                    return(add);
                }
            }

            return(false);
        }