mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-09 23:45:42 +00:00
Compare commits
5 Commits
6cce6d83bd
...
319d78a19d
Author | SHA1 | Date | |
---|---|---|---|
|
319d78a19d | ||
19c467d88b | |||
bd1b12da71 | |||
|
8d2b4b011b | ||
25062bbf8b |
@ -78,7 +78,6 @@ public static class ByteExtensions
|
||||
{
|
||||
return (byte)((long)value).GreatestCommonFactor(other);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is evenly divisible by 2.
|
||||
@ -109,6 +108,7 @@ public static class ByteExtensions
|
||||
{
|
||||
return !value.IsEven();
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is a prime number.
|
||||
|
@ -83,7 +83,6 @@ public static class Int16Extensions
|
||||
{
|
||||
return (short)((long)value).GreatestCommonFactor(other);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is evenly divisible by 2.
|
||||
@ -114,6 +113,7 @@ public static class Int16Extensions
|
||||
{
|
||||
return !value.IsEven();
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is a prime number.
|
||||
|
@ -83,7 +83,6 @@ public static class Int32Extensions
|
||||
{
|
||||
return (int)((long)value).GreatestCommonFactor(other);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is evenly divisible by 2.
|
||||
@ -114,6 +113,7 @@ public static class Int32Extensions
|
||||
{
|
||||
return !value.IsEven();
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is a prime number.
|
||||
|
@ -88,7 +88,6 @@ public static class Int64Extensions
|
||||
|
||||
return value;
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is evenly divisible by 2.
|
||||
@ -119,6 +118,7 @@ public static class Int64Extensions
|
||||
{
|
||||
return !value.IsEven();
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is a prime number.
|
||||
|
@ -84,7 +84,6 @@ public static class SByteExtensions
|
||||
{
|
||||
return (sbyte)((long)value).GreatestCommonFactor(other);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is evenly divisible by 2.
|
||||
@ -115,6 +114,7 @@ public static class SByteExtensions
|
||||
{
|
||||
return !value.IsEven();
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is a prime number.
|
||||
|
@ -79,7 +79,6 @@ public static class UInt16Extensions
|
||||
{
|
||||
return (ushort)((long)value).GreatestCommonFactor(other);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is evenly divisible by 2.
|
||||
@ -96,20 +95,6 @@ public static class UInt16Extensions
|
||||
return (value & 1) == 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is a prime number.
|
||||
/// </summary>
|
||||
/// <param name="value">The value whose primality to check.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if <paramref name="value" /> is prime; otherwise, <see langword="false" />.
|
||||
/// </returns>
|
||||
[Pure]
|
||||
[MethodImpl(CompilerResources.MaxOptimization)]
|
||||
public static bool IsPrime(this ushort value)
|
||||
{
|
||||
return ((ulong)value).IsPrime();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is not evenly divisible by 2.
|
||||
/// </summary>
|
||||
@ -124,6 +109,21 @@ public static class UInt16Extensions
|
||||
{
|
||||
return !value.IsEven();
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is a prime number.
|
||||
/// </summary>
|
||||
/// <param name="value">The value whose primality to check.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if <paramref name="value" /> is prime; otherwise, <see langword="false" />.
|
||||
/// </returns>
|
||||
[Pure]
|
||||
[MethodImpl(CompilerResources.MaxOptimization)]
|
||||
public static bool IsPrime(this ushort value)
|
||||
{
|
||||
return ((ulong)value).IsPrime();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the lowest common multiple between the current 16-bit unsigned integer, and another 16-bit unsigned
|
||||
|
@ -79,7 +79,6 @@ public static class UInt32Extensions
|
||||
{
|
||||
return (uint)((long)value).GreatestCommonFactor(other);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is evenly divisible by 2.
|
||||
@ -96,20 +95,6 @@ public static class UInt32Extensions
|
||||
return (value & 1) == 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is a prime number.
|
||||
/// </summary>
|
||||
/// <param name="value">The value whose primality to check.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if <paramref name="value" /> is prime; otherwise, <see langword="false" />.
|
||||
/// </returns>
|
||||
[Pure]
|
||||
[MethodImpl(CompilerResources.MaxOptimization)]
|
||||
public static bool IsPrime(this uint value)
|
||||
{
|
||||
return ((ulong)value).IsPrime();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is not evenly divisible by 2.
|
||||
/// </summary>
|
||||
@ -124,6 +109,21 @@ public static class UInt32Extensions
|
||||
{
|
||||
return !value.IsEven();
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is a prime number.
|
||||
/// </summary>
|
||||
/// <param name="value">The value whose primality to check.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if <paramref name="value" /> is prime; otherwise, <see langword="false" />.
|
||||
/// </returns>
|
||||
[Pure]
|
||||
[MethodImpl(CompilerResources.MaxOptimization)]
|
||||
public static bool IsPrime(this uint value)
|
||||
{
|
||||
return ((ulong)value).IsPrime();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the lowest common multiple between the current 32-bit unsigned integer, and another 32-bit unsigned
|
||||
|
@ -84,7 +84,6 @@ public static class UInt64Extensions
|
||||
|
||||
return value;
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is evenly divisible by 2.
|
||||
@ -101,6 +100,22 @@ public static class UInt64Extensions
|
||||
return (value & 1) == 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is not evenly divisible by 2.
|
||||
/// </summary>
|
||||
/// <param name="value">The value whose parity to check.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if <paramref name="value" /> is not evenly divisible by 2, or <see langword="false" />
|
||||
/// otherwise.
|
||||
/// </returns>
|
||||
[Pure]
|
||||
[MethodImpl(CompilerResources.MaxOptimization)]
|
||||
public static bool IsOdd(this ulong value)
|
||||
{
|
||||
return !value.IsEven();
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is a prime number.
|
||||
/// </summary>
|
||||
@ -134,21 +149,6 @@ public static class UInt64Extensions
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a value indicating whether the current value is not evenly divisible by 2.
|
||||
/// </summary>
|
||||
/// <param name="value">The value whose parity to check.</param>
|
||||
/// <returns>
|
||||
/// <see langword="true" /> if <paramref name="value" /> is not evenly divisible by 2, or <see langword="false" />
|
||||
/// otherwise.
|
||||
/// </returns>
|
||||
[Pure]
|
||||
[MethodImpl(CompilerResources.MaxOptimization)]
|
||||
public static bool IsOdd(this ulong value)
|
||||
{
|
||||
return !value.IsEven();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the lowest common multiple between the current 64-bit unsigned integer, and another 64-bit unsigned
|
||||
/// integer.
|
||||
|
@ -3,6 +3,9 @@
|
||||
X10D 4.0.0 is a major release that introduces breaking changes. This document will help you migrate your code from 3.x.x
|
||||
to 4.0.0.
|
||||
|
||||
When a breaking change is mentioned, the compatibility mirrors that of the Microsoft documentation for .NET, which you
|
||||
can find [here](https://learn.microsoft.com/en-us/dotnet/core/compatibility/categories).
|
||||
|
||||
## Removed APIs
|
||||
|
||||
### X10D.DSharpPlus library
|
||||
@ -12,8 +15,18 @@ wrapper library. However, I have since moved to using a different library, and a
|
||||
scope of X10D or in my best interest to maintain it. The library will remain available on NuGet until DSharpPlus release
|
||||
5.0.0 as stable, and X10D.DSharpPlus will NOT be part of X10D 4.0.0. I'm sorry for any inconvenience this may cause.
|
||||
|
||||
### X10D.Unity library
|
||||
|
||||
The `X10D.Unity` library has been removed. This library was used to provide extension methods for the Unity API. Due to
|
||||
game development politics, I no longer feel it in my best interest to continue development of the Unity package. The
|
||||
library will remain on NuGet for the foreseeable future but will no longer be maintained. The `upm` branch of the Git
|
||||
repository will remain available indefinitely also.
|
||||
|
||||
|
||||
### `Endianness` enum
|
||||
|
||||
**Source incompatible change**
|
||||
|
||||
The `Endianness` enum was used to specify the endianness of data when reading or writing to a stream. This was causing
|
||||
some clutter, and makes it harder to develop X10D, so it was removed. In its stead, any method which accepted an
|
||||
`Endianness` parameter now has two overloads: one for big-endian, and one for little-endian. For example, the following
|
||||
@ -41,12 +54,16 @@ Span<byte> buffer = stackalloc byte[4];
|
||||
|
||||
### `IEnumerable<T>.ConcatOne(T)` extension method
|
||||
|
||||
**Source incompatible change**
|
||||
|
||||
The `IEnumerable<T>.ConcatOne` extension method was used to concatenate a single item to an enumerable. At the time, I
|
||||
was unaware of the `Enumerable.Append` method, which does the same thing. As such, `ConcatOne` has been removed. There
|
||||
is no migration path for this, as the built in `Append` method from LINQ is a drop-in replacement.
|
||||
|
||||
## Exception Changes
|
||||
|
||||
**Source incompatible change**
|
||||
|
||||
If you were previously catching TypeInitializationException when calling `Stream.GetHash<>` or `Stream.TryWriteHash<>`,
|
||||
you will now need to catch a ArgumentException instead. The justification for this change is that ArgumentException is
|
||||
more general, and more easily understood by developers.
|
Loading…
Reference in New Issue
Block a user