mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-19 00:20: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
41
BeefLibs/corlib/src/SizedArray.bf
Normal file
41
BeefLibs/corlib/src/SizedArray.bf
Normal file
|
@ -0,0 +1,41 @@
|
|||
namespace System
|
||||
{
|
||||
[AlwaysInclude]
|
||||
struct SizedArray<T, CSize> where CSize : const int
|
||||
{
|
||||
T[CSize] mVal;
|
||||
|
||||
public int Count
|
||||
{
|
||||
[Inline]
|
||||
get
|
||||
{
|
||||
return CSize;
|
||||
}
|
||||
}
|
||||
|
||||
public explicit static operator T[CSize] (Self val)
|
||||
{
|
||||
return val.mVal;
|
||||
}
|
||||
|
||||
public override void ToString(String strBuffer) mut
|
||||
{
|
||||
if (typeof(T) == typeof(char8))
|
||||
{
|
||||
strBuffer.Append((char8*)&mVal, CSize);
|
||||
return;
|
||||
}
|
||||
|
||||
strBuffer.Append('(');
|
||||
for (int i < CSize)
|
||||
{
|
||||
if (i != 0)
|
||||
strBuffer.Append(", ");
|
||||
mVal[i].ToString(strBuffer);
|
||||
}
|
||||
strBuffer.Append(')');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue