summaryrefslogtreecommitdiff
path: root/doc/classes/Array.xml
AgeCommit message (Collapse)Author
2023-04-24Document how to make custom min/max for ArrayNinni Pipping
(cherry picked from commit 96ab31a7117c110da025a39390bdecf36892e7fa)
2023-03-13Remove outdated note about const in Dictionary and Array docsGeorge Marques
(cherry picked from commit d2b1d6e69badfd9c5d370e5599971334ab3034ef)
2023-02-04Merge pull request #71786 from raulsntos/dotnet/arrayRémi Verschelde
Sync C# Array with Core
2023-01-31GDScript: Fix issues with typed arraysDmitrii Maganov
2023-01-30Move Array:set_typed to internal GDExtension structure and unexposed it.bruvzg
2023-01-30Sync C# Array with CoreRaul Santos
- 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-27GDScript: Fix test for read-only state of constantsDmitrii Maganov
2023-01-19Add property usage to array indexerRaul Santos
This makes the `Array` indexer show as returning `Variant` instead of `void` in the documentation.
2023-01-10Merge pull request #70745 from rcorre/array_dup_docRémi Verschelde
Explain that Array.duplicate will not deep-copy Object.
2023-01-06Warn against erasing array elements while iterating.Ryan Roden-Corrent
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.
2022-12-30Explain that Array.duplicate will not deep-copy Object.Ryan Roden-Corrent
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-11-25Remove `Array.find_last()`Micky
2022-11-02Style: Misc docs and comment style and language fixesRémi Verschelde
- 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-10-30Docs Clarify `Array.fill` behavior when reference type is passed inkleonc
2022-10-21Merge pull request #67444 from nonunknown/array_pick_randomMax Hilbrunner
Add ability to pick random value from array
2022-10-20add ability to pick random value from arrayNonunknown
2022-10-19Merge pull request #67001 from KoBeWi/🎲Max Hilbrunner
Fill random docs
2022-10-08Document `Array.sort()` and `sort_custom()` using unstable sortingHugo Locurcio
2022-10-07Fill random docskobewi
2022-09-22[GDExtension] Implement support for typed arrays.bruvzg
2022-08-18[doc] Fix grammar in class docs: less vs. fewer/lowerAndy Maloney
2022-08-12[doc] Use "param" instead of "code" to refer to parameters (8)Andy Maloney
2022-08-08Rename the argument tag to param in XML documentationYuri Sizov
2022-06-16Clarify `all` and `any` documentation for empty arraysDanil Alexeev
2022-05-25Add `any()` and `all()` methods to ArrayHugo Locurcio
These can be used as faster, more convenient shorthands to using `filter()` + `size()`.
2022-04-05Merge pull request #59910 from rcorre/array-remove-docRémi Verschelde
2022-04-05Clarify Array.erase for nonexistant element.Ryan Roden-Corrent
The docs specify that Array.remove does nothing if the index does not exist. Array.erase does not have a similar phrase, so it's unclear if erase will print an error, or silently do nothing.
2022-03-30Improve documentation for Array operatorsHugo Locurcio
2022-03-27Add descriptions to operatorsKarmavil
2022-03-14Remove generating of null comparison operators from documentationYuri Roubinsky
2022-02-15Add an XML schema for documentationHugo Locurcio
This makes it easier to spot syntax errors when editing the class reference. The schema is referenced locally so validation can still work offline. Each class XML's schema conformance is also checked on GitHub Actions.
2022-02-12Clarify identical `hash()` return values due to collisionsHugo Locurcio
2022-01-18Merge pull request #56668 from akien-mga/array-slice-nicer-bound-checksRémi Verschelde
2022-01-17Give example of one-liner for Array natural sortLisandro Lorea
The documentation for the sort method warns the user that it doesn't do natural sort but fails to provide a solution when it's just a one liner thanks to String.naturalnocasecmp_to() and lambda support This suggests exactly the same algorithm as used by the filesystem dock for file sorting. Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2022-01-10`Array`: Relax `slice` bound checks to properly handle negative indicesRémi Verschelde
The same is done for `Vector` (and thus `Packed*Array`). `begin` and `end` can now take any value and will be clamped to `[-size(), size()]`. Negative values are a shorthand for indexing the array from the last element upward. `end` is given a default `INT_MAX` value (which will be clamped to `size()`) so that the `end` parameter can be omitted to go from `begin` to the max size of the array. This makes `slice` works similarly to numpy's and JavaScript's.
2021-11-26PackedByteArray, Array slice end exclusive, rename subarray to sliceNathan Franke
2021-11-23Rename `remove()` to `remove_at()` when removing by indexLightning_A
2021-11-12Improve sort_custom() examplekobewi
2021-10-29Move the docs for constructors and operators out of methods sectionAaron Franke
2021-10-05doc: Fix style inconsistencies for `[b]Note:[/b]` paragraphsRémi Verschelde
And fix up formatting not supported by makerst.
2021-09-20Don't generate empty doc sections and reduce code duplicationAaron Franke
2021-09-17Allow comparing equality between builtin types and nullGeorge Marques
2021-09-07Fix docs for Array's slice()Max Hilbrunner
2021-09-05Specify description of Array.slices end parameterJohannes Witt
2021-08-28Fix Array class docs after #47406Max Hilbrunner
2021-08-27Add an `Array.pop_at()` method to pop an element at an arbitrary indexHugo Locurcio
Negative indices are supported to pop an element relative from the end.
2021-07-30doc: Use self-closing tags for `return` and `argument`Rémi Verschelde
For the time being we don't support writing a description for those, preferring having all details in the method's description. Using self-closing tags saves half the lines, and prevents contributors from thinking that they should write the argument or return documentation there.
2021-07-23Fix doc typosNicholas Huelin
This pull request fixes an assortment of typos and improves conciseness in `Animation`, `Area2D`, `Array`, `ArrayMesh`, `Control`, `Directory`, `EditorPlugin`, `Engine`, and `OS`.
2021-06-11Merge pull request #47584 from HaSa1002/docs-lang-7Rémi Verschelde
2021-06-11Port code examples to C# (V)Johannes
Includes: * Variant * Viewport and two fixes in Array that were pointed out in #40978 VisualScript classes are skipped on purpose. That is the final commit of the inital code porting to C#. :)