summaryrefslogtreecommitdiff
path: root/modules/mono/glue/Managed/Files/Dictionary.cs
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2019-12-04 14:54:33 +0100
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2019-12-04 15:22:30 +0100
commit3797f1992609679b39711720fac69079fadf85c1 (patch)
tree0ccc4ec8bb9696b37daa0183359e55d86f548e22 /modules/mono/glue/Managed/Files/Dictionary.cs
parent73fb08289af1260669a3ce118b9866a11c06a0eb (diff)
C#: Add Duplicate method to the Array and Dictionary bindings
Diffstat (limited to 'modules/mono/glue/Managed/Files/Dictionary.cs')
-rw-r--r--modules/mono/glue/Managed/Files/Dictionary.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/mono/glue/Managed/Files/Dictionary.cs b/modules/mono/glue/Managed/Files/Dictionary.cs
index 6ab8549a01..d72109de92 100644
--- a/modules/mono/glue/Managed/Files/Dictionary.cs
+++ b/modules/mono/glue/Managed/Files/Dictionary.cs
@@ -80,6 +80,11 @@ namespace Godot.Collections
disposed = true;
}
+ public Dictionary Duplicate(bool deep = false)
+ {
+ return new Dictionary(godot_icall_Dictionary_Duplicate(GetPtr(), deep));
+ }
+
// IDictionary
public ICollection Keys
@@ -235,6 +240,9 @@ namespace Godot.Collections
internal extern static bool godot_icall_Dictionary_ContainsKey(IntPtr ptr, object key);
[MethodImpl(MethodImplOptions.InternalCall)]
+ internal extern static IntPtr godot_icall_Dictionary_Duplicate(IntPtr ptr, bool deep);
+
+ [MethodImpl(MethodImplOptions.InternalCall)]
internal extern static bool godot_icall_Dictionary_RemoveKey(IntPtr ptr, object key);
[MethodImpl(MethodImplOptions.InternalCall)]
@@ -313,6 +321,11 @@ namespace Godot.Collections
return objectDict.GetPtr();
}
+ public Dictionary<TKey, TValue> Duplicate(bool deep = false)
+ {
+ return new Dictionary<TKey, TValue>(objectDict.Duplicate(deep));
+ }
+
// IDictionary<TKey, TValue>
public TValue this[TKey key]