Exemplo n.º 1
0
 public static void AddStringValues(this TableBuilder tb, string name, IEnumerable <string> vals)
 {
     if (tb.StringColumns.ContainsKey(name))
     {
         tb.StringColumns[name] = tb.StringColumns[name].Concat(vals).ToArray();
     }
     else
     {
         tb.StringColumns.Add(name, Enumerable.Repeat("", tb.NumRows).Concat(vals).ToArray());
     }
 }
Exemplo n.º 2
0
        public static void AddIndexValues(this TableBuilder tb, string name, IEnumerable <int> vals, Dictionary <string, int> originalEntityCounts)
        {
            var tableName = DocumentExtensions.GetRelatedTableNameFromColumnName(name);
            var offset    = 0;

            if (originalEntityCounts.ContainsKey(name))
            {
                offset = originalEntityCounts[name];
            }
            var offsetVals = vals.Select(v => v + offset);

            if (tb.IndexColumns.ContainsKey(name))
            {
                tb.IndexColumns[name] = tb.IndexColumns[name].Concat(offsetVals).ToArray();
            }
            else
            {
                tb.IndexColumns.Add(name, Enumerable.Repeat(-1, tb.NumRows).Concat(offsetVals).ToArray());
            }
        }
Exemplo n.º 3
0
 public static TableBuilder AddRelation(this TableBuilder tb, IEnumerable <int> values, string tableName, string fieldName)
 => tb.AddIndexColumn(tableName, fieldName, values);
Exemplo n.º 4
0
 public static TableBuilder AddField(this TableBuilder tb, IEnumerable <bool> values, string name)
 => tb.AddColumn(name, values);
Exemplo n.º 5
0
 public static TableBuilder AddField(this TableBuilder tb, IEnumerable <string> values, string name)
 => tb.AddColumn(name, values.ToArray());
Exemplo n.º 6
0
 public static TableBuilder AddField(this TableBuilder tb, IEnumerable <AABox> values, string name)
 => tb.AddField(values.Select(x => x.Min), name + ".Min")
 .AddField(values.Select(x => x.Max), name + ".Max");
Exemplo n.º 7
0
 public static TableBuilder AddField(this TableBuilder tb, IEnumerable <DVector3> values, string name)
 => tb.AddField(values.Select(x => x.X), name + ".X")
 .AddField(values.Select(x => x.Y), name + ".Y")
 .AddField(values.Select(x => x.Z), name + ".Z");