Added Python-like .get() method to Dictionary in GDScript #20488
Added .get() method to Dictionary class in GDScript to return the value if the key exists, or return Null if the key does not exist.
This commit is contained in:
@ -58,6 +58,7 @@ public:
|
||||
Variant *getptr(const Variant &p_key);
|
||||
|
||||
Variant get_valid(const Variant &p_key) const;
|
||||
Variant get(const Variant &p_key, const Variant &p_default) const;
|
||||
|
||||
int size() const;
|
||||
bool empty() const;
|
||||
|
||||
Reference in New Issue
Block a user