Implement read-only dictionaries.

* Add ability to set them read only.
* If read-only, it can't be modified.

This is added in order to optionally make const dictionaries (and eventually arrays) properly read-only in GDScript.
This commit is contained in:
reduz 2022-05-16 15:44:43 +02:00
parent c41f62c3df
commit e6c443a353
3 changed files with 71 additions and 5 deletions

View file

@ -84,6 +84,9 @@ public:
Dictionary duplicate(bool p_deep = false) const;
Dictionary recursive_duplicate(bool p_deep, int recursion_count) const;
void set_read_only(bool p_enable);
bool is_read_only() const;
const void *id() const;
Dictionary(const Dictionary &p_from);