GDScript: Fix issues with typed arrays

This commit is contained in:
Dmitrii Maganov
2022-11-27 09:56:53 +02:00
parent e9de988020
commit 5909f9f075
50 changed files with 959 additions and 555 deletions

View File

@ -59,14 +59,14 @@
<param index="2" name="class_name" type="StringName" />
<param index="3" name="script" type="Variant" />
<description>
Creates a typed array from the [param base] array. The base array can't be already typed.
Creates a typed array from the [param base] array.
</description>
</constructor>
<constructor name="Array">
<return type="Array" />
<param index="0" name="from" type="Array" />
<description>
Constructs an [Array] as a copy of the given [Array].
Returns the same array as [param from]. If you need a copy of the array, use [method duplicate].
</description>
</constructor>
<constructor name="Array">
@ -200,6 +200,13 @@
[/codeblock]
</description>
</method>
<method name="assign">
<return type="void" />
<param index="0" name="array" type="Array" />
<description>
Assigns elements of another [param array] into the array. Resizes the array to match [param array]. Performs type conversions if the array is typed.
</description>
</method>
<method name="back" qualifiers="const">
<return type="Variant" />
<description>
@ -395,6 +402,13 @@
Returns [code]true[/code] if the array is read-only. See [method make_read_only]. Arrays 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="array" type="Array" />
<description>
Returns [code]true[/code] if the array is typed the same as [param array].
</description>
</method>
<method name="is_typed" qualifiers="const">
<return type="bool" />
<description>
@ -609,13 +623,6 @@
[/codeblocks]
</description>
</method>
<method name="typed_assign">
<return type="bool" />
<param index="0" name="array" type="Array" />
<description>
Assigns a different [Array] to this array reference. It the array is typed, the new array's type must be compatible and its elements will be automatically converted.
</description>
</method>
</methods>
<operators>
<operator name="operator !=">