From 187e6ae26d88ab0975de6011d00e41a846bcb6fa Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Tue, 5 Mar 2019 18:52:19 +0100 Subject: C#: Add marshalling support for IEnumerable and IDictionary Added constructor that takes IEnumerable for Array and IEnumerable for Array. Added constructor that takes IDictionary for Dictionary and IDictionary for Dictionary. --- modules/mono/mono_gd/gd_mono_class.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/mono/mono_gd/gd_mono_class.cpp') diff --git a/modules/mono/mono_gd/gd_mono_class.cpp b/modules/mono/mono_gd/gd_mono_class.cpp index 92324d73f9..d58f675d19 100644 --- a/modules/mono/mono_gd/gd_mono_class.cpp +++ b/modules/mono/mono_gd/gd_mono_class.cpp @@ -260,6 +260,11 @@ bool GDMonoClass::has_fetched_method_unknown_params(const StringName &p_name) { return get_fetched_method_unknown_params(p_name) != NULL; } +bool GDMonoClass::implements_interface(GDMonoClass *p_interface) { + + return mono_class_implements_interface(mono_class, p_interface->get_mono_ptr()); +} + GDMonoMethod *GDMonoClass::get_method(const StringName &p_name, int p_params_count) { MethodKey key = MethodKey(p_name, p_params_count); -- cgit v1.2.3 From 480d4c6fbabc65a0822cd3954e488bf64d04b45c Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Tue, 5 Mar 2019 21:39:50 +0100 Subject: C#: Support type hints for exported Arrays Added the code for Dictionary as well, but it's not yet supported by the Godot inspector. --- modules/mono/mono_gd/gd_mono_class.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/mono/mono_gd/gd_mono_class.cpp') diff --git a/modules/mono/mono_gd/gd_mono_class.cpp b/modules/mono/mono_gd/gd_mono_class.cpp index d58f675d19..4342f46109 100644 --- a/modules/mono/mono_gd/gd_mono_class.cpp +++ b/modules/mono/mono_gd/gd_mono_class.cpp @@ -55,7 +55,8 @@ String GDMonoClass::get_full_name() const { } MonoType *GDMonoClass::get_mono_type() { - // Care, you cannot compare MonoType pointers + // Careful, you cannot compare two MonoType*. + // There is mono_metadata_type_equal, how is this different from comparing two MonoClass*? return get_mono_type(mono_class); } -- cgit v1.2.3