summaryrefslogtreecommitdiffstats
path: root/core/variant/array.cpp
diff options
context:
space:
mode:
authorMatheus Lima Cunha <matheus.limacunha@hotmail.com>2021-02-25 11:10:39 -0300
committerMatheus Lima Cunha <matheus.limacunha@hotmail.com>2021-04-21 11:33:53 -0300
commitefd27a63c138ceef89d4ed2586651ea61898f5c7 (patch)
treed2e0b2327d2786e4b8d8d941cd3358248cbe09d1 /core/variant/array.cpp
parente271dba9cb0b52698c23f5d61f3b8e72f2b7d29d (diff)
downloadredot-engine-efd27a63c138ceef89d4ed2586651ea61898f5c7.tar.gz
Add fill method to Arrays and PackedArrays
Diffstat (limited to 'core/variant/array.cpp')
-rw-r--r--core/variant/array.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/variant/array.cpp b/core/variant/array.cpp
index 2ad728ec5e..2fb2dd4a30 100644
--- a/core/variant/array.cpp
+++ b/core/variant/array.cpp
@@ -208,6 +208,11 @@ void Array::insert(int p_pos, const Variant &p_value) {
_p->array.insert(p_pos, p_value);
}
+void Array::fill(const Variant &p_value) {
+ ERR_FAIL_COND(!_p->typed.validate(p_value, "fill"));
+ _p->array.fill(p_value);
+}
+
void Array::erase(const Variant &p_value) {
ERR_FAIL_COND(!_p->typed.validate(p_value, "erase"));
_p->array.erase(p_value);