1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-15 06:44:10 +02:00

Added interface enumerator

This commit is contained in:
Brian Fiete 2020-11-04 11:00:31 -08:00
parent cabacdd183
commit 37576d389c

View file

@ -400,6 +400,14 @@ namespace System
} }
} }
public virtual TypeInstance.InterfaceEnumerator Interfaces
{
get
{
return .(null);
}
}
public virtual TypeInstance OuterType public virtual TypeInstance OuterType
{ {
get get
@ -675,6 +683,27 @@ namespace System.Reflection
public int32 mStartVirtualIdx; public int32 mStartVirtualIdx;
} }
public struct InterfaceEnumerator : IEnumerator<TypeInstance>
{
public TypeInstance mTypeInstance;
public int mIdx = -1;
public this(TypeInstance typeInstance)
{
mTypeInstance = typeInstance;
}
public Result<TypeInstance> GetNext() mut
{
if (mTypeInstance == null)
return .Err;
mIdx++;
if (mIdx >= mTypeInstance.mInterfaceCount)
return .Err;
return Type.[Friend]GetType(mTypeInstance.mInterfaceDataPtr[mIdx].mInterfaceType) as TypeInstance;
}
}
ClassVData* mTypeClassVData; ClassVData* mTypeClassVData;
String mName; String mName;
String mNamespace; String mNamespace;
@ -733,6 +762,14 @@ namespace System.Reflection
} }
} }
public override InterfaceEnumerator Interfaces
{
get
{
return .(this);
}
}
public override TypeInstance OuterType public override TypeInstance OuterType
{ {
get get