Commit Graph

163 Commits

Author SHA1 Message Date
44d10c576e Improve documentation for return value of Packed*Array.resize
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2025-03-20 16:21:01 +01:00
ca4b29b18d Standardize all "Prints" comments in documentation 2024-12-23 21:26:00 +01:00
072ff85f82 [.NET] Use collection expressions in docs
As of C# 12 we can now use collection expressions to reduce some boilerplate when initializing collections.
2024-12-21 02:28:59 +01:00
0c2296fb1b Fix C# boolean "Prints" comments in documentation 2024-11-11 21:19:34 +01:00
cc9f2b58a0 Bind Array get and set functions 2024-09-26 13:00:17 -07:00
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
c6f7c89149 Fix description of Array.sort_custom() 2024-09-15 15:52:50 +08:00
89491f4403 Add callable support for find and rfind Array methods 2024-09-13 00:01:53 -07:00
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
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
b516742358 Fix typo in Array code example 2024-08-24 20:44:01 +03:00
4ce5856384 Remove empty [b]Example:[/b] lines from the class reference 2024-08-19 01:00:52 +02:00
5ada090d74 Fix typo in Array's sort() method description 2024-07-27 16:13:42 -03:00
31a9c634d5 Overhaul Array Documentation 2024-07-05 13:48:56 +02:00
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
a27d9639f2 Merge pull request #79075 from dalexeev/doc-typed-arrays
Update typed arrays documentation
2024-04-08 11:17:38 +02:00
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
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
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
61bdbdd9ee Replace some "uncommon" words in class reference 2024-01-15 18:51:52 +01:00
ab8c9b678f Document the upsides and downsides of packed arrays versus typed arrays 2023-11-15 23:30:47 +01:00
80b636069a Add performance note to Array.resize() 2023-11-10 00:41:39 +02:00
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
d8e7ce58ee Clarify Array class methods that return error
related to #47406
2023-08-24 14:11:56 +00:00
30d4d1c6d1 Document pick_random for empty arrays 2023-08-18 17:01:23 -04:00
7752a0d8d1 Fix range error for Array.slice 2023-07-07 23:19:42 +02:00
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
346f1ab86b Bump version to 4.2-dev
Keep on waitin'
2023-07-05 22:07:03 +02:00
b33c3fa092 Update typed arrays documentation 2023-07-05 20:30:15 +03:00
bdffb74f06 Update Array's remove_at() description to cover removing the last element 2023-06-19 23:14:46 +02:00
04562662d3 Overhaul the top sections of the class reference (Core classes) 2023-05-19 07:04:48 +02:00
96ab31a711 Document how to make custom min/max for Array 2023-04-10 16:41:11 +02:00
d2b1d6e69b Remove outdated note about const in Dictionary and Array docs 2023-03-08 12:13:17 -03:00
1c1524a651 Bump version to 4.1-dev
Can't stop, won't stop, they said, huh?
2023-03-01 01:44:37 +01:00
bbff9fd7a4 Merge pull request #71786 from raulsntos/dotnet/array
Sync C# Array with Core
2023-02-04 00:24:06 +01:00
5909f9f075 GDScript: Fix issues with typed arrays 2023-01-31 11:54:41 +02:00
5aa87ccc03 Move Array:set_typed to internal GDExtension structure and unexposed it. 2023-01-30 14:23:31 +02:00
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
abe6d67232 GDScript: Fix test for read-only state of constants 2023-01-27 05:28:08 +02:00
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
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
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
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
67cdac6db8 Remove Array.find_last() 2022-11-25 18:34:50 +01:00
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
221a89f2ef Docs Clarify Array.fill behavior when reference type is passed in 2022-10-30 13:42:24 +01:00
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
9f4dbf415d add ability to pick random value from array 2022-10-20 08:39:47 -03:00
e6311c8e5e Merge pull request #67001 from KoBeWi/🎲
Fill random docs
2022-10-19 21:58:03 +02:00
85b617a6a3 Document Array.sort() and sort_custom() using unstable sorting 2022-10-08 01:16:41 +02:00