Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
Wip definitions for Interop Field and Property in Interoperability
Browse files Browse the repository at this point in the history
  • Loading branch information
scarletquasar committed Aug 8, 2023
1 parent f453474 commit 4e3a94f
Showing 1 changed file with 26 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ namespace MelonRuntime.Core.Library.Reflection {
/// Representation of an Assembly object in the interoperability context,
/// capable of open and use the internal namespaces of it. Can be created
/// from an external file. InteropAssembly
/// may be used only for raw contexts inside JavaScript to CLR interoperability
/// and is not useful as direct provider to get features from after the engine
/// startup operation.
/// </summary>
Expand Down Expand Up @@ -144,7 +143,10 @@ public InteropNamespace(string? fullName, InteropAssembly interopAssembly)
type.GetConstructors(),
this,
GetAssembly(),
type);
type,
null, //TODO: add InteropMethod[]
null, //TODO: add InteropField[]
null); //TODO: add IntetopProperty[]
return interopClass;
})
Expand All @@ -163,6 +165,7 @@ public class InteropClass
private InteropNamespace? _namespace;
private InteropMethod[]? _methods;
private InteropField[]? _fields;
private InteropProperty[]? _properties;
private Type? _type;
private ConstructorInfo[]? _constructors;

Expand All @@ -177,7 +180,10 @@ public InteropClass(
ConstructorInfo[]? constructors,
InteropNamespace? @namespace,
InteropAssembly? assembly,
Type? type)
Type? type,
InteropMethod[]? methods,
InteropField[]? fields,
InteropProperty[]? properties)
{
FullName = fullName;
IsStatic = isStatic;
Expand All @@ -187,6 +193,9 @@ public InteropClass(
_namespace = @namespace;
_assembly = assembly;
_type = type;
_methods = methods;
_fields = fields;
_properties = properties;
}
}

Expand Down Expand Up @@ -231,12 +240,26 @@ public InteropEnumValues(

public class InteropField
{
public string? Name { get; private set; }
public Type? Type;

public InteropField(string? name, Type? type)
{
Name = name;
Type = type;
}
}

public class InteropProperty
{
public string? Name { get; private set; }
public Type? Type;

public InteropProperty(string? name, Type? type)
{
Name = name;
Type = type;
}
}

public class InteropMethod
Expand Down

0 comments on commit 4e3a94f

Please sign in to comment.