From 023b1d7f5a60b5833f7e2030fade6cc1cff54eba Mon Sep 17 00:00:00 2001 From: George Marques Date: Tue, 17 May 2022 14:14:42 -0300 Subject: Implement read-only arrays Arrays can be set as read-only and thus cannot be modified. Assigning the array will create an editable copy. Similar to is already done to read-only dictionaries. --- core/variant/array.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/variant/array.h') diff --git a/core/variant/array.h b/core/variant/array.h index ab5f7cd50f..f537700f99 100644 --- a/core/variant/array.h +++ b/core/variant/array.h @@ -125,6 +125,10 @@ public: uint32_t get_typed_builtin() const; StringName get_typed_class_name() const; Variant get_typed_script() const; + + void set_read_only(bool p_enable); + bool is_read_only() const; + Array(const Array &p_from); Array(); ~Array(); -- cgit v1.2.3