summaryrefslogtreecommitdiffstats
path: root/core/variant/variant_call.cpp
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-08-27 00:51:17 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2021-08-27 00:51:17 +0200
commit60116b17b59c5e137924a9669ddc9bbe58a58ef7 (patch)
treeedb9982ec21c2c48fad5b49837a5bcf7cdf1e5e4 /core/variant/variant_call.cpp
parent98d55ba66f16ce5b5a5340c62a65865a45337aed (diff)
downloadredot-engine-60116b17b59c5e137924a9669ddc9bbe58a58ef7.tar.gz
Add an `Array.pop_at()` method to pop an element at an arbitrary index
Negative indices are supported to pop an element relative from the end.
Diffstat (limited to 'core/variant/variant_call.cpp')
-rw-r--r--core/variant/variant_call.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp
index a4817eb7d2..382b256c08 100644
--- a/core/variant/variant_call.cpp
+++ b/core/variant/variant_call.cpp
@@ -1807,6 +1807,7 @@ static void _register_variant_builtin_methods() {
bind_method(Array, has, sarray("value"), varray());
bind_method(Array, pop_back, sarray(), varray());
bind_method(Array, pop_front, sarray(), varray());
+ bind_method(Array, pop_at, sarray("position"), varray());
bind_method(Array, sort, sarray(), varray());
bind_method(Array, sort_custom, sarray("func"), varray());
bind_method(Array, shuffle, sarray(), varray());