feat: added IEquatable interfaces to primitives
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using System;
|
||||
|
||||
namespace Engine.Core;
|
||||
|
||||
/// <summary>
|
||||
@@ -9,7 +11,7 @@ namespace Engine.Core;
|
||||
/// Initializes a new instance of the <see cref="Projection1D"/> struct with the specified minimum and maximum values.
|
||||
/// </remarks>
|
||||
[System.Diagnostics.DebuggerDisplay("Min: {Min}, Max: {Max}")]
|
||||
public readonly struct Projection1D(float min, float max)
|
||||
public readonly struct Projection1D(float min, float max) : IEquatable<Projection1D>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the minimum value of the projection.
|
||||
@@ -90,6 +92,7 @@ public readonly struct Projection1D(float min, float max)
|
||||
/// <param name="obj">The object to compare with the current <see cref="Projection1D"/>.</param>
|
||||
/// <returns><see cref="true"/> if the specified object is equal to the current <see cref="Projection1D"/>; otherwise, <see cref="false"/>.</returns>
|
||||
public override bool Equals(object? obj) => obj is Projection1D projection1D && this == projection1D;
|
||||
public bool Equals(Projection1D other) => this == other;
|
||||
|
||||
/// <summary>
|
||||
/// Generates a hash code for the <see cref="Projection1D"/>.
|
||||
|
Reference in New Issue
Block a user