summaryrefslogtreecommitdiffstats
path: root/src/core/Array.cpp
diff options
context:
space:
mode:
authorThomas Herzog <thomas.herzog@mail.com>2018-01-17 08:42:09 +0100
committerGitHub <noreply@github.com>2018-01-17 08:42:09 +0100
commitb9b06b5fbcd58a63c01eef6784f6082f528a1e3f (patch)
tree7aa5c5c2d477a92f1b5f7f91aa9296d039595b3c /src/core/Array.cpp
parent7dde412e26315447edf2f46661143082b5becf32 (diff)
parent00f089d7edafa53a5018054f9662a36a695ad8b9 (diff)
downloadredot-cpp-b9b06b5fbcd58a63c01eef6784f6082f528a1e3f.tar.gz
Merge pull request #69 from Zylann/fix_copy_constructors
Added copy constructors and assignment operators to Array and Dictionary
Diffstat (limited to 'src/core/Array.cpp')
-rw-r--r--src/core/Array.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/Array.cpp b/src/core/Array.cpp
index c3de16c..0350547 100644
--- a/src/core/Array.cpp
+++ b/src/core/Array.cpp
@@ -13,6 +13,18 @@ Array::Array()
godot::api->godot_array_new(&_godot_array);
}
+Array::Array(const Array & other)
+{
+ godot::api->godot_array_new_copy(&_godot_array, &other._godot_array);
+}
+
+Array & Array::operator=(const Array & other)
+{
+ godot::api->godot_array_destroy(&_godot_array);
+ godot::api->godot_array_new_copy(&_godot_array, &other._godot_array);
+ return *this;
+}
+
Array::Array(const PoolByteArray& a)
{
godot::api->godot_array_new_pool_byte_array(&_godot_array, (godot_pool_byte_array *) &a);