1
0
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:
Oliver Booth 2022-12-04 02:09:59 +00:00
parent 6ba4569fca
commit 3b4c705d7d
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634

View File

@ -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>