doc: Sync classref with apparent Variant return type changes

Part of those seem bogus, methods like Array.back()/front()
should return a Variant and not void.
This commit is contained in:
Rémi Verschelde 2020-02-22 15:16:32 +01:00
parent fea37cfb52
commit 048f4f8305
12 changed files with 139 additions and 11 deletions

View File

@ -83,6 +83,8 @@
</description> </description>
</method> </method>
<method name="append"> <method name="append">
<return type="void">
</return>
<argument index="0" name="value" type="Variant"> <argument index="0" name="value" type="Variant">
</argument> </argument>
<description> <description>
@ -90,7 +92,7 @@
</description> </description>
</method> </method>
<method name="back"> <method name="back">
<return type="Variant"> <return type="void">
</return> </return>
<description> <description>
Returns the last element of the array, or [code]null[/code] if the array is empty. Returns the last element of the array, or [code]null[/code] if the array is empty.
@ -125,6 +127,8 @@
</description> </description>
</method> </method>
<method name="clear"> <method name="clear">
<return type="void">
</return>
<description> <description>
Clears the array. This is equivalent to using [method resize] with a size of [code]0[/code]. Clears the array. This is equivalent to using [method resize] with a size of [code]0[/code].
</description> </description>
@ -156,6 +160,8 @@
</description> </description>
</method> </method>
<method name="erase"> <method name="erase">
<return type="void">
</return>
<argument index="0" name="value" type="Variant"> <argument index="0" name="value" type="Variant">
</argument> </argument>
<description> <description>
@ -183,7 +189,7 @@
</description> </description>
</method> </method>
<method name="front"> <method name="front">
<return type="Variant"> <return type="void">
</return> </return>
<description> <description>
Returns the first element of the array, or [code]null[/code] if the array is empty. Returns the first element of the array, or [code]null[/code] if the array is empty.
@ -212,6 +218,8 @@
</description> </description>
</method> </method>
<method name="insert"> <method name="insert">
<return type="void">
</return>
<argument index="0" name="position" type="int"> <argument index="0" name="position" type="int">
</argument> </argument>
<argument index="1" name="value" type="Variant"> <argument index="1" name="value" type="Variant">
@ -221,39 +229,43 @@
</description> </description>
</method> </method>
<method name="invert"> <method name="invert">
<return type="void">
</return>
<description> <description>
Reverses the order of the elements in the array. Reverses the order of the elements in the array.
</description> </description>
</method> </method>
<method name="max"> <method name="max">
<return type="Variant"> <return type="void">
</return> </return>
<description> <description>
Returns the maximum value contained in the array if all elements are of comparable types. If the elements can't be compared, [code]null[/code] is returned. Returns the maximum value contained in the array if all elements are of comparable types. If the elements can't be compared, [code]null[/code] is returned.
</description> </description>
</method> </method>
<method name="min"> <method name="min">
<return type="Variant"> <return type="void">
</return> </return>
<description> <description>
Returns the minimum value contained in the array if all elements are of comparable types. If the elements can't be compared, [code]null[/code] is returned. Returns the minimum value contained in the array if all elements are of comparable types. If the elements can't be compared, [code]null[/code] is returned.
</description> </description>
</method> </method>
<method name="pop_back"> <method name="pop_back">
<return type="Variant"> <return type="void">
</return> </return>
<description> <description>
Removes and returns the last element of the array. Returns [code]null[/code] if the array is empty. Removes and returns the last element of the array. Returns [code]null[/code] if the array is empty.
</description> </description>
</method> </method>
<method name="pop_front"> <method name="pop_front">
<return type="Variant"> <return type="void">
</return> </return>
<description> <description>
Removes and returns the first element of the array. Returns [code]null[/code] if the array is empty. Removes and returns the first element of the array. Returns [code]null[/code] if the array is empty.
</description> </description>
</method> </method>
<method name="push_back"> <method name="push_back">
<return type="void">
</return>
<argument index="0" name="value" type="Variant"> <argument index="0" name="value" type="Variant">
</argument> </argument>
<description> <description>
@ -261,6 +273,8 @@
</description> </description>
</method> </method>
<method name="push_front"> <method name="push_front">
<return type="void">
</return>
<argument index="0" name="value" type="Variant"> <argument index="0" name="value" type="Variant">
</argument> </argument>
<description> <description>
@ -268,6 +282,8 @@
</description> </description>
</method> </method>
<method name="remove"> <method name="remove">
<return type="void">
</return>
<argument index="0" name="position" type="int"> <argument index="0" name="position" type="int">
</argument> </argument>
<description> <description>
@ -275,6 +291,8 @@
</description> </description>
</method> </method>
<method name="resize"> <method name="resize">
<return type="void">
</return>
<argument index="0" name="size" type="int"> <argument index="0" name="size" type="int">
</argument> </argument>
<description> <description>
@ -293,6 +311,8 @@
</description> </description>
</method> </method>
<method name="shuffle"> <method name="shuffle">
<return type="void">
</return>
<description> <description>
Shuffles the array such that the items will have a random order. This method uses the global random number generator common to methods such as [method @GDScript.randi]. Call [method @GDScript.randomize] to ensure that a new seed will be used each time if you want non-reproducible shuffling. Shuffles the array such that the items will have a random order. This method uses the global random number generator common to methods such as [method @GDScript.randi]. Call [method @GDScript.randomize] to ensure that a new seed will be used each time if you want non-reproducible shuffling.
</description> </description>
@ -320,6 +340,8 @@
</description> </description>
</method> </method>
<method name="sort"> <method name="sort">
<return type="void">
</return>
<description> <description>
Sorts the array. Sorts the array.
[b]Note:[/b] Strings are sorted in alphabetical order (as opposed to natural order). This may lead to unexpected behavior when sorting an array of strings ending with a sequence of numbers. Consider the following example: [b]Note:[/b] Strings are sorted in alphabetical order (as opposed to natural order). This may lead to unexpected behavior when sorting an array of strings ending with a sequence of numbers. Consider the following example:
@ -331,6 +353,8 @@
</description> </description>
</method> </method>
<method name="sort_custom"> <method name="sort_custom">
<return type="void">
</return>
<argument index="0" name="obj" type="Object"> <argument index="0" name="obj" type="Object">
</argument> </argument>
<argument index="1" name="func" type="String"> <argument index="1" name="func" type="String">

