浏览代码

[GDNative] Expose `Dictionary::merge()` over to GDNative CORE API v1.3

Kirill Diduk 3 年之前
父节点
当前提交
b5483a6aad

+ 8 - 0
modules/gdnative/gdnative/dictionary.cpp

@@ -186,6 +186,14 @@ godot_variant GDAPI godot_dictionary_get_with_default(const godot_dictionary *p_
 	return raw_dest;
 	return raw_dest;
 }
 }
 
 
+// GDNative core 1.3
+
+void GDAPI godot_dictionary_merge(godot_dictionary *p_self, const godot_dictionary *p_dictionary, const godot_bool p_overwrite) {
+	Dictionary *self = (Dictionary *)p_self;
+	const Dictionary *dictionary = (const Dictionary *)p_dictionary;
+	self->merge(*dictionary, p_overwrite);
+}
+
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
 #endif
 #endif

+ 9 - 0
modules/gdnative/gdnative_api.json

@@ -25,6 +25,15 @@
           },
           },
           "next": null,
           "next": null,
           "api": [
           "api": [
+            {
+              "name": "godot_dictionary_merge",
+              "return_type": "void",
+              "arguments": [
+                ["godot_dictionary *", "p_self"],
+                ["const godot_dictionary *", "p_dictionary"],
+                ["const godot_bool", "p_overwrite"]
+              ]
+            },
             {
             {
               "name": "godot_pool_byte_array_has",
               "name": "godot_pool_byte_array_has",
               "return_type": "godot_bool",
               "return_type": "godot_bool",

+ 4 - 0
modules/gdnative/include/gdnative/dictionary.h

@@ -102,6 +102,10 @@ godot_bool GDAPI godot_dictionary_erase_with_return(godot_dictionary *p_self, co
 
 
 godot_variant GDAPI godot_dictionary_get_with_default(const godot_dictionary *p_self, const godot_variant *p_key, const godot_variant *p_default);
 godot_variant GDAPI godot_dictionary_get_with_default(const godot_dictionary *p_self, const godot_variant *p_key, const godot_variant *p_default);
 
 
+// GDNative core 1.3
+
+void GDAPI godot_dictionary_merge(godot_dictionary *p_self, const godot_dictionary *p_dictionary, const godot_bool p_overwrite);
+
 #ifdef __cplusplus
 #ifdef __cplusplus
 }
 }
 #endif
 #endif