예제 #1
0
        public void AddItem()
        {
            var newInput = new InputProcedural();

            //newInput.Pos = new Vector2L(Pos.x, Pos.y + 35 * Inputs.Count); //TODO: refactor
            Inputs.Add(newInput);
            //nodeHandler.OnRequireNoodleRefresh?.Invoke();
            OnValueChanged?.Invoke();
        }
예제 #2
0
        public void MoveDown(InputProcedural input)
        {
            int index = Inputs.IndexOf(input);

            if (index < Inputs.Count - 1)
            {
                Inputs[index]     = Inputs[index + 1];
                Inputs[index + 1] = input;
                //(Inputs[index].Pos, Inputs[index + 1].Pos) = (Inputs[index + 1].Pos, Inputs[index].Pos);
                //nodeHandler.OnRequireNoodleRefresh?.Invoke();
                OnValueChanged?.Invoke();
            }
        }
예제 #3
0
        //[JSInvokable]
        //public void DropNodeJS(long xPos, long yPos)
        //{
        //    if (CurDragType == DragType.Node)
        //    {
        //        //NodeToDrag?.MoveBy(xPos, yPos);
        //        Console.WriteLine("Drop from JS: " + xPos + ", " + yPos);
        //        NodeToDrag.Pos = new Vector2L(xPos, yPos);
        //        nodeHandler.OnNodeCountChanged();
        //    }
        //    TempNoodle.Enabled = false;
        //    TempNoodle.Valid = false;
        //    NodeToDrag = null;
        //    CurDragType = DragType.None;
        //}

        public void OnDropNoodle(InputProcedural nodeInput)
        {
            Console.WriteLine("OnDropNoodle");
            if (CurDragType == DragType.Node || NodeToDrag.NodeInputs.Contains(nodeInput))
            {
                Console.WriteLine("Can't drop here!");
                NodeToDrag = null;
                return;
            }
            nodeInput.InputNode = NodeToDrag;
            NodeToDrag          = null;
            //NoodleEnd = null;
        }
예제 #4
0
        public void MoveUp(InputProcedural input)
        {
            //var temp = input;
            int index = Inputs.IndexOf(input);

            if (index > 0)
            {
                Inputs[index]     = Inputs[index - 1];
                Inputs[index - 1] = input;
                //(Inputs[index].Pos, Inputs[index - 1].Pos) = (Inputs[index - 1].Pos, Inputs[index].Pos);
                //nodeHandler.OnRequireNoodleRefresh?.Invoke();
                OnValueChanged?.Invoke();
            }
        }
예제 #5
0
 public void OnDropNoodle(InputProcedural nodeInput)
 {
     Console.WriteLine("OnDropNoodle");
     //TODO: Properly check for cyclic dependencies
     if (CurDragType != DragType.Noodle || NodeToDrag.GetInputsRecursive().Contains(nodeInput))
     {
         Console.WriteLine("Can't drop here!");
         NodeToDrag = null;
         return;
     }
     nodeInput.InputNode = NodeToDrag;
     NodeToDrag          = null;
     //NoodleEnd = null;
 }
예제 #6
0
 public void RemoveItem(InputProcedural item)
 {
     Inputs.Remove(item);
     //nodeHandler.OnRequireNoodleRefresh?.Invoke();
     OnValueChanged?.Invoke();
 }