Fix spacing

This commit is contained in:
Oliver Booth 2022-11-30 18:25:05 +00:00
parent 5019ef94b0
commit 88483373ee
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634
22 changed files with 53 additions and 52 deletions

View File

@ -36,7 +36,6 @@ public sealed class CommandsExtension : VirtualParadiseClientExtension
/// </summary>
/// <param name="assembly">The assembly whose command modules to register.</param>
/// <exception cref="ArgumentException">
///
/// </exception>
/// <exception cref="TypeInitializationException">A command module could not be instantiated.</exception>
/// <exception cref="InvalidOperationException">

View File

@ -137,7 +137,7 @@ public abstract class VirtualParadiseObject : IEquatable<VirtualParadiseObject>
lock (Client.Lock)
{
int session = target?.Session ?? 0;
(float x, float y, float z) = (Vector3) (position ?? Vector3d.Zero);
(float x, float y, float z) = (Vector3)(position ?? Vector3d.Zero);
_ = vp_object_click(Client.NativeInstanceHandle, Id, session, x, y, z);
}
@ -154,7 +154,7 @@ public abstract class VirtualParadiseObject : IEquatable<VirtualParadiseObject>
{
lock (Client.Lock)
{
var reason = (ReasonCode) vp_object_delete(Client.NativeInstanceHandle, Id);
var reason = (ReasonCode)vp_object_delete(Client.NativeInstanceHandle, Id);
switch (reason)
{
@ -207,7 +207,7 @@ public abstract class VirtualParadiseObject : IEquatable<VirtualParadiseObject>
return false;
}
return Equals((VirtualParadiseObject) obj);
return Equals((VirtualParadiseObject)obj);
}
/// <inheritdoc />

View File

@ -70,7 +70,10 @@ public sealed class VirtualParadiseParticleEmitterObjectBuilder : VirtualParadis
/// <summary>
/// Gets or sets a value indicating whether this emitter interpolates its values.
/// </summary>
/// <value><see langword="true" /> if this emitter interpolates its values; otherwise, <see langword="false" />, or <see langword="null" /> to leave unchanged.</value>
/// <value>
/// <see langword="true" /> if this emitter interpolates its values; otherwise, <see langword="false" />, or
/// <see langword="null" /> to leave unchanged.
/// </value>
[SerializationKey("interpolate")]
[ValueConverter(typeof(IntToBoolConverter))]
public bool? Interpolate { get; set; }
@ -473,4 +476,4 @@ public sealed class VirtualParadiseParticleEmitterObjectBuilder : VirtualParadis
Texture = value;
return this;
}
}
}

View File

@ -42,4 +42,4 @@ public sealed class VirtualParadisePath : ICloneable
{
return new VirtualParadisePath(Easing, Name, Points, IsClosed);
}
}
}

View File

@ -159,4 +159,4 @@ public sealed class VirtualParadisePathObject : VirtualParadiseObject
Path = new VirtualParadisePath((PathEasing)pathType, name, points, closed == 1);
}
}
}

View File

@ -131,7 +131,7 @@ public sealed class VirtualParadiseUser : IEquatable<VirtualParadiseUser>
if (_client.CurrentAvatar is not { } avatar)
{
ThrowHelper.ThrowNotInWorldException();
return (InviteResponse) (-1);
return (InviteResponse)(-1);
}
location ??= avatar.Location;
@ -209,8 +209,8 @@ public sealed class VirtualParadiseUser : IEquatable<VirtualParadiseUser>
y = vp_double(handle, FloatAttribute.JoinY);
z = vp_double(handle, FloatAttribute.JoinZ);
yaw = (float) vp_double(handle, FloatAttribute.JoinYaw);
pitch = (float) vp_double(handle, FloatAttribute.JoinPitch);
yaw = (float)vp_double(handle, FloatAttribute.JoinYaw);
pitch = (float)vp_double(handle, FloatAttribute.JoinPitch);
worldName = vp_string(handle, StringAttribute.JoinWorld);
}

View File

