Пример #1
0
        public static RakunNodeBase SumbNode(RakunNodeBase c1original, RakunModuleViewModel c2mother)
        {
            if (c2mother == null)
            {
                return(c1original.Clone() as RakunNodeBase);
            }

            RakunNodeBase c1 = c1original.Clone() as RakunNodeBase;

            RakunNodeBase c2 = c2mother.ModuleInfo.Clone() as RakunNodeBase;

            //값 대입하기
            addbefore(ref c2mother, ref c1);

            //합성하기
            //근데 IF노드일경우 조금 다름
            if (c2mother.ModuleInfo.NodeType == RakunNodeBase.RakunNodeType.If)
            {
                RakunNodeBase TResualt = new RakunNodeBase();
                {
                    //True일경우
                    RakunModuleViewModel itorNode = c2mother.TrueNode;


                    //연결된  시퀀스가 있으면
                    while (itorNode != null)
                    {
                        addbefore(ref itorNode, ref TResualt);
                        //다더함
                        TResualt = (TResualt + itorNode.ModuleInfo).Clone() as RakunNodeBase;
                        addAfter(ref itorNode, ref TResualt);
                        itorNode = itorNode.Next;
                    }
                }

                RakunNodeBase FResualt = new RakunNodeBase();
                {
                    RakunModuleViewModel itorNode = c2mother.FalseNode;

                    //연결된  시퀀스가 있으면
                    while (itorNode != null)
                    {
                        addbefore(ref itorNode, ref FResualt);
                        //다더함
                        FResualt = (FResualt + itorNode.ModuleInfo).Clone() as RakunNodeBase;
                        addAfter(ref itorNode, ref FResualt);
                        itorNode = itorNode.Next;
                    }
                }

                RakunNodeIf ifnode = c2 as RakunNodeIf;
                ifnode.AddIfTrue(TResualt, FResualt);
            }

            //값 대입하기
            addAfter(ref c2mother, ref c2);

            return(c1 + c2);
        }
Пример #2
0
        public static void addbefore(ref RakunModuleViewModel c2mother, ref RakunNodeBase c1)
        {
            foreach (RakunValueNodeViewModel node in c2mother.ModuleValues)
            {
                if (node.Input == null)
                {
                    continue;
                }

                if (node.Input.BeforePoint == null)
                {
                    continue;
                }

                RakunValueNodeViewModel ParentNode = node.Input.BeforePoint.ParentVM;

                if (ParentNode == null)
                {
                    if (node.Input.BeforePoint != null)
                    {
                        RakunModuleViewModel ParentNodeVM = node.Input.BeforePoint.ModuleVM;

                        RakunNodeInput inputf = Workspace.This.RakunManager.inputNode.Clone() as RakunNodeInput;

                        inputf.rootNode.replace(inputf.rootNode.loopfunction, "NUMBER", ParentNodeVM.input);
                        inputf.rootNode.replace(inputf.rootNode.loopfunction, "INPUTVALUE", node.ChangedName);
                        c1 = c1 + inputf;

                        //node.Input.BeforePoint.
                    }
                    continue;
                }


                RakunNodeInput input = Workspace.This.RakunManager.inputNode.Clone() as RakunNodeInput;
                input.rootNode.replace(input.rootNode.loopfunction, "NUMBER", ParentNode.ChangedName);
                input.rootNode.replace(input.rootNode.loopfunction, "INPUTVALUE", node.ChangedName);
                c1 = c1 + input;
            }
        }
Пример #3
0
 public void SetMother(RakunModuleViewModel vm)
 {
     _ModuleInfo.MotherVM = vm;
 }