mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-09 23:15:41 +00:00
Add binding for avatar-specific world settings
This commit is contained in:
parent
6ba4569fca
commit
3b4c705d7d
@ -287,6 +287,23 @@ public sealed class VirtualParadiseAvatar : IEquatable<VirtualParadiseAvatar>
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Modifies the world settings for this avatar.
|
||||
/// </summary>
|
||||
/// <param name="action">The builder which defines parameters to change.</param>
|
||||
/// <exception cref="ArgumentNullException"><paramref name="action" /> is <see langword="null" />.</exception>
|
||||
/// <exception cref="UnauthorizedAccessException">The client does not have permission to modify world settings.</exception>
|
||||
public async Task SendWorldSettings(Action<WorldSettingsBuilder> action)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(action);
|
||||
|
||||
// ReSharper disable once InconsistentlySynchronizedField
|
||||
var builder = new WorldSettingsBuilder(_client, Session);
|
||||
await Task.Run(() => action(builder)).ConfigureAwait(false);
|
||||
|
||||
builder.SendChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Teleports the avatar to another world.
|
||||
/// </summary>
|
||||
|
Loading…
Reference in New Issue
Block a user