Commit Graph

53 Commits

Author SHA1 Message Date
fd85c5b378 Add more Dictionary tests
Adding more tests to Dictionary for methods exposed to gdscript
2025-10-31 15:37:05 -04:00
2b855d831d Add more Array tests
Added more tests for Array, focusing on methods exposed to gdscript that didn't have tests.
2025-08-30 13:12:16 -04:00
kit
f7c182371e Remove build_array and build_dictionary from tests 2025-05-26 13:02:01 -04:00
15de1d6c35 Use Grisu2 algorithm in String::num_scientific to fix serializing 2025-05-22 09:13:16 -07:00
692a244713 Test for insertion at array's size 2025-04-15 12:08:54 -04:00
ec675fc329 Merge pull request #100333 from YYF233333/reduce_list
Use `LocalVector` instead of `List` as arg of `Dictionary::get_key_list`
2025-04-09 08:51:45 -05:00
f7e4987d0e Dictionary::get_key_list use LocalVector instead of List. 2025-04-09 02:46:24 +08:00
fe39ffeb7d Add negative index to Array.remove_at and Array.insert 2025-04-08 14:55:39 -03:00
Tom
8a3f9846c5 Add missing initializer_list constructor for TypedDictionary 2025-04-03 00:17:44 +01:00
75881f8322 Use initializer list in Arrays 2025-03-26 18:38:15 +01:00
f6a35e2a6e Merge pull request #86015 from kitbdev/array-initializer-list
Add list initialization to Array, Variant, and TypedArray
2025-03-19 17:46:06 -05:00
bebe037abf Add ConstIterator to Dictionary. 2025-03-13 01:28:46 +08:00
324512e11c Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
54945c4d28 Add std::initializer_list constructor for Dictionary. 2024-11-29 14:12:40 +02:00
e379cc76e5 Core: Fix Callable.get_bound_arguments{,_count}() return incorrect data 2024-11-04 22:41:56 +03:00
5c0f2414cd Always add decimal when printing float 2024-10-23 15:00:21 +02:00
610635e1c8 Add test 2024-10-18 08:47:29 +02: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
89491f4403 Add callable support for find and rfind Array methods 2024-09-13 00:01:53 -07:00
9853a69144 Implement typed dictionaries 2024-09-04 10:27:26 -05:00
154049ce17 StringName Dictionary keys
also added 'is_string()' method to Variant
and refactored many String type comparisons to use it instead
2024-08-29 13:39:27 -07:00
09460d33e6 [Core] Fix sharing of typed arrays from constructor 2024-05-07 09:52:17 +02:00
955d5affa8 Reduce and prevent unnecessary random-access to List
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when
accessing a single element)

* Removed subscript operator, in favor of a more explicit `get`
* Added conversion from `Iterator` to `ConstIterator`
* Remade existing operations into other solutions when applicable
2024-05-04 16:08:55 +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
kit
cb17798df3 Add Array and Variant list inializer 2024-05-02 15:35:17 -04:00
80cb914e06 [Core] Fix incorrect comparison for Array const iterator 2024-04-13 17:32:33 +02:00
64146cb7f3 [Core] Add iteration support to Array 2024-04-10 14:49:34 +02:00
59bcc2888c Add methods to get argument count of methods
Added to:
* `Callable`s
* `Object`s
* `ClassDB`
* `Script(Instance)`s
2024-03-10 11:02:43 +01:00
f9826a1dd7 Fix various spelling errors 2024-01-04 09:56:43 -05:00
c0808d5083 fix assignment to vec2 tests 2023-10-25 20:57:45 +02:00
897ff71156 Merge pull request #76244 from kgrubbs22/variant-test-updates
Added Unit Tests for Variant for Operator Overloading
2023-10-16 10:37:40 +02:00
22e2696767 Add unit tests for type_convert Variant utility function 2023-09-08 10:13:22 -05:00
11518665b7 Codestyle: Don't use auto where not warranted
We allow using auto for lambdas or complex macros where a return type
may change based on the parameters. But where the type is clear, we
should be explicit.

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2023-09-07 16:15:18 +02:00
7752a0d8d1 Fix range error for Array.slice 2023-07-07 23:19:42 +02:00
867ea7fe59 Merge pull request #74730 from MarioLiebisch/fix-74726
Fix read-only dictionaries adding missing keys
2023-06-19 21:38:38 +02:00
1a62f1e4fc Merge pull request #74741 from vnen/variant-not-for-everyone
Allow boolean operators for all Variant types
2023-06-18 16:28:10 +02:00
0ec48a43d6 Updated Varaint assignemnt unit tests with Vec4,Vec4i,Rect2,Rect2i,Trans2d,Trans3d,Color,,Plane,Basis,AABB,Quant,Proj,RID,and Object
Updated Varaint assignemnt unit tests with Vec4,Vec4i,Rect2,Rect2i,Trans2d,Trans3d,Color,,Plane,Basis,AABB,Quant,Proj,RID,and Object

Updated Varaint assignemnt unit tests with
Vec4,Vec4i,Rect2,Rect2i,Trans2d,Trans3d,Color,,Plane,Basis,AABB,Quant,Proj,RID,and Object
2023-04-19 11:23:11 -05:00
10f385fb79 Fix Array.slice() rounding for abs(step) != 1 2023-03-14 15:46:45 +01:00
62e1a5e235 Added two test cases 2023-03-11 18:53:17 +01:00
a1e3ef919c Add operator NOT for all Variant types 2023-03-10 15:58:55 -03:00
c5f7a89b0f Core: Identity compare objects by id, not by pointers 2023-02-24 23:33:29 +02:00
37248d7c87 Add @GlobalScope is_same(a, b) and Variant::identity_compare() 2023-01-25 10:46:21 -05:00
d95794ec8a One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
e79be6ce07 Unify String and StringName 2022-12-05 21:46:47 -05:00
cc424bcb18 Add Dictionary.find_key() 2022-08-16 13:48:59 +02:00
1362bc22bd Add tests for empty/unnamed arguments to ClassDB, Variant, GDScript 2022-08-08 16:36:01 +03:00
668d6a1c5c Merge pull request #56337 from cdemirer/fix-array-dictionary-id 2022-01-23 00:46:53 +01:00
c6cefb1b79 Array: Relax slice bound checks to properly handle negative indices
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.
2022-01-10 22:42:03 +01:00
fe52458154 Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
e2ed9d13eb Fix Array and Dictionary id() and dictionary test bug 2021-12-30 13:14:09 +08:00