mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Added interface enumerator
This commit is contained in:
parent
cabacdd183
commit
37576d389c
1 changed files with 37 additions and 0 deletions
|
@ -400,6 +400,14 @@ namespace System
|
|||
}
|
||||
}
|
||||
|
||||
public virtual TypeInstance.InterfaceEnumerator Interfaces
|
||||
{
|
||||
get
|
||||
{
|
||||
return .(null);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual TypeInstance OuterType
|
||||
{
|
||||
get
|
||||
|
@ -675,6 +683,27 @@ namespace System.Reflection
|
|||
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;
|
||||
String mName;
|
||||
String mNamespace;
|
||||
|
@ -733,6 +762,14 @@ namespace System.Reflection
|
|||
}
|
||||
}
|
||||
|
||||
public override InterfaceEnumerator Interfaces
|
||||
{
|
||||
get
|
||||
{
|
||||
return .(this);
|
||||
}
|
||||
}
|
||||
|
||||
public override TypeInstance OuterType
|
||||
{
|
||||
get
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue