diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/Array.cpp | 12 | ||||
-rw-r--r-- | src/core/Dictionary.cpp | 12 |
2 files changed, 24 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); diff --git a/src/core/Dictionary.cpp b/src/core/Dictionary.cpp index aba226c..bb40017 100644 --- a/src/core/Dictionary.cpp +++ b/src/core/Dictionary.cpp @@ -10,6 +10,18 @@ Dictionary::Dictionary() godot::api->godot_dictionary_new(&_godot_dictionary); } +Dictionary::Dictionary(const Dictionary & other) +{ + godot::api->godot_dictionary_new_copy(&_godot_dictionary, &other._godot_dictionary); +} + +Dictionary & Dictionary::operator=(const Dictionary & other) +{ + godot::api->godot_dictionary_destroy(&_godot_dictionary); + godot::api->godot_dictionary_new_copy(&_godot_dictionary, &other._godot_dictionary); + return *this; +} + void Dictionary::clear() { godot::api->godot_dictionary_clear(&_godot_dictionary); |