@ -30,7 +30,7 @@ internal sealed class Connection : IDisposable
public int Connect(string host, ushort port)
{
_socket.BeginConnect(host, port, ConnectCallback, this);
return (int) NetworkReturnCode.Success;
return (int)NetworkReturnCode.Success;
}
public void Dispose()
@ -120,10 +120,10 @@ internal sealed class Connection : IDisposable
{
if (_readyBuffers.Count == 0)
{
return (int) NetworkReturnCode.WouldBlock;
return (int)NetworkReturnCode.WouldBlock;
}
var spaceLeft = (int) length;
var spaceLeft = (int)length;
nint destination = data;
int i;
@ -148,7 +148,7 @@ internal sealed class Connection : IDisposable
_readyBuffers.RemoveRange(0, i);
return (int) (length - spaceLeft);
return (int)(length - spaceLeft);
}
private static void ReceiveCallback(IAsyncResult ar)
@ -218,7 +218,7 @@ internal sealed class Connection : IDisposable
public int Send(nint data, uint length)
{
var buffer = new byte[length];
Marshal.Copy(data, buffer, 0, (int) length);
Marshal.Copy(data, buffer, 0, (int)length);
try
{
return _socket.Send(buffer);

View File

@ -1,4 +1,4 @@
namespace VpSharp.Internal;
namespace VpSharp.Internal;
internal enum ReasonCode
{
@ -45,7 +45,7 @@ internal enum ReasonCode
WorldLoginError,
/// <summary>
/// A world request was made while not being connected to a world server.
/// A world request was made while not being connected to a world server.
/// </summary>
NotInWorld,
@ -86,12 +86,12 @@ internal enum ReasonCode
NoSuchUser,
/// <summary>
/// Timeout
/// Timeout
/// </summary>
Timeout,
/// <summary>
/// The instance is not connected to a universe.
/// The instance is not connected to a universe.
/// </summary>
NotInUniverse,

View File

@ -22,7 +22,7 @@ internal abstract class ValueConverter<T> : ValueConverter
/// <inheritdoc />
public override void Serialize(TextWriter writer, object value)
{
Serialize(writer, (T) value);
Serialize(writer, (T)value);
}
public abstract void Deserialize(TextReader reader, out T result);

View File

@ -1,4 +1,4 @@
using System.Numerics;
using System.Numerics;
using Cysharp.Text;
using VpSharp.Extensions;
@ -18,7 +18,7 @@ internal sealed class Vector2Converter : ValueConverter<Vector2>
{
int readChar = reader.Read();
var currentChar = (char) readChar;
var currentChar = (char)readChar;
if (currentChar == ' ')
{
spaceCount++;

View File

@ -1,4 +1,4 @@
using System.Numerics;
using System.Numerics;
using Cysharp.Text;
using VpSharp.Extensions;
@ -18,7 +18,7 @@ internal sealed class Vector3Converter : ValueConverter<Vector3>
{
int readChar = reader.Read();
var currentChar = (char) readChar;
var currentChar = (char)readChar;
if (currentChar == ' ')
{
spaceCount++;

View File

@ -1,4 +1,4 @@
using Cysharp.Text;
using Cysharp.Text;
using VpSharp.Extensions;
namespace VpSharp.Internal.ValueConverters;
@ -17,7 +17,7 @@ internal sealed class Vector3ToColorConverter : ValueConverter<ColorF>
{
int readChar = reader.Read();
var currentChar = (char) readChar;
var currentChar = (char)readChar;
if (currentChar == ' ')
{
spaceCount++;

View File

@ -1,4 +1,4 @@
using Cysharp.Text;
using Cysharp.Text;
using VpSharp.Extensions;
namespace VpSharp.Internal.ValueConverters;
@ -17,7 +17,7 @@ internal sealed class Vector3dConverter : ValueConverter<Vector3d>
{
int readChar = reader.Read();
var currentChar = (char) readChar;
var currentChar = (char)readChar;
if (currentChar == ' ')
{
spaceCount++;

View File

@ -1,4 +1,4 @@
using Cysharp.Text;
using Cysharp.Text;
using VpSharp.Extensions;
namespace VpSharp.Internal.ValueConverters;
@ -17,7 +17,7 @@ internal sealed class Vector4ToColorConverter : ValueConverter<ColorF>
{
int readChar = reader.Read();
var currentChar = (char) readChar;
var currentChar = (char)readChar;
if (currentChar == ' ')
{
spaceCount++;

View File

@ -1,4 +1,4 @@
using System.Numerics;
using System.Numerics;
using Cysharp.Text;
using VpSharp.Extensions;
@ -18,7 +18,7 @@ internal sealed class Vector4ToVector3Converter : ValueConverter<Vector3>
{
int readChar = reader.Read();
var currentChar = (char) readChar;
var currentChar = (char)readChar;
if (currentChar == ' ')
{
spaceCount++;

View File

@ -1,4 +1,4 @@
using Cysharp.Text;
using Cysharp.Text;
using VpSharp.Extensions;
namespace VpSharp.Internal.ValueConverters;
@ -30,7 +30,7 @@ internal sealed class VectorToNthComponentConverter : ValueConverter<float>
break;
}
var currentChar = (char) readChar;
var currentChar = (char)readChar;
if (currentChar == ' ')
{
spaceCount++;

View File

@ -9,7 +9,7 @@ namespace VpSharp;
/// <summary>
/// Represents a vector with three double-precision floating-point values. This structure very closely resembles the API
/// provided by <see cref="Vector3" />, however its components and the mathematical operations performed on them use
/// <see cref="double" /> arithmetic.
/// <see cref="double" /> arithmetic.
/// </summary>
public struct Vector3d : IEquatable<Vector3d>, IFormattable
{

View File

@ -1,4 +1,4 @@
using System.Collections.Concurrent;
using System.Collections.Concurrent;
using System.Numerics;
using VpSharp.Entities;
using VpSharp.Internal.NativeAttributes;
@ -45,8 +45,8 @@ public sealed partial class VirtualParadiseClient
double x = vp_double(sender, FloatAttribute.AvatarX);
double y = vp_double(sender, FloatAttribute.AvatarY);
double z = vp_double(sender, FloatAttribute.AvatarZ);
var pitch = (float) vp_double(sender, FloatAttribute.AvatarPitch);
var yaw = (float) vp_double(sender, FloatAttribute.AvatarYaw);
var pitch = (float)vp_double(sender, FloatAttribute.AvatarPitch);
var yaw = (float)vp_double(sender, FloatAttribute.AvatarYaw);
var position = new Vector3d(x, y, z);
var rotation = Quaternion.CreateFromYawPitchRoll(yaw, pitch, 0);

View File

@ -15,7 +15,7 @@ public sealed partial class VirtualParadiseClient
private void Initialize()
{
var reason = (ReasonCode) Native.vp_init();
var reason = (ReasonCode)Native.vp_init();
if (reason == ReasonCode.VersionMismatch)
{
throw new VersionMismatchException();

View File

@ -1,4 +1,4 @@
using System.Collections.Concurrent;
using System.Collections.Concurrent;
using System.Drawing;
using System.Numerics;
using System.Threading.Channels;
@ -71,7 +71,7 @@ public sealed partial class VirtualParadiseClient
int g = vp_int(sender, IntegerAttribute.ChatColorGreen);
int b = vp_int(sender, IntegerAttribute.ChatColorBlue);
color = Color.FromArgb(r, g, b);
style = (FontStyle) vp_int(sender, IntegerAttribute.ChatEffects);
style = (FontStyle)vp_int(sender, IntegerAttribute.ChatEffects);
}
VirtualParadiseAvatar? avatar = GetAvatar(session);
@ -80,7 +80,7 @@ public sealed partial class VirtualParadiseClient
var args = new MessageReceivedEventArgs(message);
RaiseEvent(MessageReceived, args);
foreach (VirtualParadiseClientExtension extension in _extensions)
{
extension.OnMessageReceived(args);
@ -114,8 +114,8 @@ public sealed partial class VirtualParadiseClient
double z = vp_double(sender, FloatAttribute.AvatarZ);
position = new Vector3d(x, y, z);
var pitch = (float) vp_double(sender, FloatAttribute.AvatarPitch);
var yaw = (float) vp_double(sender, FloatAttribute.AvatarYaw);
var pitch = (float)vp_double(sender, FloatAttribute.AvatarPitch);
var yaw = (float)vp_double(sender, FloatAttribute.AvatarYaw);
rotation = Quaternion.CreateFromYawPitchRoll(yaw, pitch, 0);
}
@ -325,7 +325,7 @@ public sealed partial class VirtualParadiseClient
DisconnectReason reason;
lock (Lock)
{
reason = (DisconnectReason) vp_int(sender, IntegerAttribute.DisconnectErrorCode);
reason = (DisconnectReason)vp_int(sender, IntegerAttribute.DisconnectErrorCode);
}
var args = new DisconnectedEventArgs(reason);
@ -337,7 +337,7 @@ public sealed partial class VirtualParadiseClient
DisconnectReason reason;
lock (Lock)
{
reason = (DisconnectReason) vp_int(sender, IntegerAttribute.DisconnectErrorCode);
reason = (DisconnectReason)vp_int(sender, IntegerAttribute.DisconnectErrorCode);
}
var args = new DisconnectedEventArgs(reason);
@ -474,7 +474,7 @@ public sealed partial class VirtualParadiseClient
{
session = vp_int(sender, IntegerAttribute.AvatarSession);
url = vp_string(sender, StringAttribute.Url);
target = (UriTarget) vp_int(sender, IntegerAttribute.UrlTarget);
target = (UriTarget)vp_int(sender, IntegerAttribute.UrlTarget);
}
if (!Uri.IsWellFormedUriString(url, UriKind.Absolute))
@ -544,8 +544,8 @@ public sealed partial class VirtualParadiseClient
double y = vp_double(sender, FloatAttribute.InviteY);
double z = vp_double(sender, FloatAttribute.InviteZ);
var yaw = (float) vp_double(sender, FloatAttribute.InviteYaw);
var pitch = (float) vp_double(sender, FloatAttribute.InvitePitch);
var yaw = (float)vp_double(sender, FloatAttribute.InviteYaw);
var pitch = (float)vp_double(sender, FloatAttribute.InvitePitch);
position = new Vector3d(x, y, z);
rotation = Quaternion.CreateFromYawPitchRoll(yaw, pitch, 0);

View File

@ -148,7 +148,7 @@ public sealed partial class VirtualParadiseClient
private async Task<VirtualParadiseObject> ExtractObjectAsync(nint sender)
{
var type = (ObjectType) vp_int(sender, IntegerAttribute.ObjectType);
var type = (ObjectType)vp_int(sender, IntegerAttribute.ObjectType);
int id = vp_int(sender, IntegerAttribute.ObjectId);
int owner = vp_int(sender, IntegerAttribute.ObjectUserId);

View File

@ -184,7 +184,6 @@ public sealed partial class VirtualParadiseClient : IDisposable
ReleaseUnmanagedResources();
}
/// <summary>
/// Enters a specified world at a specified position.
/// </summary>