Make Vector<T>::duplicate() const
Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
This commit is contained in:
@ -184,10 +184,16 @@ public:
|
||||
return span().bisect(p_value, p_before, Comparator{ args... });
|
||||
}
|
||||
|
||||
Vector<T> duplicate() {
|
||||
Vector<T> duplicate() const {
|
||||
return *this;
|
||||
}
|
||||
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
Vector<T> _duplicate_bind_compat_112290() {
|
||||
return *this;
|
||||
}
|
||||
#endif // DISABLE_DEPRECATED
|
||||
|
||||
void ordered_insert(const T &p_val) {
|
||||
Size i;
|
||||
for (i = 0; i < _cowdata.size(); i++) {
|
||||
|
||||
@ -2753,6 +2753,9 @@ static void _register_variant_builtin_methods_array() {
|
||||
bind_method(PackedByteArray, sort, sarray(), varray());
|
||||
bind_method(PackedByteArray, bsearch, sarray("value", "before"), varray(true));
|
||||
bind_method(PackedByteArray, duplicate, sarray(), varray());
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
bind_compat_method(PackedByteArray, duplicate, _duplicate_bind_compat_112290, sarray(), varray());
|
||||
#endif
|
||||
bind_method(PackedByteArray, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedByteArray, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedByteArray, count, sarray("value"), varray());
|
||||
@ -2829,6 +2832,9 @@ static void _register_variant_builtin_methods_array() {
|
||||
bind_method(PackedInt32Array, sort, sarray(), varray());
|
||||
bind_method(PackedInt32Array, bsearch, sarray("value", "before"), varray(true));
|
||||
bind_method(PackedInt32Array, duplicate, sarray(), varray());
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
bind_compat_method(PackedInt32Array, duplicate, _duplicate_bind_compat_112290, sarray(), varray());
|
||||
#endif
|
||||
bind_method(PackedInt32Array, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedInt32Array, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedInt32Array, count, sarray("value"), varray());
|
||||
@ -2853,6 +2859,9 @@ static void _register_variant_builtin_methods_array() {
|
||||
bind_method(PackedInt64Array, sort, sarray(), varray());
|
||||
bind_method(PackedInt64Array, bsearch, sarray("value", "before"), varray(true));
|
||||
bind_method(PackedInt64Array, duplicate, sarray(), varray());
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
bind_compat_method(PackedInt64Array, duplicate, _duplicate_bind_compat_112290, sarray(), varray());
|
||||
#endif
|
||||
bind_method(PackedInt64Array, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedInt64Array, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedInt64Array, count, sarray("value"), varray());
|
||||
@ -2877,6 +2886,9 @@ static void _register_variant_builtin_methods_array() {
|
||||
bind_method(PackedFloat32Array, sort, sarray(), varray());
|
||||
bind_method(PackedFloat32Array, bsearch, sarray("value", "before"), varray(true));
|
||||
bind_method(PackedFloat32Array, duplicate, sarray(), varray());
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
bind_compat_method(PackedFloat32Array, duplicate, _duplicate_bind_compat_112290, sarray(), varray());
|
||||
#endif
|
||||
bind_method(PackedFloat32Array, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedFloat32Array, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedFloat32Array, count, sarray("value"), varray());
|
||||
@ -2901,6 +2913,9 @@ static void _register_variant_builtin_methods_array() {
|
||||
bind_method(PackedFloat64Array, sort, sarray(), varray());
|
||||
bind_method(PackedFloat64Array, bsearch, sarray("value", "before"), varray(true));
|
||||
bind_method(PackedFloat64Array, duplicate, sarray(), varray());
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
bind_compat_method(PackedFloat64Array, duplicate, _duplicate_bind_compat_112290, sarray(), varray());
|
||||
#endif
|
||||
bind_method(PackedFloat64Array, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedFloat64Array, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedFloat64Array, count, sarray("value"), varray());
|
||||
@ -2925,6 +2940,9 @@ static void _register_variant_builtin_methods_array() {
|
||||
bind_method(PackedStringArray, sort, sarray(), varray());
|
||||
bind_method(PackedStringArray, bsearch, sarray("value", "before"), varray(true));
|
||||
bind_method(PackedStringArray, duplicate, sarray(), varray());
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
bind_compat_method(PackedStringArray, duplicate, _duplicate_bind_compat_112290, sarray(), varray());
|
||||
#endif
|
||||
bind_method(PackedStringArray, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedStringArray, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedStringArray, count, sarray("value"), varray());
|
||||
@ -2949,6 +2967,9 @@ static void _register_variant_builtin_methods_array() {
|
||||
bind_method(PackedVector2Array, sort, sarray(), varray());
|
||||
bind_method(PackedVector2Array, bsearch, sarray("value", "before"), varray(true));
|
||||
bind_method(PackedVector2Array, duplicate, sarray(), varray());
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
bind_compat_method(PackedVector2Array, duplicate, _duplicate_bind_compat_112290, sarray(), varray());
|
||||
#endif
|
||||
bind_method(PackedVector2Array, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedVector2Array, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedVector2Array, count, sarray("value"), varray());
|
||||
@ -2973,6 +2994,9 @@ static void _register_variant_builtin_methods_array() {
|
||||
bind_method(PackedVector3Array, sort, sarray(), varray());
|
||||
bind_method(PackedVector3Array, bsearch, sarray("value", "before"), varray(true));
|
||||
bind_method(PackedVector3Array, duplicate, sarray(), varray());
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
bind_compat_method(PackedVector3Array, duplicate, _duplicate_bind_compat_112290, sarray(), varray());
|
||||
#endif
|
||||
bind_method(PackedVector3Array, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedVector3Array, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedVector3Array, count, sarray("value"), varray());
|
||||
@ -2997,6 +3021,9 @@ static void _register_variant_builtin_methods_array() {
|
||||
bind_method(PackedColorArray, sort, sarray(), varray());
|
||||
bind_method(PackedColorArray, bsearch, sarray("value", "before"), varray(true));
|
||||
bind_method(PackedColorArray, duplicate, sarray(), varray());
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
bind_compat_method(PackedColorArray, duplicate, _duplicate_bind_compat_112290, sarray(), varray());
|
||||
#endif
|
||||
bind_method(PackedColorArray, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedColorArray, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedColorArray, count, sarray("value"), varray());
|
||||
@ -3021,6 +3048,9 @@ static void _register_variant_builtin_methods_array() {
|
||||
bind_method(PackedVector4Array, sort, sarray(), varray());
|
||||
bind_method(PackedVector4Array, bsearch, sarray("value", "before"), varray(true));
|
||||
bind_method(PackedVector4Array, duplicate, sarray(), varray());
|
||||
#ifndef DISABLE_DEPRECATED
|
||||
bind_compat_method(PackedVector4Array, duplicate, _duplicate_bind_compat_112290, sarray(), varray());
|
||||
#endif
|
||||
bind_method(PackedVector4Array, find, sarray("value", "from"), varray(0));
|
||||
bind_method(PackedVector4Array, rfind, sarray("value", "from"), varray(-1));
|
||||
bind_method(PackedVector4Array, count, sarray("value"), varray());
|
||||
|
||||
@ -213,7 +213,7 @@
|
||||
[b]Note:[/b] Decompression is not guaranteed to work with data not compressed by Godot, for example if data compressed with the deflate compression mode lacks a checksum or header.
|
||||
</description>
|
||||
</method>
|
||||
<method name="duplicate">
|
||||
<method name="duplicate" qualifiers="const">
|
||||
<return type="PackedByteArray" />
|
||||
<description>
|
||||
Creates a copy of the array, and returns it.
|
||||
|
||||
@ -73,7 +73,7 @@
|
||||
Returns the number of times an element is in the array.
|
||||
</description>
|
||||
</method>
|
||||
<method name="duplicate">
|
||||
<method name="duplicate" qualifiers="const">
|
||||
<return type="PackedColorArray" />
|
||||
<description>
|
||||
Creates a copy of the array, and returns it.
|
||||
|
||||
@ -71,7 +71,7 @@
|
||||
[b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
|
||||
</description>
|
||||
</method>
|
||||
<method name="duplicate">
|
||||
<method name="duplicate" qualifiers="const">
|
||||
<return type="PackedFloat32Array" />
|
||||
<description>
|
||||
Creates a copy of the array, and returns it.
|
||||
|
||||
@ -72,7 +72,7 @@
|
||||
[b]Note:[/b] [constant @GDScript.NAN] doesn't behave the same as other numbers. Therefore, the results from this method may not be accurate if NaNs are included.
|
||||
</description>
|
||||
</method>
|
||||
<method name="duplicate">
|
||||
<method name="duplicate" qualifiers="const">
|
||||
<return type="PackedFloat64Array" />
|
||||
<description>
|
||||
Creates a copy of the array, and returns it.
|
||||
|
||||
@ -69,7 +69,7 @@
|
||||
Returns the number of times an element is in the array.
|
||||
</description>
|
||||
</method>
|
||||
<method name="duplicate">
|
||||
<method name="duplicate" qualifiers="const">
|
||||
<return type="PackedInt32Array" />
|
||||
<description>
|
||||
Creates a copy of the array, and returns it.
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
Returns the number of times an element is in the array.
|
||||
</description>
|
||||
</method>
|
||||
<method name="duplicate">
|
||||
<method name="duplicate" qualifiers="const">
|
||||
<return type="PackedInt64Array" />
|
||||
<description>
|
||||
Creates a copy of the array, and returns it.
|
||||
|
||||
@ -76,7 +76,7 @@
|
||||
Returns the number of times an element is in the array.
|
||||
</description>
|
||||
</method>
|
||||
<method name="duplicate">
|
||||
<method name="duplicate" qualifiers="const">
|
||||
<return type="PackedStringArray" />
|
||||
<description>
|
||||
Creates a copy of the array, and returns it.
|
||||
|
||||
@ -76,7 +76,7 @@
|
||||
[b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
|
||||
</description>
|
||||
</method>
|
||||
<method name="duplicate">
|
||||
<method name="duplicate" qualifiers="const">
|
||||
<return type="PackedVector2Array" />
|
||||
<description>
|
||||
Creates a copy of the array, and returns it.
|
||||
|
||||
@ -75,7 +75,7 @@
|
||||
[b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
|
||||
</description>
|
||||
</method>
|
||||
<method name="duplicate">
|
||||
<method name="duplicate" qualifiers="const">
|
||||
<return type="PackedVector3Array" />
|
||||
<description>
|
||||
Creates a copy of the array, and returns it.
|
||||
|
||||
@ -75,7 +75,7 @@
|
||||
[b]Note:[/b] Vectors with [constant @GDScript.NAN] elements don't behave the same as other vectors. Therefore, the results from this method may not be accurate if NaNs are included.
|
||||
</description>
|
||||
</method>
|
||||
<method name="duplicate">
|
||||
<method name="duplicate" qualifiers="const">
|
||||
<return type="PackedVector4Array" />
|
||||
<description>
|
||||
Creates a copy of the array, and returns it.
|
||||
|
||||
@ -82,3 +82,20 @@ Validate extension JSON: Error: Field 'classes/SpringBoneSimulator3D/methods/set
|
||||
Validate extension JSON: Error: Field 'classes/SpringBoneSimulator3D/methods/set_rotation_axis/arguments/1': type changed value in new API, from "enum::SpringBoneSimulator3D.RotationAxis" to "enum::SkeletonModifier3D.RotationAxis".
|
||||
|
||||
Same enum is defined in SkeletonModifier3D which is a base class of SpringBoneSimulator3D. Compatibility methods registered.
|
||||
|
||||
|
||||
GH-112290
|
||||
---------
|
||||
|
||||
Validate extension JSON: Error: Field 'builtin_classes/PackedByteArray/methods/duplicate': is_const changed value in new API, from false to true.
|
||||
Validate extension JSON: Error: Field 'builtin_classes/PackedColorArray/methods/duplicate': is_const changed value in new API, from false to true.
|
||||
Validate extension JSON: Error: Field 'builtin_classes/PackedFloat32Array/methods/duplicate': is_const changed value in new API, from false to true.
|
||||
Validate extension JSON: Error: Field 'builtin_classes/PackedFloat64Array/methods/duplicate': is_const changed value in new API, from false to true.
|
||||
Validate extension JSON: Error: Field 'builtin_classes/PackedInt32Array/methods/duplicate': is_const changed value in new API, from false to true.
|
||||
Validate extension JSON: Error: Field 'builtin_classes/PackedInt64Array/methods/duplicate': is_const changed value in new API, from false to true.
|
||||
Validate extension JSON: Error: Field 'builtin_classes/PackedStringArray/methods/duplicate': is_const changed value in new API, from false to true.
|
||||
Validate extension JSON: Error: Field 'builtin_classes/PackedVector2Array/methods/duplicate': is_const changed value in new API, from false to true.
|
||||
Validate extension JSON: Error: Field 'builtin_classes/PackedVector3Array/methods/duplicate': is_const changed value in new API, from false to true.
|
||||
Validate extension JSON: Error: Field 'builtin_classes/PackedVector4Array/methods/duplicate': is_const changed value in new API, from false to true.
|
||||
|
||||
Duplicate method made const. Compatibility methods registered.
|
||||
|
||||
Reference in New Issue
Block a user