Commit graph

158 commits

Author SHA1 Message Date
Rémi Verschelde
6bf8a3e3f8
Merge pull request #95449 from SlashScreen/array_functions
Add callable support for `find` and `rfind` `Array` methods
2024-09-20 16:06:13 +02:00
Daylily-Zeleen
c6f7c89149 Fix description of Array.sort_custom() 2024-09-15 15:52:50 +08:00
Slashscreen
89491f4403 Add callable support for find and rfind Array methods 2024-09-13 00:01:53 -07:00
Rémi Verschelde
4a798ad85d
Merge pull request #95749 from Mickeon/documentation-example-pruning
Remove empty `[b]Example:[/b]` lines from the class reference
2024-08-26 23:29:00 +02:00
aaronp64
39ca8b4e23 Fix Array.sort_custom example code
Array.sort_custom descending sort example was comparing index 0, but had expected result based on comparing index 1.  Updated to use index 1 consistently.
2024-08-26 10:38:23 -04:00
Tallivm
b516742358 Fix typo in Array code example 2024-08-24 20:44:01 +03:00
Micky
4ce5856384 Remove empty [b]Example:[/b] lines from the class reference 2024-08-19 01:00:52 +02:00
Eduardo Assis
5ada090d74 Fix typo in Array's sort() method description 2024-07-27 16:13:42 -03:00
Micky
31a9c634d5 Overhaul Array Documentation 2024-07-05 13:48:56 +02:00
K. S. Ernest (iFire) Lee
f9b488508c
Add PackedVector4Array Variant type
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2024-05-03 00:58:27 +02:00
Rémi Verschelde
a27d9639f2
Merge pull request #79075 from dalexeev/doc-typed-arrays
Update typed arrays documentation
2024-04-08 11:17:38 +02:00
Rémi Verschelde
ea961d3981
Merge pull request #78257 from Calinou/doc-packed-arrays-vs-typed-arrays
Document the upsides and downsides of packed arrays versus typed arrays
2024-04-08 11:17:31 +02:00
A Thousand Ships
06df4abcd3
[Doc] Clarify bsearch(_custom) behavior
* Added an example for the effect of `before`
* Clarified the arguments to the custom callable can be either order
2024-03-09 13:09:29 +01:00
RedMser
5911a12db1 Update class reference to include some keywords
More should be added in future PRs, wherever there is demand.
2024-02-09 18:13:23 +01:00
Micky
61bdbdd9ee Replace some "uncommon" words in class reference 2024-01-15 18:51:52 +01:00
Hugo Locurcio
ab8c9b678f
Document the upsides and downsides of packed arrays versus typed arrays 2023-11-15 23:30:47 +01:00
MewPurPur
80b636069a Add performance note to Array.resize() 2023-11-10 00:41:39 +02:00
Yuri Sizov
e538843930 Merge pull request #80936 from curious-broccoli/fix-array-doc
Clarify Array class methods that return error
2023-08-25 14:59:00 +02:00
curious-broccoli
d8e7ce58ee Clarify Array class methods that return error
related to #47406
2023-08-24 14:11:56 +00:00
David Turner
30d4d1c6d1 Document pick_random for empty arrays 2023-08-18 17:01:23 -04:00
Ninni Pipping
7752a0d8d1 Fix range error for Array.slice 2023-07-07 23:19:42 +02:00
Rémi Verschelde
81064cc239
Doctool: Remove version attribute from XML header
We don't use that info for anything, and it generates unnecessary diffs
every time we bump the minor version (and CI failures if we forget to
sync some files from opt-in modules (mono, text_server_fb).
2023-07-06 10:08:21 +02:00
Rémi Verschelde
346f1ab86b
Bump version to 4.2-dev
Keep on waitin'
2023-07-05 22:07:03 +02:00
Danil Alexeev
b33c3fa092
Update typed arrays documentation 2023-07-05 20:30:15 +03:00
Peter Anderson
bdffb74f06
Update Array's remove_at() description to cover removing the last element 2023-06-19 23:14:46 +02:00
VolTer
04562662d3 Overhaul the top sections of the class reference (Core classes) 2023-05-19 07:04:48 +02:00
Ninni Pipping
96ab31a711 Document how to make custom min/max for Array 2023-04-10 16:41:11 +02:00
George Marques
d2b1d6e69b
Remove outdated note about const in Dictionary and Array docs 2023-03-08 12:13:17 -03:00
Rémi Verschelde
1c1524a651
Bump version to 4.1-dev
Can't stop, won't stop, they said, huh?
2023-03-01 01:44:37 +01:00
Rémi Verschelde
bbff9fd7a4
Merge pull request #71786 from raulsntos/dotnet/array
Sync C# Array with Core
2023-02-04 00:24:06 +01:00
Dmitrii Maganov
5909f9f075 GDScript: Fix issues with typed arrays 2023-01-31 11:54:41 +02:00
bruvzg
5aa87ccc03
Move Array:set_typed to internal GDExtension structure and unexposed it. 2023-01-30 14:23:31 +02:00
Raul Santos
54f8fb010c
Sync C# Array with Core
- Add `AddRange` method.
- Add `Fill` method.
- Add `Max` and `Min` methods.
- Add `PickRandom` method.
- Add `Reverse` method.
- Add `RecursiveEqual` method.
- Add `Sort` method.
- Add `Slice` and `GetSliceRange` methods.
- Add `IndexOf` overload that takes an index parameter.
- Add `LastIndexOf` method.
- Add `BinarySearch` method.
- Add/update documentation.
2023-01-30 05:41:53 +01:00
Dmitrii Maganov
abe6d67232 GDScript: Fix test for read-only state of constants 2023-01-27 05:28:08 +02:00
Raul Santos
97610c8bfc
Add property usage to array indexer
This makes the `Array` indexer show as returning `Variant` instead of `void` in the documentation.
2023-01-19 14:22:11 +01:00
Rémi Verschelde
2d2902b49b
Merge pull request #70745 from rcorre/array_dup_doc
Explain that Array.duplicate will not deep-copy Object.
2023-01-10 10:45:30 +01:00
Ryan Roden-Corrent
1f6a5e8bb1
Warn against erasing array elements while iterating.
Erasing array elements while iterating does not appear to be safe.
For example, the following prints nothing:

```
var a := [0,1,2,3,4,5,6]
for i in a:
        if i % 2 == 0:
                a.erase(i)
        else:
                print(i)
```

While this is often true for array implementations, it still seems worth
documenting explicitly. I copied the wording from Dictionary.xml.
2023-01-06 08:21:01 -05:00
Ryan Roden-Corrent
53181e4090
Explain that Array.duplicate will not deep-copy Object.
This was somewhat implied by specifically calling out nested arrays and
dictionaries, but I was still unsure and had to test it myself.
One might expect that `Resource` objects, which have a `duplicate`
method, might be deep-copied.
2022-12-30 11:59:07 -05:00
Micky
67cdac6db8 Remove Array.find_last() 2022-11-25 18:34:50 +01:00
Rémi Verschelde
f7c611ab71
Style: Misc docs and comment style and language fixes
- Removed empty paragraphs in XML.
- Consistently use bold style for "Example:", on a new line.
- Fix usage of `[code]` when hyperlinks could be used (`[member]`, `[constant]`).
- Fix invalid usage of backticks for inline code in BBCode.
- Fix some American/British English spelling inconsistencies.
- Other minor fixes spotted along the way, including typo fixes with codespell.
- Don't specify `@GlobalScope` for `enum` and `constant`.
2022-11-02 19:01:18 +01:00
kleonc
221a89f2ef Docs Clarify Array.fill behavior when reference type is passed in 2022-10-30 13:42:24 +01:00
Max Hilbrunner
5cefc07d90
Merge pull request #67444 from nonunknown/array_pick_random
Add ability to pick random value from array
2022-10-21 16:25:52 +02:00
Nonunknown
9f4dbf415d add ability to pick random value from array 2022-10-20 08:39:47 -03:00
Max Hilbrunner
e6311c8e5e
Merge pull request #67001 from KoBeWi/🎲
Fill random docs
2022-10-19 21:58:03 +02:00
Hugo Locurcio
85b617a6a3
Document Array.sort() and sort_custom() using unstable sorting 2022-10-08 01:16:41 +02:00
kobewi
1b7aee3c8d Fill random docs 2022-10-07 20:10:18 +02:00
bruvzg
163257d51b
[GDExtension] Implement support for typed arrays. 2022-09-22 23:31:27 +03:00
Andy Maloney
c7da28165b [doc] Fix grammar in class docs: less vs. fewer/lower 2022-08-18 12:35:54 -04:00
Andy Maloney
9b345e793a [doc] Use "param" instead of "code" to refer to parameters (8) 2022-08-12 14:00:25 -04:00
Yuri Sizov
c5d7115038 Rename the argument tag to param in XML documentation 2022-08-08 22:34:31 +03:00