mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-09 23:25:43 +00:00
14 KiB
14 KiB
Changelog
3.0.0 (Unreleased)
Added
- Added
StringBuilderReader
(inheritingTextReader
) which allows reading from aStringBuilder
without consuming the underlying string - Added extension methods for
System.Decimal
- Added
All
andAny
forSpan<T>
andReadOnlySpan<T>
, mimicking the corresponding methods inSystem.Linq
- Added time-related extension methods (
Ticks
,Milliseconds
,Seconds
,Minutes
,Hours
,Days
, andWeeks
) to all built-in numeric types - Added
TimeSpan.Ago()
andTimeSpan.FromNow()
- Added
Factorial
extension method for built-in numeric types - Added
FileInfo.GetHash<T>()
- Added
FileInfo.TryWriteHash<T>(Span<byte>, out int)
- Added
IEnumerable<TSource>.Product()
andIEnumerable<TSource>.Product<TResult>(Func<TSource>, TResult)
for all built-in numeric types, computing the product of all (transformed) elements - Added
IEnumerable<T>.Shuffled([Random])
, which wrapsIList<T>.Shuffle([Random])
and returns the result - Added
T.AsArray()
- Added
T.AsEnumerable()
- Added
T.ToJson([JsonSerializerOptions])
- Added
T[].AsReadOnly()
- Added
T[].Clear([Range])
andT[].Clear(int, int)
- Added
T[].Fill(T)
andT[].Fill(T, int, int)
- Added
Random.Next<T>()
- Added
Random.NextDouble(double)
- Added
Random.NextDouble(double, double)
- Added
Random.NextSingle()
- Added
Random.NextSingle(float)
- Added
Random.NextSingle(float, float)
- Added
Random.NextInt64()
- Added
Random.NextInt64(long)
- Added
Random.NextInt64(long, long)
- Added
Random.NextColor()
- Added
Random.NextUnitVector2()
- Added
Random.NextUnitVector3()
- Added
Random.NextRotation()
- Added
Rune.Repeat(int)
- Added
bool.GetBytes()
- Added
byte.GetBytes()
- Added
byte.IsEven()
- Added
byte.IsOdd()
- Added
byte.IsPrime()
- Added
sbyte.IsEven()
- Added
sbyte.IsOdd()
- Added
sbyte.IsPrime()
- Added
sbyte.Sign()
- Added
decimal.Sign()
- Added
double.Acos()
- Added
double.Acosh()
- Added
double.Asin()
- Added
double.Asinh()
- Added
double.Atan()
- Added
double.Atanh()
- Added
double.ComplexSqrt()
- Added
double.Cos()
- Added
double.Cosh()
- Added
double.LerpFrom(double, double)
- Added
double.LerpTo(double, double)
- Added
double.LerpWith(double, double)
- Added
double.Sign()
- Added
double.Sin()
- Added
double.Sinh()
- Added
double.Sqrt()
- Added
double.Tan()
- Added
double.Tanh()
- Added
float.Acos()
- Added
float.Acosh()
- Added
float.Asin()
- Added
float.Asinh()
- Added
float.Atan()
- Added
float.Atanh()
- Added
float.ComplexSqrt()
- Added
float.Cos()
- Added
float.Cosh()
- Added
float.LerpFrom(float, float)
- Added
float.LerpTo(float, float)
- Added
float.LerpWith(float, float)
- Added
float.Sign()
- Added
float.Sin()
- Added
float.Sinh()
- Added
float.Sqrt()
- Added
float.Tan()
- Added
float.Tanh()
- Added
short.ToHostOrder()
- Added
short.LerpFrom(double, double)
- Added
short.LerpTo(double, double)
- Added
short.LerpWith(double, double)
- Added
short.LerpFrom(float, float)
- Added
short.LerpTo(float, float)
- Added
short.LerpWith(float, float)
- Added
short.Sign()
- Added
short.ToNetworkOrder()
- Added
short.To(short)
andshort.To(short, short)
- Added
int.LerpFrom(double, double)
- Added
int.LerpTo(double, double)
- Added
int.LerpWith(double, double)
- Added
int.LerpFrom(float, float)
- Added
int.LerpTo(float, float)
- Added
int.LerpWith(float, float)
- Added
int.Mod(int)
- Added
int.RotateLeft(int)
- Added
int.RotateRight(int)
- Added
int.Sign()
- Added
int.ToHostOrder()
- Added
int.ToNetworkOrder()
- Added
int.To(int)
andint.To(int, int)
- Added
long.ToHostOrder()
- Added
long.LerpFrom(double, double)
- Added
long.LerpTo(double, double)
- Added
long.LerpWith(double, double)
- Added
long.LerpFrom(float, float)
- Added
long.LerpTo(float, float)
- Added
long.LerpWith(float, float)
- Added
long.Sign()
- Added
long.ToNetworkOrder()
- Added
long.To(long)
andlong.To(long, long)
- Added
IComparable<T>.Clamp(T, T)
which supersedesshort.Clamp(short, short)
,int.Clamp(int, int)
, andlong.Clamp(long, long)
- Added
IComparable<T>.GreaterThan(T)
- Added
IComparable<T>.GreaterOrEqualTo(T)
- Added
IComparable<T>.LessThan(T)
- Added
IComparable<T>.LessThanOrEqualTo(T)
- Added
IComparable<T>.Max(T)
- Added
IComparable<T>.Min(T)
- Added
IReadOnlyCollection<T>.Split(int)
- Yields the same results as
IEnumerable<T>.Split(int)
, except is able to avoid a hidden allocation with the benefit of knowing the collection size ahead of time
- Yields the same results as
- Added
Type.HasCustomAttribute<T>()
andType.HasCustomAttribute(Type)
- Added
Type.Implements<T>()
andType.Implements(Type)
- Added
Type.Inherits<T>()
andType.Inherits(Type)
- Added
Type.SelectFromCustomAttribute<TAttribute, TReturn>()
- Added
DateTimeOffset
extensions which supersedeDateTime
extensions - Added
Endianness
enum - Added
Stream.GetHash<T>()
- Added
Stream.TryWriteHash<T>(Span<byte>, out int)
- Added
Stream.ReadInt16([Endian])
- Added
Stream.ReadInt32([Endian])
- Added
Stream.ReadInt64([Endian])
- Added
Stream.ReadUInt16([Endian])
- Added
Stream.ReadUInt32([Endian])
- Added
Stream.ReadUInt64([Endian])
- Added
Stream.Write(short, [Endian])
- Added
Stream.Write(int, [Endian])
- Added
Stream.Write(long, [Endian])
- Added
Stream.Write(ushort, [Endian])
- Added
Stream.Write(uint, [Endian])
- Added
Stream.Write(ulong, [Endian])
- Added
string.IsPalindrome()
- Added
string.FromJson([JsonSerializerOptions])
- Added
TimeSpanParser.TryParse
which supersedesTimeSpanParser.Parse
Changed
- Update to .NET 6
- Methods defined to accept
byte[]
have been changed acceptIReadOnlyList<byte>
Enum.Next([bool])
andEnum.Previous([bool])
have been separated. Non-wrapped overloads now use theUnchecked
prefix (NextUnchecked
andPreviousUnchecked
)- Improve performance for:
string.IsLower()
string.IsUpper()
string.Reverse()
IEnumerable<T>.Split(int)
now lazily enumerates, rather than consuming in full before yielding- Separated
short.FromUnixTimestamp(bool)
intoshort.FromUnixTimeMilliseconds
andshort.FromUnixTimeSeconds
- Separated
int.FromUnixTimestamp(bool)
intoint.FromUnixTimeMilliseconds
andint.FromUnixTimeSeconds
- Separated
long.FromUnixTimestamp(bool)
intolong.FromUnixTimeMilliseconds
andlong.FromUnixTimeSeconds
- Seperated
string.WithAlternative(string, [bool])
tostring.WithEmptyAlternative(string)
andstring.WithWhiteSpaceAlternative(string)
IComparable.Between
now accepts anInclusiveOptions
parameter to specify whether checks shall be inclusive or exclusive- Renamed
Random.CoinToss()
toRandom.NextBoolean()
to fall into consistency withRandom.Next()
,Random.NextBytes()
andRandom.NextDouble()
- Renamed
Random.OneOf()
toRandom.NextFrom()
(same reasoning) - Renamed
List.OneOf()
toList.Random()
- Renamed
string.Random(int[, Random])
tostring.Randomize(int[, Random])
- Renamed
char[].Random(int)
,char[].Random(int, Random)
,IEnumerable<char>.Random(int)
, andIEnumerable<char>.Random(int, Random)
, in favour ofRandom.NextString(IReadOnlyList<char>, int)
IList<T>.Shuffle([Random])
now uses a Fisher-Yates shuffle implementationIList<T>.Shuffle([Random])
now returnsvoid
, as it will reorganize the elements in-place on the currentIList<T>
Dictionary
,IDictionary
, andIReadOnlyDictionary
extension methods have been consolidated toIEnumerable<KeyValuePair<K,V>>
- Fixed a bug where
IEnumerable<KeyValuePair<K,V>>.ToConnectionString()
would not sanitize types with customToString()
implementation (#20) DateTime
extensions now wrapDateTimeOffset
extensionsDateTime.ToUnixTimestamp([bool])
has been split intoDateTime.ToUnixTimeMilliseconds()
andDateTime.ToUnixTimeSeconds()
IEnumerable<byte>.GetString([Encoding])
has been renamed toIReadOnlyList<byte>.ToString
and itsEncoding
parameter has been made non-optionalWaitHandle.WaitOneAsync
now returnsTask<bool>
as a result of callingTask.Run
, rather than returning a typelessnew Task()
string.AsNullIfEmpty()
andstring.AsNullIfWhiteSpace()
now accept a nullablestring
string.WithAlternative
is nowstring.WithEmptyAlternative
andstring.WithWhiteSpaceAlternative
Removed
- Removed
bool.And(bool)
- Removed
bool.NAnd(bool)
- Removed
bool.NOr(bool)
- Removed
bool.Not()
- Removed
bool.Or(bool)
- Removed
bool.XNOr(bool)
- Removed
bool.XOr(bool)
- Removed
float.ToBoolean()
- Removed
double.ToBoolean()
- Removed
int.ToBoolean()
- Removed
long.ToBoolean()
- Removed
IConvertible.To<T>([IFormatProvider])
- Removed
IConvertible.ToOrDefault<T>([IFormatProvider])
- Removed
IConvertible.ToOrDefault<T>(out T, [IFormatProvider])
- Removed
IConvertible.ToOrNull<T>([IFormatProvider])
- Removed
IConvertible.ToOrNull<T>(out T, [IFormatProvider])
- Removed
IConvertible.ToOrOther<T>(T, [IFormatProvider])
- Removed
IConvertible.ToOrOther<T>(T, out T, [IFormatProvider])
- Removed
IEnumerable<T>.Split(int)
andIReadOnlyCollection<T>.Split
(this functionality is now provided by LINQ in the form of theChunk
method) - Removed
MemberInfo.GetDefaultValue()
(useSelectFromCustomAttribute()
instead) - Removed
MemberInfo.GetDescription()
(useSelectFromCustomAttribute()
instead) - Removed
Random.NextInt64()
and its overloads. This functionality is built in starting with .NET 6 - Removed
TimeSpanParser.Parse
2.6.0 - 2020-10-20
Added
- Add
string.AsNullIfEmpty()
- Returns the current string, or
null
if the current string is null or empty.
- Returns the current string, or
- Add
string.AsNullIfWhiteSpace()
- Returns the current string, or
null
if the current string is null, empty, or consists of only whitespace.
- Returns the current string, or
- Add
string.Reverse()
- Reverses the current string
- Add
string.WithAlternative()
- Returns the current string, or an alternative value if the current string is null or empty, or optionally if the current string consists of only whitespace.
Changed
- n/a
Removed
- n/a
2.5.0 - 2020-07-15
Added
WaitHandle.WaitOneAsync()
- Wraps
WaitHandle.WaitOne
as aTask
- Wraps
- Add support for Unity 2019.4.3f1
- Add
GameObject.LookAt(GameObject)
- Rotates the Transform on the current GameObject so that it faces the Transform on another GameObject
- Add
GameObject.LookAt(Transform)
- Rotates the Transform on the current GameObject so that it faces another transform
- Add
Transform.LookAt(GameObject)
- Rotates the current Transform so that it faces the Transform on another GameObject
- Add
Vector3.Round([float])
- Returns a rounded Vector3 by calling
float.Round()
on each component
- Returns a rounded Vector3 by calling
- Add
Vector3.WithX(float)
- Returns a Vector3 with a new X component value
- Add
Vector3.WithY(float)
- Returns a Vector3 with a new Y component value
- Add
Vector3.WithZ(float)
- Returns a Vector3 with a new Z component value
- Add
Vector3.WithXY(float, float)
- Returns a Vector3 with new X and Y component values
- Add
Vector3.WithXZ(float, float)
- Returns a Vector3 with new X and Z component values
- Add
Vector3.WithYZ(float, float)
- Returns a Vector3 with new Y and Z component values
- Add
BetterBehavior
(experimental wrapper overMonoBehaviour
)
- Add
Changed
- n/a
Removed
- n/a
2.2.0 - 2020-04-21
Added
-
Add
string.ChangeEncoding(Encoding, Encoding)
- Converts this string from one encoding to another
-
Add
string.IsLower()
- Determines if all alpha characters in this string are considered lowercase
-
Add
string.IsUpper()
- Determines if all alpha characters in this string are considered uppercase
-
Various extension methods with regards to reflection:
GetDefaultValue
andGetDefaultValue<T>
- gets the value stored in the member'sDefaultValue
attributeGetDescription
- gets the value stored in the member'sDescription
attributeSelectFromCustomAttribute<T1, T2>
- Internally callsGetCustomAttribute<T1>
and passes it to aFunc<T1, T2>
so that specific members may be selected
Changed
- n/a
Removed
- n/a
2.1.0 - 2020-04-18
Added
- Add
bool bool.And(bool)
- Performs logical AND
- Add
bool bool.Or(bool)
- Performs logical OR
- Add
bool bool.Not(bool)
- Performs logical NOT
- Add
bool bool.XOr(bool)
- Performs Logical XOR
- Add
bool bool.NAnd(bool)
- Performs logical NAND
- Add
bool bool.NOr(bool)
- Performs logical NOR
- Add
bool bool.XNOr(bool)
- Performs logical XNOR
- Add
byte bool.ToByte()
- 1 if
true
, 0 otherwise
- 1 if
- Add
short bool.ToInt16()
- 1 if
true
, 0 otherwise
- 1 if
- Add
long bool.ToInt64()
- 1 if
true
, 0 otherwise
- 1 if
Changed
- n/a
Removed
- n/a
2.0.0 - 2020-04-18
Added
- Add
IEnumerable<T>.Split(int)
- Performs the same operation as the previously defined
IEnumerable<byte>.Chunkify(int)
, except now accepts any typeT
- Performs the same operation as the previously defined
Changed
- Fix
DateTime.Last(DayOfWeek)
implementation- Now returns the correct date/time for a given day of the week
Removed
- Remove
IEnumerable<byte>.Chunkify(int)
- Replaced by a method of the same behaviour
IEnumerable<T>.Split(int)
- Replaced by a method of the same behaviour