|
@@ -2654,6 +2654,17 @@ namespace InABox.Core
|
|
|
}
|
|
|
return to;
|
|
|
}
|
|
|
+ public static U[] ToArray<T, U>(this ICollection<T> from, Func<T, U> mapFunc)
|
|
|
+ {
|
|
|
+ var to = new U[from.Count];
|
|
|
+ var i = 0;
|
|
|
+ foreach(var item in from)
|
|
|
+ {
|
|
|
+ to[i] = mapFunc(item);
|
|
|
+ ++i;
|
|
|
+ }
|
|
|
+ return to;
|
|
|
+ }
|
|
|
|
|
|
public static List<U> ToList<T, U>(this IList<T> from, Func<T, U> mapFunc)
|
|
|
{
|