Skip to main content

Array2dGenerationHelper

A static class in Root.Township, Alta.Forests.

Helpers that split forest generation work into parallel Task.Run jobs, by row or by square segment of a 2D array.

Methods​

MemberWhat it is
static async Task ThreadRows<TContext>(TContext context, Random random, int rows, Array2dGenerationHelper.ThreadRowsAction<TContext> operation)Runs the operation in parallel, once per row or per segment (up to maxSegment cells square), each with its own seeded Random, and awaits all.
static async Task ThreadRows<TContext, T, TData>(TContext context, Random random, T[,] values, TData data, Array2dGenerationHelper.ThreadRowsAction<TContext, T, TData> operation, int maxSegment = 64)Runs the operation in parallel, once per row or per segment (up to maxSegment cells square), each with its own seeded Random, and awaits all.
static async Task ThreadRows(Random random, int rows, Array2dGenerationHelper.ThreadRowsAction operation)Runs the operation in parallel, once per row or per segment (up to maxSegment cells square), each with its own seeded Random, and awaits all.
static async Task ThreadRows<T, TData>(Random random, T[,] values, TData data, Array2dGenerationHelper.ThreadRowsAction<T, TData> operation, int maxSegment = 64)Runs the operation in parallel, once per row or per segment (up to maxSegment cells square), each with its own seeded Random, and awaits all.