mirror of
https://github.com/simtactics/mysimulation.git
synced 2025-03-15 14:51:21 +00:00
- NioTSO client isn't needed because we're using RayLib - Added FreeSO's API server to handle most backend operations
15 lines
443 B
C#
Executable file
15 lines
443 B
C#
Executable file
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace FSO.Common.Utils
|
|
{
|
|
public static class LinqUtils
|
|
{
|
|
public static IEnumerable<IEnumerable<T>> Batch<T>(this IEnumerable<T> items, int maxItems)
|
|
{
|
|
return items.Select((item, index) => new { item, index })
|
|
.GroupBy(x => x.index / maxItems)
|
|
.Select(g => g.Select(x => x.item));
|
|
}
|
|
}
|
|
}
|