View File

@ -66,6 +66,8 @@
</tutorials> </tutorials>
<methods> <methods>
<method name="clear"> <method name="clear">
<return type="void">
</return>
<description> <description>
Clear the dictionary, removing all key/value pairs. Clear the dictionary, removing all key/value pairs.
</description> </description>
@ -96,7 +98,7 @@
</description> </description>
</method> </method>
<method name="get"> <method name="get">
<return type="Variant"> <return type="void">
</return> </return>
<argument index="0" name="key" type="Variant"> <argument index="0" name="key" type="Variant">
</argument> </argument>

View File

@ -20,6 +20,8 @@
</description> </description>
</method> </method>
<method name="append"> <method name="append">
<return type="void">
</return>
<argument index="0" name="byte" type="int"> <argument index="0" name="byte" type="int">
</argument> </argument>
<description> <description>
@ -27,6 +29,8 @@
</description> </description>
</method> </method>
<method name="append_array"> <method name="append_array">
<return type="void">
</return>
<argument index="0" name="array" type="PackedByteArray"> <argument index="0" name="array" type="PackedByteArray">
</argument> </argument>
<description> <description>
@ -97,11 +101,15 @@
</description> </description>
</method> </method>
<method name="invert"> <method name="invert">
<return type="void">
</return>
<description> <description>
Reverses the order of the elements in the array. Reverses the order of the elements in the array.
</description> </description>
</method> </method>
<method name="push_back"> <method name="push_back">
<return type="void">
</return>
<argument index="0" name="byte" type="int"> <argument index="0" name="byte" type="int">
</argument> </argument>
<description> <description>
@ -109,6 +117,8 @@
</description> </description>
</method> </method>
<method name="remove"> <method name="remove">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
@ -116,6 +126,8 @@
</description> </description>
</method> </method>
<method name="resize"> <method name="resize">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
@ -123,6 +135,8 @@
</description> </description>
</method> </method>
<method name="set"> <method name="set">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<argument index="1" name="byte" type="int"> <argument index="1" name="byte" type="int">

View File

@ -20,6 +20,8 @@
</description> </description>
</method> </method>
<method name="append"> <method name="append">
<return type="void">
</return>
<argument index="0" name="color" type="Color"> <argument index="0" name="color" type="Color">
</argument> </argument>
<description> <description>
@ -27,6 +29,8 @@
</description> </description>
</method> </method>
<method name="append_array"> <method name="append_array">
<return type="void">
</return>
<argument index="0" name="array" type="PackedColorArray"> <argument index="0" name="array" type="PackedColorArray">
</argument> </argument>
<description> <description>
@ -52,11 +56,15 @@
</description> </description>
</method> </method>
<method name="invert"> <method name="invert">
<return type="void">
</return>
<description> <description>
Reverses the order of the elements in the array. Reverses the order of the elements in the array.
</description> </description>
</method> </method>
<method name="push_back"> <method name="push_back">
<return type="void">
</return>
<argument index="0" name="color" type="Color"> <argument index="0" name="color" type="Color">
</argument> </argument>
<description> <description>
@ -64,6 +72,8 @@
</description> </description>
</method> </method>
<method name="remove"> <method name="remove">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
@ -71,6 +81,8 @@
</description> </description>
</method> </method>
<method name="resize"> <method name="resize">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
@ -78,6 +90,8 @@
</description> </description>
</method> </method>
<method name="set"> <method name="set">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<argument index="1" name="color" type="Color"> <argument index="1" name="color" type="Color">

