We now have a context menu UI for in-game actions, right click on an item to activate Database view has a progress bar (finally!) Data structures for Megacorps and loadouts Towing task complete? needs testing
38 lines
No EOL
1 KiB
C#
38 lines
No EOL
1 KiB
C#
#if !(UNITY_4 || UNITY_5)
|
|
using System;
|
|
using System.Collections.Concurrent;
|
|
|
|
|
|
namespace JM.LinqFaster.Utils
|
|
{
|
|
internal static class CustomPartition
|
|
{
|
|
public static OrderablePartitioner<Tuple<int,int>> MakePartition(int len, int? batchSize)
|
|
{
|
|
if (batchSize == null)
|
|
{
|
|
return Partitioner.Create(0, len);
|
|
}
|
|
else
|
|
{
|
|
return Partitioner.Create(0, len, batchSize.Value);
|
|
}
|
|
}
|
|
|
|
public static OrderablePartitioner<Tuple<int, int>> MakeSIMDPartition(int len, int chunkSize, int? batchSize)
|
|
{
|
|
int chunkLen = len - len % chunkSize;
|
|
int numChunks = chunkLen / chunkSize;
|
|
if (batchSize == null)
|
|
{
|
|
return Partitioner.Create(0, numChunks,numChunks/Environment.ProcessorCount);
|
|
}
|
|
else
|
|
{
|
|
return Partitioner.Create(0, numChunks, batchSize.Value);
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
#endif |