mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-19 08:30:25 +02:00
Moving corlib files out of "System" directory into root
This commit is contained in:
parent
4cd58262e4
commit
7dbfd15292
179 changed files with 3 additions and 0 deletions
47
BeefLibs/corlib/src/Int8.bf
Normal file
47
BeefLibs/corlib/src/Int8.bf
Normal file
|
@ -0,0 +1,47 @@
|
|||
namespace System
|
||||
{
|
||||
struct Int8 : int8, IInteger, ISigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable
|
||||
{
|
||||
public const int32 MaxValue = 0x7F;
|
||||
public const int32 MinValue = -0x80;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue