diff options
author | Thomas Herzog <thomas.herzog@mail.com> | 2019-08-05 10:39:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-05 10:39:56 +0200 |
commit | c2ec46f64a24de9a46b06c3e987c306f549ccadb (patch) | |
tree | c47c280be3a9638536011440b75bdc99dfe9b578 /src/core/Array.cpp | |
parent | cdd50260d0c2bd620f15d16e2e00a4d8c965eb67 (diff) | |
parent | b895d3c3264dd52312e65af01e34ed04bbf86222 (diff) | |
download | redot-cpp-c2ec46f64a24de9a46b06c3e987c306f549ccadb.tar.gz |
Merge pull request #296 from lupoDharkael/missing
Add missing class methods
Diffstat (limited to 'src/core/Array.cpp')
-rw-r--r-- | src/core/Array.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/core/Array.cpp b/src/core/Array.cpp index 9737275..676eba5 100644 --- a/src/core/Array.cpp +++ b/src/core/Array.cpp @@ -158,6 +158,35 @@ void Array::sort_custom(Object *obj, const String &func) { godot::api->godot_array_sort_custom(&_godot_array, (godot_object *)obj, (godot_string *)&func); } +int Array::bsearch(const Variant &value, const bool before) { + return godot::api->godot_array_bsearch(&_godot_array, (godot_variant *)&value, before); +} + +int Array::bsearch_custom(const Variant &value, const Object *obj, + const String &func, const bool before) { + return godot::api->godot_array_bsearch_custom(&_godot_array, (godot_variant *)&value, + (godot_object *)obj, (godot_string *)&func, before); +} + +Array Array::duplicate(const bool deep) const { + godot_array arr = godot::core_1_1_api->godot_array_duplicate(&_godot_array, deep); + return *(Array *)&arr; +} + +Variant Array::max() const { + godot_variant v = godot::core_1_1_api->godot_array_max(&_godot_array); + return *(Variant *)&v; +} + +Variant Array::min() const { + godot_variant v = godot::core_1_1_api->godot_array_min(&_godot_array); + return *(Variant *)&v; +} + +void Array::shuffle() { + godot::core_1_1_api->godot_array_shuffle(&_godot_array); +} + Array::~Array() { godot::api->godot_array_destroy(&_godot_array); } |