diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2021-11-23 10:07:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-23 10:07:07 +0100 |
commit | adbc0bfe00322c3569ddacaef43dc43d3e731a49 (patch) | |
tree | 4784c992ba7e0dd538e1959293b5f239576810b9 /test/src/example.cpp | |
parent | 5cacce7a26b6b31600c063344f1fb52aef2382ef (diff) | |
parent | b008810c0121e0a365a41615c48b40934aae9a29 (diff) | |
download | redot-cpp-adbc0bfe00322c3569ddacaef43dc43d3e731a49.tar.gz |
Merge pull request #656 from BastiaanOlij/dictionary_index
Diffstat (limited to 'test/src/example.cpp')
-rw-r--r-- | test/src/example.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/src/example.cpp b/test/src/example.cpp index e2a6ceb..ad82103 100644 --- a/test/src/example.cpp +++ b/test/src/example.cpp @@ -54,7 +54,9 @@ void Example::_bind_methods() { ClassDB::bind_method(D_METHOD("return_something_const"), &Example::return_something_const); ClassDB::bind_method(D_METHOD("return_extended_ref"), &Example::return_extended_ref); ClassDB::bind_method(D_METHOD("extended_ref_checks"), &Example::extended_ref_checks); + ClassDB::bind_method(D_METHOD("test_array"), &Example::test_array); + ClassDB::bind_method(D_METHOD("test_dictionary"), &Example::test_dictionary); { MethodInfo mi; @@ -145,6 +147,15 @@ Array Example::test_array() const { return arr; } +Dictionary Example::test_dictionary() const { + Dictionary dict; + + dict["hello"] = "world"; + dict["foo"] = "bar"; + + return dict; +} + // Properties. void Example::set_custom_position(const Vector2 &pos) { custom_position = pos; |