1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-27 20:18:01 +02:00

Added type enumeration

This commit is contained in:
Brian Fiete 2020-05-15 15:42:44 -07:00
parent dad51be5d6
commit 121e5b9b06
3 changed files with 28 additions and 2 deletions

View file

@ -35,6 +35,14 @@ namespace System
}
}
public static Enumerator Types
{
get
{
return .();
}
}
public int32 Size
{
get
@ -461,6 +469,24 @@ namespace System
{
return FieldInfo.Enumerator(null, bindingFlags);
}
public struct Enumerator : IEnumerator<Type>
{
int32 mCurId;
public Result<Type> GetNext() mut
{
while (true)
{
if (mCurId >= sTypeCount)
return .Err;
let type = sTypes[mCurId++];
if (type != null)
return .Ok(type);
}
}
}
}
enum TypeCode : uint8