View File

@ -21,6 +21,8 @@
</description> </description>
</method> </method>
<method name="append"> <method name="append">
<return type="void">
</return>
<argument index="0" name="integer" type="int"> <argument index="0" name="integer" type="int">
</argument> </argument>
<description> <description>
@ -28,6 +30,8 @@
</description> </description>
</method> </method>
<method name="append_array"> <method name="append_array">
<return type="void">
</return>
<argument index="0" name="array" type="PackedIntArray"> <argument index="0" name="array" type="PackedIntArray">
</argument> </argument>
<description> <description>
@ -53,11 +57,15 @@
</description> </description>
</method> </method>
<method name="invert"> <method name="invert">
<return type="void">
</return>
<description> <description>
Reverses the order of the elements in the array. Reverses the order of the elements in the array.
</description> </description>
</method> </method>
<method name="push_back"> <method name="push_back">
<return type="void">
</return>
<argument index="0" name="integer" type="int"> <argument index="0" name="integer" type="int">
</argument> </argument>
<description> <description>
@ -65,6 +73,8 @@
</description> </description>
</method> </method>
<method name="remove"> <method name="remove">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
@ -72,6 +82,8 @@
</description> </description>
</method> </method>
<method name="resize"> <method name="resize">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
@ -79,6 +91,8 @@
</description> </description>
</method> </method>
<method name="set"> <method name="set">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<argument index="1" name="integer" type="int"> <argument index="1" name="integer" type="int">

View File

@ -20,6 +20,8 @@
</description> </description>
</method> </method>
<method name="append"> <method name="append">
<return type="void">
</return>
<argument index="0" name="value" type="float"> <argument index="0" name="value" type="float">
</argument> </argument>
<description> <description>
@ -27,6 +29,8 @@
</description> </description>
</method> </method>
<method name="append_array"> <method name="append_array">
<return type="void">
</return>
<argument index="0" name="array" type="PackedRealArray"> <argument index="0" name="array" type="PackedRealArray">
</argument> </argument>
<description> <description>
@ -52,11 +56,15 @@
</description> </description>
</method> </method>
<method name="invert"> <method name="invert">
<return type="void">
</return>
<description> <description>
Reverses the order of the elements in the array. Reverses the order of the elements in the array.
</description> </description>
</method> </method>
<method name="push_back"> <method name="push_back">
<return type="void">
</return>
<argument index="0" name="value" type="float"> <argument index="0" name="value" type="float">
</argument> </argument>
<description> <description>
@ -64,6 +72,8 @@
</description> </description>
</method> </method>
<method name="remove"> <method name="remove">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
@ -71,6 +81,8 @@
</description> </description>
</method> </method>
<method name="resize"> <method name="resize">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
@ -78,6 +90,8 @@
</description> </description>
</method> </method>
<method name="set"> <method name="set">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<argument index="1" name="value" type="float"> <argument index="1" name="value" type="float">

View File

@ -20,6 +20,8 @@
</description> </description>
</method> </method>
<method name="append"> <method name="append">
<return type="void">
</return>
<argument index="0" name="string" type="String"> <argument index="0" name="string" type="String">
</argument> </argument>
<description> <description>
@ -27,6 +29,8 @@
</description> </description>
</method> </method>
<method name="append_array"> <method name="append_array">
<return type="void">
</return>
<argument index="0" name="array" type="PackedStringArray"> <argument index="0" name="array" type="PackedStringArray">
</argument> </argument>
<description> <description>
@ -52,11 +56,15 @@
</description> </description>
</method> </method>
<method name="invert"> <method name="invert">
<return type="void">
</return>
<description> <description>
Reverses the order of the elements in the array. Reverses the order of the elements in the array.
</description> </description>
</method> </method>
<method name="push_back"> <method name="push_back">
<return type="void">
</return>
<argument index="0" name="string" type="String"> <argument index="0" name="string" type="String">
</argument> </argument>
<description> <description>
@ -64,6 +72,8 @@
</description> </description>
</method> </method>
<method name="remove"> <method name="remove">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
@ -71,6 +81,8 @@
</description> </description>
</method> </method>
<method name="resize"> <method name="resize">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
@ -78,6 +90,8 @@
</description> </description>
</method> </method>
<method name="set"> <method name="set">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<argument index="1" name="string" type="String"> <argument index="1" name="string" type="String">

View File

@ -20,6 +20,8 @@
</description> </description>
</method> </method>
<method name="append"> <method name="append">
<return type="void">
</return>
<argument index="0" name="vector2" type="Vector2"> <argument index="0" name="vector2" type="Vector2">
</argument> </argument>
<description> <description>
@ -27,6 +29,8 @@
</description> </description>
</method> </method>
<method name="append_array"> <method name="append_array">
<return type="void">
</return>
<argument index="0" name="array" type="PackedVector2Array"> <argument index="0" name="array" type="PackedVector2Array">
</argument> </argument>
<description> <description>
@ -52,11 +56,15 @@
</description> </description>
</method> </method>
<method name="invert"> <method name="invert">
<return type="void">
</return>
<description> <description>
Reverses the order of the elements in the array. Reverses the order of the elements in the array.
</description> </description>
</method> </method>
<method name="push_back"> <method name="push_back">
<return type="void">
</return>
<argument index="0" name="vector2" type="Vector2"> <argument index="0" name="vector2" type="Vector2">
</argument> </argument>
<description> <description>
@ -64,6 +72,8 @@
</description> </description>
</method> </method>
<method name="remove"> <method name="remove">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
@ -71,6 +81,8 @@
</description> </description>
</method> </method>
<method name="resize"> <method name="resize">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
@ -78,6 +90,8 @@
</description> </description>
</method> </method>
<method name="set"> <method name="set">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<argument index="1" name="vector2" type="Vector2"> <argument index="1" name="vector2" type="Vector2">

View File

@ -20,6 +20,8 @@
</description> </description>
</method> </method>
<method name="append"> <method name="append">
<return type="void">
</return>
<argument index="0" name="vector3" type="Vector3"> <argument index="0" name="vector3" type="Vector3">
</argument> </argument>
<description> <description>
@ -27,6 +29,8 @@
</description> </description>
</method> </method>
<method name="append_array"> <method name="append_array">
<return type="void">
</return>
<argument index="0" name="array" type="PackedVector3Array"> <argument index="0" name="array" type="PackedVector3Array">
</argument> </argument>
<description> <description>
@ -52,11 +56,15 @@
</description> </description>
</method> </method>
<method name="invert"> <method name="invert">
<return type="void">
</return>
<description> <description>
Reverses the order of the elements in the array. Reverses the order of the elements in the array.
</description> </description>
</method> </method>
<method name="push_back"> <method name="push_back">
<return type="void">
</return>
<argument index="0" name="vector3" type="Vector3"> <argument index="0" name="vector3" type="Vector3">
</argument> </argument>
<description> <description>
@ -64,6 +72,8 @@
</description> </description>
</method> </method>
<method name="remove"> <method name="remove">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
@ -71,6 +81,8 @@
</description> </description>
</method> </method>
<method name="resize"> <method name="resize">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<description> <description>
@ -78,6 +90,8 @@
</description> </description>
</method> </method>
<method name="set"> <method name="set">
<return type="void">
</return>
<argument index="0" name="idx" type="int"> <argument index="0" name="idx" type="int">
</argument> </argument>
<argument index="1" name="vector3" type="Vector3"> <argument index="1" name="vector3" type="Vector3">

View File

@ -132,6 +132,8 @@
</description> </description>
</method> </method>
<method name="set_axis_angle"> <method name="set_axis_angle">
<return type="void">
</return>
<argument index="0" name="axis" type="Vector3"> <argument index="0" name="axis" type="Vector3">
</argument> </argument>
<argument index="1" name="angle" type="float"> <argument index="1" name="angle" type="float">
@ -141,6 +143,8 @@
</description> </description>
</method> </method>
<method name="set_euler"> <method name="set_euler">
<return type="void">
</return>
<argument index="0" name="euler" type="Vector3"> <argument index="0" name="euler" type="Vector3">
</argument> </argument>
<description> <description>

View File

@ -149,7 +149,7 @@
</description> </description>
</method> </method>
<method name="xform"> <method name="xform">
<return type="Variant"> <return type="void">
</return> </return>
<argument index="0" name="v" type="Variant"> <argument index="0" name="v" type="Variant">
</argument> </argument>
@ -158,7 +158,7 @@
</description> </description>
</method> </method>
<method name="xform_inv"> <method name="xform_inv">
<return type="Variant"> <return type="void">
</return> </return>
<argument index="0" name="v" type="Variant"> <argument index="0" name="v" type="Variant">
</argument> </argument>

View File

@ -151,7 +151,7 @@
</description> </description>
</method> </method>
<method name="xform"> <method name="xform">
<return type="Variant"> <return type="void">
</return> </return>
<argument index="0" name="v" type="Variant"> <argument index="0" name="v" type="Variant">
</argument> </argument>
@ -160,7 +160,7 @@
</description> </description>
</method> </method>
<method name="xform_inv"> <method name="xform_inv">
<return type="Variant"> <return type="void">
</return> </return>
<argument index="0" name="v" type="Variant"> <argument index="0" name="v" type="Variant">
</argument> </argument>