mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-19 16:40:26 +02:00
47 lines
943 B
Beef
47 lines
943 B
Beef
namespace System
|
|
{
|
|
struct UInt16 : uint16, IInteger, IUnsigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable
|
|
{
|
|
public const uint16 MaxValue = (uint16)0xFFFF;
|
|
public const uint16 MinValue = 0;
|
|
|
|
public static int operator<=>(Self a, Self b)
|
|
{
|
|
return (SelfBase)a <=> (SelfBase)b;
|
|
}
|
|
|
|
public static Self operator+(Self lhs, Self rhs)
|
|
{
|
|
return (SelfBase)lhs + (SelfBase)rhs;
|
|
}
|
|
|
|
public static Self operator-(Self value)
|
|
{
|
|
return (SelfBase)value;
|
|
}
|
|
|
|
int IHashable.GetHashCode()
|
|
{
|
|
return (int)this;
|
|
}
|
|
|
|
bool IIsNaN.IsNaN
|
|
{
|
|
[SkipCall]
|
|
get
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public void ToString(String outString, String format, IFormatProvider formatProvider)
|
|
{
|
|
if ((format != null) && (format.StartsWith("X")))
|
|
{
|
|
((uint64)this).ToString(outString, format, formatProvider);
|
|
return;
|
|
}
|
|
((int64)this).ToString(outString, format, formatProvider);
|
|
}
|
|
}
|
|
}
|