diff options
| author | Thomas Herzog <thomas.herzog@mail.com> | 2018-01-17 08:42:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-17 08:42:09 +0100 |
| commit | b9b06b5fbcd58a63c01eef6784f6082f528a1e3f (patch) | |
| tree | 7aa5c5c2d477a92f1b5f7f91aa9296d039595b3c /src/core/Dictionary.cpp | |
| parent | 7dde412e26315447edf2f46661143082b5becf32 (diff) | |
| parent | 00f089d7edafa53a5018054f9662a36a695ad8b9 (diff) | |
| download | redot-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/Dictionary.cpp')
| -rw-r--r-- | src/core/Dictionary.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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); |
