feat: updated engine version to 4.4-rc1
This commit is contained in:
parent
ee00efde1f
commit
21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions
|
|
@ -148,6 +148,19 @@
|
|||
Constructs an empty [Dictionary].
|
||||
</description>
|
||||
</constructor>
|
||||
<constructor name="Dictionary">
|
||||
<return type="Dictionary" />
|
||||
<param index="0" name="base" type="Dictionary" />
|
||||
<param index="1" name="key_type" type="int" />
|
||||
<param index="2" name="key_class_name" type="StringName" />
|
||||
<param index="3" name="key_script" type="Variant" />
|
||||
<param index="4" name="value_type" type="int" />
|
||||
<param index="5" name="value_class_name" type="StringName" />
|
||||
<param index="6" name="value_script" type="Variant" />
|
||||
<description>
|
||||
Creates a typed dictionary from the [param base] dictionary. A typed dictionary can only contain keys and values of the given types, or that inherit from the given classes, as described by this constructor's parameters.
|
||||
</description>
|
||||
</constructor>
|
||||
<constructor name="Dictionary">
|
||||
<return type="Dictionary" />
|
||||
<param index="0" name="from" type="Dictionary" />
|
||||
|
|
@ -157,6 +170,13 @@
|
|||
</constructor>
|
||||
</constructors>
|
||||
<methods>
|
||||
<method name="assign">
|
||||
<return type="void" />
|
||||
<param index="0" name="dictionary" type="Dictionary" />
|
||||
<description>
|
||||
Assigns elements of another [param dictionary] into the dictionary. Resizes the dictionary to match [param dictionary]. Performs type conversions if the dictionary is typed.
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear">
|
||||
<return type="void" />
|
||||
<description>
|
||||
|
|
@ -202,6 +222,42 @@
|
|||
Gets a value and ensures the key is set. If the [param key] exists in the dictionary, this behaves like [method get]. Otherwise, the [param default] value is inserted into the dictionary and returned.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_typed_key_builtin" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
Returns the built-in [Variant] type of the typed dictionary's keys as a [enum Variant.Type] constant. If the keys are not typed, returns [constant TYPE_NIL]. See also [method is_typed_key].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_typed_key_class_name" qualifiers="const">
|
||||
<return type="StringName" />
|
||||
<description>
|
||||
Returns the [b]built-in[/b] class name of the typed dictionary's keys, if the built-in [Variant] type is [constant TYPE_OBJECT]. Otherwise, returns an empty [StringName]. See also [method is_typed_key] and [method Object.get_class].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_typed_key_script" qualifiers="const">
|
||||
<return type="Variant" />
|
||||
<description>
|
||||
Returns the [Script] instance associated with this typed dictionary's keys, or [code]null[/code] if it does not exist. See also [method is_typed_key].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_typed_value_builtin" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
Returns the built-in [Variant] type of the typed dictionary's values as a [enum Variant.Type] constant. If the values are not typed, returns [constant TYPE_NIL]. See also [method is_typed_value].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_typed_value_class_name" qualifiers="const">
|
||||
<return type="StringName" />
|
||||
<description>
|
||||
Returns the [b]built-in[/b] class name of the typed dictionary's values, if the built-in [Variant] type is [constant TYPE_OBJECT]. Otherwise, returns an empty [StringName]. See also [method is_typed_value] and [method Object.get_class].
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_typed_value_script" qualifiers="const">
|
||||
<return type="Variant" />
|
||||
<description>
|
||||
Returns the [Script] instance associated with this typed dictionary's values, or [code]null[/code] if it does not exist. See also [method is_typed_value].
|
||||
</description>
|
||||
</method>
|
||||
<method name="has" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<param index="0" name="key" type="Variant" />
|
||||
|
|
@ -225,9 +281,9 @@
|
|||
{ 210, default },
|
||||
};
|
||||
|
||||
GD.Print(myDict.ContainsKey("Godot")); // Prints true
|
||||
GD.Print(myDict.ContainsKey(210)); // Prints true
|
||||
GD.Print(myDict.ContainsKey(4)); // Prints false
|
||||
GD.Print(myDict.ContainsKey("Godot")); // Prints True
|
||||
GD.Print(myDict.ContainsKey(210)); // Prints True
|
||||
GD.Print(myDict.ContainsKey(4)); // Prints False
|
||||
[/csharp]
|
||||
[/codeblocks]
|
||||
In GDScript, this is equivalent to the [code]in[/code] operator:
|
||||
|
|
@ -265,7 +321,7 @@
|
|||
var dict2 = new Godot.Collections.Dictionary{{"A", 10}, {"B", 2}};
|
||||
|
||||
// Godot.Collections.Dictionary has no Hash() method. Use GD.Hash() instead.
|
||||
GD.Print(GD.Hash(dict1) == GD.Hash(dict2)); // Prints true
|
||||
GD.Print(GD.Hash(dict1) == GD.Hash(dict2)); // Prints True
|
||||
[/csharp]
|
||||
[/codeblocks]
|
||||
[b]Note:[/b] Dictionaries with the same entries but in a different order will not have the same hash.
|
||||
|
|
@ -284,6 +340,45 @@
|
|||
Returns [code]true[/code] if the dictionary is read-only. See [method make_read_only]. Dictionaries are automatically read-only if declared with [code]const[/code] keyword.
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_same_typed" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<param index="0" name="dictionary" type="Dictionary" />
|
||||
<description>
|
||||
Returns [code]true[/code] if the dictionary is typed the same as [param dictionary].
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_same_typed_key" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<param index="0" name="dictionary" type="Dictionary" />
|
||||
<description>
|
||||
Returns [code]true[/code] if the dictionary's keys are typed the same as [param dictionary]'s keys.
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_same_typed_value" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<param index="0" name="dictionary" type="Dictionary" />
|
||||
<description>
|
||||
Returns [code]true[/code] if the dictionary's values are typed the same as [param dictionary]'s values.
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_typed" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<description>
|
||||
Returns [code]true[/code] if the dictionary is typed. Typed dictionaries can only store keys/values of their associated type and provide type safety for the [code][][/code] operator. Methods of typed dictionary still return [Variant].
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_typed_key" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<description>
|
||||
Returns [code]true[/code] if the dictionary's keys are typed.
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_typed_value" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<description>
|
||||
Returns [code]true[/code] if the dictionary's values are typed.
|
||||
</description>
|
||||
</method>
|
||||
<method name="keys" qualifiers="const">
|
||||
<return type="Array" />
|
||||
<description>
|
||||
|
|
@ -365,12 +460,26 @@
|
|||
Returns [code]true[/code] if the two dictionaries contain the same keys and values, inner [Dictionary] and [Array] keys and values are compared recursively.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set">
|
||||
<return type="bool" />
|
||||
<param index="0" name="key" type="Variant" />
|
||||
<param index="1" name="value" type="Variant" />
|
||||
<description>
|
||||
Sets the value of the element at the given [param key] to the given [param value]. This is the same as using the [code][][/code] operator ([code]array[index] = value[/code]).
|
||||
</description>
|
||||
</method>
|
||||
<method name="size" qualifiers="const">
|
||||
<return type="int" />
|
||||
<description>
|
||||
Returns the number of entries in the dictionary. Empty dictionaries ([code]{ }[/code]) always return [code]0[/code]. See also [method is_empty].
|
||||
</description>
|
||||
</method>
|
||||
<method name="sort">
|
||||
<return type="void" />
|
||||
<description>
|
||||
Sorts the dictionary in-place by key. This can be used to ensure dictionaries with the same contents produce equivalent results when getting the [method keys], getting the [method values], and converting to a string. This is also useful when wanting a JSON representation consistent with what is in memory, and useful for storing on a database that requires dictionaries to be sorted.
|
||||
</description>
|
||||
</method>
|
||||
<method name="values" qualifiers="const">
|
||||
<return type="Array" />
|
||||
<description>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue