Module source

Module source 

Source

Structs§

ChunkLoadRequest
This structure is constructed by levels and passed to LevelSource when requesting for chunk loading, the chunk must be constructed from the given data.
ChunkSaveRequest
LoadOrGenLevelSource
A load or generate LevelSource variant.
NullLevelSource
Dummy chunk loader which do nothing.
ProtoChunk
A temporary chunk structure used to add entity builders that will be added to the level’s ECS later in sync when the source actually returns it.
SuperFlatGenerator
A primitive super-flat generator that only generate the terrain from given layers, no structure is generated.
WorkerGenLevelSource
A wrapper for LevelGenerator that implements LevelSource to provide asynchronous level generation. This wrapper dispatches incoming chunk request into the given number of worker threads.

Enums§

LevelSourceError
Common level source error.

Traits§

LevelGenerator
A trait to implement for level generators, this trait provides a synchronous method to generate a specific chunk. This trait is not valid for methods expecting a LevelSource, to do this you need to wrap it into LevelGeneratorSource, this structure will clone your generator in any given workers count and run them asynchronously.
LevelGeneratorBuilder
A trait used by LevelGeneratorSource in order to build a specific LevelGenerator in each worker thread, this allows the generator to be thread unsafe. For this specific use, this implies that this builder should be send and sync for.
LevelSource
Level loader trait to implement for each different loader such as disk or generator loaders, combine these two types of loaders to save and load change in a chunk to avoid generating twice.