예제 #1
0
 public DSNode(int id, Vector2 position, DataSimulator ds)
 {
     this.ds  = ds;
     this.id  = id;
     rect     = new Rect(position.x, position.y, 50, 25);
     title    = "Start";
     nodeType = DSNodeType.Start;
     outPoint = new DSConnectionPoint(id, DSConnectionPointType.Out, ds);
 }
예제 #2
0
        public void addNode(DSNodeType nodeType, Vector2 position)
        {
            switch (nodeType)
            {
            case DSNodeType.Start:
                _nodes.Add(new DSNode(idCount, position, this));
                break;

            case DSNodeType.IntCal:
                _nodes.Add(new DSIntCalNode(idCount, position, this));
                break;

            case DSNodeType.FloatCal:
                _nodes.Add(new DSFloatCalNode(idCount, position, this));
                break;

            case DSNodeType.FloatToInt:
                _nodes.Add(new DSFloatToIntNode(idCount, position, this));
                break;

            case DSNodeType.IntToFloat:
                _nodes.Add(new DSIntToFloatNode(idCount, position, this));
                break;

            case DSNodeType.SetValue:
                _nodes.Add(new DSSetValueNode(idCount, position, this));
                break;

            case DSNodeType.Output:
                _nodes.Add(new DSOutputNode(idCount, position, this));
                break;

            case DSNodeType.IfStatement:
                _nodes.Add(new DSIfNode(idCount, position, this));
                break;
            }
            idCount += 1;
        }