Empeld
Empeld plugin documentation.
pluginbase.Objects.World.WorldHelpersAsync Class Reference

Static Public Member Functions

static TaskAwaiter< IBlockGetAwaiter (this IWorldReadonlyBlock block)
 Waits for the readonly block to be generated, and then return the IBlock More...
 
static Task GenerateAreaAsync (this IWorld world, Volume volume)
 Shorthand for waiting on a volume to generate in the world More...
 

Member Function Documentation

◆ GenerateAreaAsync()

static Task pluginbase.Objects.World.WorldHelpersAsync.GenerateAreaAsync ( this IWorld  world,
Volume  volume 
)
static

Shorthand for waiting on a volume to generate in the world

Returns
The area async.
Parameters
worldWorld.
volumeVolume.
30  {
31  return TaskEx.SpinWait(() => world.GenerateArea(volume));
32  }
static async Task SpinWait(Func< bool > until, int pollMillis=10, int timeoutMillis=-1)
Wait for a predicate to become true via polling
Definition: TaskEx.cs:15
Definition: TaskEx.cs:6

◆ GetAwaiter()

static TaskAwaiter<IBlock> pluginbase.Objects.World.WorldHelpersAsync.GetAwaiter ( this IWorldReadonlyBlock  block)
static

Waits for the readonly block to be generated, and then return the IBlock

Returns
The awaiter.
Parameters
blockBlock.
17  {
18  return TaskEx.SpinWait(() => block.Generated)
19  .ContinueWith((x) => block.Block)
20  .GetAwaiter();
21  }
static async Task SpinWait(Func< bool > until, int pollMillis=10, int timeoutMillis=-1)
Wait for a predicate to become true via polling
Definition: TaskEx.cs:15
Definition: TaskEx.cs:6

The documentation for this class was generated from the following file: