Add fill method to Arrays and PackedArrays

This commit is contained in:
Matheus Lima Cunha
2021-02-25 11:10:39 -03:00
parent e271dba9cb
commit efd27a63c1
14 changed files with 127 additions and 0 deletions

View File

@@ -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);