Show / Hide Table of Contents

Class BoundedParallelChunkProvider

Chunk provider handling requests in parallel, using a semaphore to limit the number of simultaneous generation tasks.

Inheritance
object
BoundedParallelChunkProvider
Implements
IChunkProvider
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TerraProc.Core.Provider
Assembly: TerraProc.Core.dll
Syntax
public sealed class BoundedParallelChunkProvider : IChunkProvider

Constructors

| Edit this page View Source

BoundedParallelChunkProvider(ITerrainGenerator, int)

Chunk provider handling requests in parallel, using a semaphore to limit the number of simultaneous generation tasks.

Declaration
public BoundedParallelChunkProvider(ITerrainGenerator generator, int maxThreads)
Parameters
Type Name Description
ITerrainGenerator generator

Terrain generator to use for generating chunks.

int maxThreads

Maximum number of parallel generation tasks.

Methods

| Edit this page View Source

GetAsync(ChunkCoords, CancellationToken)

Gets the chunk data for the specified coordinates while respecting the parallelism limit.

Declaration
public Task<ChunkData> GetAsync(ChunkCoords coords, CancellationToken ct = default)
Parameters
Type Name Description
ChunkCoords coords

Coordinates of the chunk to retrieve.

CancellationToken ct

Cancellation token to cancel the operation.

Returns
Type Description
Task<ChunkData>

Chunk data.

Implements

IChunkProvider
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX