Add missing xmldoc

This commit is contained in:
Oliver Booth 2022-11-30 18:46:02 +00:00
parent 8bbbf170e3
commit 80679fa8c4
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634
7 changed files with 92 additions and 15 deletions

View File

@ -62,7 +62,7 @@ public sealed class CommandsExtension : VirtualParadiseClientExtension
} }
/// <summary> /// <summary>
/// Registers the command /// Registers the commands defined in the specified type.
/// </summary> /// </summary>
/// <exception cref="ArgumentException"> /// <exception cref="ArgumentException">
/// <typeparamref name="T" /> refers to a type that does not inherit <see cref="CommandModule" />. /// <typeparamref name="T" /> refers to a type that does not inherit <see cref="CommandModule" />.
@ -84,9 +84,9 @@ public sealed class CommandsExtension : VirtualParadiseClientExtension
} }
/// <summary> /// <summary>
/// Registers the command /// Registers the commands defined in the specified type.
/// </summary> /// </summary>
/// <param name="moduleType"></param> /// <param name="moduleType">The type whose command methods to register.</param>
/// <exception cref="ArgumentNullException"><paramref name="moduleType" /> is <see langword="null" />.</exception> /// <exception cref="ArgumentNullException"><paramref name="moduleType" /> is <see langword="null" />.</exception>
/// <exception cref="ArgumentException"> /// <exception cref="ArgumentException">
/// <para><paramref name="moduleType" /> refers to an <c>abstract</c> type.</para> /// <para><paramref name="moduleType" /> refers to an <c>abstract</c> type.</para>

View File

@ -1,4 +1,4 @@
using VpSharp.Internal; using VpSharp.Internal;
using VpSharp.Internal.NativeAttributes; using VpSharp.Internal.NativeAttributes;
using static VpSharp.Internal.Native; using static VpSharp.Internal.Native;
@ -10,7 +10,12 @@ namespace VpSharp.Entities;
/// </summary> /// </summary>
public class VirtualParadiseModelObject : VirtualParadiseObject public class VirtualParadiseModelObject : VirtualParadiseObject
{ {
/// <inheritdoc /> /// <summary>
/// Initializes a new instance of the <see cref="VirtualParadiseModelObject" /> class.
/// </summary>
/// <param name="client">The owning client.</param>
/// <param name="id">The object ID.</param>
/// <exception cref="ArgumentNullException"><paramref name="client" /> is <see langword="null" />.</exception>
internal VirtualParadiseModelObject(VirtualParadiseClient client, int id) internal VirtualParadiseModelObject(VirtualParadiseClient client, int id)
: base(client, id) : base(client, id)
{ {

View File

@ -10,9 +10,17 @@ using VpSharp.Internal.ValueConverters;
namespace VpSharp.Entities; namespace VpSharp.Entities;
/// <summary>
/// Represents a particle emitter object.
/// </summary>
public sealed class VirtualParadiseParticleEmitterObject : VirtualParadiseObject public sealed class VirtualParadiseParticleEmitterObject : VirtualParadiseObject
{ {
/// <inheritdoc /> /// <summary>
/// Initializes a new instance of the <see cref="VirtualParadiseParticleEmitterObject" /> class.
/// </summary>
/// <param name="client">The owning client.</param>
/// <param name="id">The object ID.</param>
/// <exception cref="ArgumentNullException"><paramref name="client" /> is <see langword="null" />.</exception>
internal VirtualParadiseParticleEmitterObject(VirtualParadiseClient client, int id) internal VirtualParadiseParticleEmitterObject(VirtualParadiseClient client, int id)
: base(client, id) : base(client, id)
{ {
@ -228,6 +236,7 @@ public sealed class VirtualParadiseParticleEmitterObject : VirtualParadiseObject
} }
} }
/// <inheritdoc />
protected override void ExtractFromData(ReadOnlySpan<byte> data) protected override void ExtractFromData(ReadOnlySpan<byte> data)
{ {
#pragma warning disable 612 #pragma warning disable 612

View File

@ -11,7 +11,12 @@ namespace VpSharp.Entities;
/// </summary> /// </summary>
public sealed class VirtualParadisePathObject : VirtualParadiseObject public sealed class VirtualParadisePathObject : VirtualParadiseObject
{ {
/// <inheritdoc /> /// <summary>
/// Initializes a new instance of the <see cref="VirtualParadisePathObject" /> class.
/// </summary>
/// <param name="client">The owning client.</param>
/// <param name="id">The object ID.</param>
/// <exception cref="ArgumentNullException"><paramref name="client" /> is <see langword="null" />.</exception>
internal VirtualParadisePathObject(VirtualParadiseClient client, int id) internal VirtualParadisePathObject(VirtualParadiseClient client, int id)
: base(client, id) : base(client, id)
{ {
@ -34,6 +39,7 @@ public sealed class VirtualParadisePathObject : VirtualParadiseObject
Path = (VirtualParadisePath)path.Path.Clone(); Path = (VirtualParadisePath)path.Path.Clone();
} }
/// <inheritdoc />
protected override void ExtractFromData(ReadOnlySpan<byte> data) protected override void ExtractFromData(ReadOnlySpan<byte> data)
{ {
Span<char> chars = stackalloc char[data.Length]; Span<char> chars = stackalloc char[data.Length];

View File

@ -1,10 +1,22 @@
using System.Numerics; using System.Numerics;
namespace VpSharp.Extensions; namespace VpSharp.Extensions;
/// <summary>
/// Extension methods for <see cref="Quaternion" />.
/// </summary>
public static class QuaternionExtensions public static class QuaternionExtensions
{ {
// https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/ /// <summary>
/// Converts this quaternion to a <see cref="Vector3d" /> containing an Euler representation of the rotation.
/// </summary>
/// <param name="value">The quaternion to convert.</param>
/// <param name="radians">
/// <see langword="true" /> if the resulting vector should be in radians; or <see langword="false" /> if the resulting
/// vector should be in degrees.
/// </param>
/// <returns>The Euler representation of <paramref name="value" />.</returns>
/// <see href="https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/" />
public static Vector3d ToEulerAngles(this Quaternion value, bool radians = true) public static Vector3d ToEulerAngles(this Quaternion value, bool radians = true)
{ {
double a = 2.0 * value.Y * value.W - 2.0 * value.X * value.Z; double a = 2.0 * value.Y * value.W - 2.0 * value.X * value.Z;
@ -29,6 +41,15 @@ public static class QuaternionExtensions
return new Vector3d(x, y, z); return new Vector3d(x, y, z);
} }
/// <summary>
/// Converts this quaternion to a <see cref="Vector3d" /> containing an Euler representation of the rotation.
/// </summary>
/// <param name="value">The quaternion to convert.</param>
/// <param name="radians">
/// <see langword="true" /> if the resulting vector should be in radians; or <see langword="false" /> if the resulting
/// vector should be in degrees.
/// </param>
/// <returns>The Euler representation of <paramref name="value" />.</returns>
public static Vector3d ToEulerAnglesF(this Quaternion value, bool radians = true) public static Vector3d ToEulerAnglesF(this Quaternion value, bool radians = true)
{ {
float a = 2.0f * value.Y * value.W - 2.0f * value.X * value.Z; float a = 2.0f * value.Y * value.W - 2.0f * value.X * value.Z;
@ -53,7 +74,14 @@ public static class QuaternionExtensions
return new Vector3d(x, y, z); return new Vector3d(x, y, z);
} }
// https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm //
/// <summary>
/// Converts this quaternion to an axis/angle pair.
/// </summary>
/// <param name="value">The quaternion to convert.</param>
/// <param name="axis">The axis value.</param>
/// <param name="angle">The angle value.</param>
/// <see href="https://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm"/>
public static void ToAxisAngle(this Quaternion value, out Vector3 axis, out float angle) public static void ToAxisAngle(this Quaternion value, out Vector3 axis, out float angle)
{ {
angle = 2.0f * MathF.Acos(value.W); angle = 2.0f * MathF.Acos(value.W);
@ -65,6 +93,12 @@ public static class QuaternionExtensions
axis = new Vector3(x, y, z); axis = new Vector3(x, y, z);
} }
/// <summary>
/// Converts this quaternion to an axis/angle pair.
/// </summary>
/// <param name="value">The quaternion to convert.</param>
/// <param name="axis">The axis value.</param>
/// <param name="angle">The angle value.</param>
public static void ToAxisAngle(this Quaternion value, out Vector3d axis, out double angle) public static void ToAxisAngle(this Quaternion value, out Vector3d axis, out double angle)
{ {
angle = 2.0 * Math.Acos(value.W); angle = 2.0 * Math.Acos(value.W);

View File

@ -5,10 +5,33 @@
/// </summary> /// </summary>
public enum FogMode public enum FogMode
{ {
/// <summary>
/// None.
/// </summary>
None, None,
/// <summary>
/// Linear fog mode.
/// </summary>
Linear, Linear,
Exp,
Exponential = Exp, /// <summary>
Exp2, /// Exponential fog mode.
Exponential2 = Exp2 /// </summary>
Exponential,
/// <summary>
/// Exponential squared fog mode.
/// </summary>
Exponential2,
/// <summary>
/// Exponential fog mode. This value is used for serialization purposes.
/// </summary>
Exp = Exponential,
/// <summary>
/// Exponential squared fog mode. This value is used for serialization purposes.
/// </summary>
Exp2 = Exponential2
} }