Added copy constructors and assignment operators to Array and Dictionary

This commit is contained in:
Marc Gilleron
2018-01-17 01:57:01 +01:00
parent 7dde412e26
commit 00f089d7ed
4 changed files with 28 additions and 0 deletions

View File

@@ -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);