diff options
author | m <malcolm.g.howard@gmail.com> | 2018-07-30 00:04:32 -0400 |
---|---|---|
committer | m <malcolm.g.howard@gmail.com> | 2018-11-19 14:03:13 -0500 |
commit | bf1867aaab8d34ee2524f5b703214bb1c2684eb7 (patch) | |
tree | 8a7bb25d39118e5f933d815e3533f6ddaace4eb6 /doc | |
parent | 451e5fd0511bc2c17a66fc73a0de9a5169109517 (diff) |
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.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/Dictionary.xml | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 06c996e13e..cc58c56404 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -87,6 +87,17 @@ Return the list of values in the [code]Dictionary[/code]. </description> </method> + <method name="get"> + <return type="Variant"> + </return> + <argument index="0" name="key" type="Variant"> + </argument> + <argument index="1" name="default" type="Variant" default="null"> + </argument> + <description> + Returns the current value for the specified key in the [code]Dictionary[/code]. If the key does not exist, the method returns the value of the optional default argument, or Null if it is omitted. + </description> + </method> </methods> <constants> </constants> |