예제 #1
0
 private void OnDestroy()
 {
     if (Instance == this)
     {
         Instance = null;
     }
 }
예제 #2
0
        public override IList <string> GetColumns()
        {
            var safeGetColumns = new Func <string, IList <string> >(nodeId =>
            {
                if (InputDict.ContainsKey(nodeId))
                {
                    return(InputDict[nodeId].GetColumns());
                }
                else
                {
                    return(new List <string>());
                }
            });

            var columnLists = Inputs.Select(i => safeGetColumns(i));

            if (columnLists.Any())
            {
                if (IncludeUniqueColumns)
                {
                    // build a full column list from all inputs
                    return(columnLists.Aggregate((x, y) => new List <string>(new HashSet <string>(x).Union(y))));
                }
                else
                {
                    // build an intersection of the column lists from all inputs
                    return(columnLists.Aggregate((x, y) => new List <string>(new HashSet <string>(x).Intersect(y))));
                }
            }
            else
            {
                return(new List <string>());
            }
        }
예제 #3
0
 private void Awake()
 {
     if (Instance)
     {
         Debug.LogWarning("InputDict already in scene. Deleting myself!");
         Destroy(this);
         return;
     }
     Instance = this;
 }
예제 #4
0
        public override IList <string> GetColumnTypes()
        {
            if (Inputs.All(i => InputDict.ContainsKey(i)))
            {
                var input1 = InputDict[Inputs[0]];
                var input2 = InputDict[Inputs[1]];

                var result = new List <string>();
                result.AddRange(input1.GetColumnTypes().Select(c => c));
                result.AddRange(input2.GetColumnTypes().Select(c => c));
                return(result);
            }
            else
            {
                return(new List <string>());
            }
        }
예제 #5
0
        public override IList <string> GetColumnTypes()
        {
            if (InputDict.Any())
            {
                var input1         = InputDict[Inputs[0]];
                var input1ColTypes = input1.GetColumnTypes();
                var newColType     = "VARCHAR";

                if (!IsDateType(input1ColTypes[InputColumnIndex]))
                {
                    newColType = input1ColTypes[InputColumnIndex];
                }

                var baseColTypes = new List <string>();
                baseColTypes.AddRange(input1ColTypes.Select(ct => ct));  // Copy values
                baseColTypes.Add(newColType);
                return(baseColTypes);
            }
            return(new List <string>());
        }
예제 #6
0
 void Start()
 {
     inp = InputDict.Instance;
 }