mysimulation/server/tso.common/Utils/LinqUtils.cs
Tony Bark 22191ce648 Removed NioTSO client and server
- NioTSO client isn't needed because we're using RayLib
- Added FreeSO's API server to handle most backend operations
2024-05-01 02:55:43 -04:00

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));
}
}
}