diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-02-19 21:53:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-19 21:53:08 +0100 |
commit | 37a6ce5a4245cd4383d4b783a6348b8d87a27070 (patch) | |
tree | 25d4cf88d7789354fc16c0bca8cf645760195146 /core/variant_call.cpp | |
parent | 5933cf867a1819c5ccc4f531712971307d9dc6db (diff) | |
parent | 75d69fb4ecfe3bc925bd27700782d884e88369cc (diff) | |
download | redot-engine-37a6ce5a4245cd4383d4b783a6348b8d87a27070.tar.gz |
Merge pull request #15563 from poke1024/gdscript-shuffle
Add shuffle() method to Array
Diffstat (limited to 'core/variant_call.cpp')
-rw-r--r-- | core/variant_call.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 2764ca3975..d1d45f0e7c 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -491,6 +491,7 @@ struct _VariantCall { VCALL_LOCALMEM1(Array, erase); VCALL_LOCALMEM0(Array, sort); VCALL_LOCALMEM2(Array, sort_custom); + VCALL_LOCALMEM0(Array, shuffle); VCALL_LOCALMEM2R(Array, bsearch); VCALL_LOCALMEM4R(Array, bsearch_custom); VCALL_LOCALMEM0R(Array, duplicate); @@ -1636,6 +1637,7 @@ void register_variant_methods() { ADDFUNC0RNC(ARRAY, NIL, Array, pop_front, varray()); ADDFUNC0NC(ARRAY, NIL, Array, sort, varray()); ADDFUNC2NC(ARRAY, NIL, Array, sort_custom, OBJECT, "obj", STRING, "func", varray()); + ADDFUNC0NC(ARRAY, NIL, Array, shuffle, varray()); ADDFUNC2R(ARRAY, INT, Array, bsearch, NIL, "value", BOOL, "before", varray(true)); ADDFUNC4R(ARRAY, INT, Array, bsearch_custom, NIL, "value", OBJECT, "obj", STRING, "func", BOOL, "before", varray(true)); ADDFUNC0NC(ARRAY, NIL, Array, invert, varray()); |