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:
m
2018-07-30 00:04:32 -04:00
parent 451e5fd051
commit bf1867aaab
4 changed files with 23 additions and 0 deletions

View File

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