Commit Graph

32 Commits

Author SHA1 Message Date
a149280cea ClassDB: Use AHashMap for property_setget and constant/signal_map 2025-10-28 16:24:54 -03:00
a50fc5acd8 Change ClassDB::get_class_list and related stuff. 2025-09-16 15:00:33 +08:00
d237e31a89 Style: Remove redundant DEBUG_METHODS_ENABLED
• Replaced with functionally identical and far more ubiquitous `DEBUG_ENABLED`
2025-05-15 13:09:41 -05:00
a404b668a1 Change Node set_name to use StringName 2025-05-01 15:15:19 -07:00
91fe434a86 Always use String as StringName backing internally. 2025-04-23 14:57:03 +02:00
b377562b52 Merge pull request #91660 from AThousandShips/methodinfo_vec
[Core] Use `Vector` for `MethodInfo::arguments`
2025-03-14 10:06:13 -05:00
66e9c2f998 [Tests] Add check for argument name validity
Checks that all method and signal arguments have valid names
2025-03-10 14:57:21 +01:00
d9721954e6 [Core] Use Vector for MethodInfo::arguments 2025-03-10 13:57:53 +01:00
324512e11c Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
03b05cf9ac Core: Fix built-in enum constant bindings 2024-11-22 14:03:21 +03:00
8bf4ecc026 Add String.is_valid_unicode_identifier()
- Adds `is_valid_unicode_identifier()`
- Adds `is_valid_ascii_identifier()`
- Deprecates `is_valid_identifier()`
- Renames `validate_identifier()` to `validate_ascii_identifier()`
2024-08-27 11:34:08 +08:00
61998b1a05 [Tests] Ensure all default method arguments can be encoded
Checks that all arguments of bound methods can be encoded in extensions, checking non-empty or non-null cases for containers and objects
2024-08-16 19:57:03 +02:00
5ced75aeb1 Fix Vector4, Vector4i, and Projection missing from ClassDB tests 2024-08-14 02:59:59 -07:00
ea2e6be0a6 [Tests] Fix some invalid error messages
These used `utf8().get_data()` when they should be passed as `String`
2024-07-10 15:57:52 +02:00
17929a3443 [Tests] Fix unit tests in template builds 2024-06-29 18:35:50 +02:00
a0dbdcc3ab Replace find with contains/has where applicable
* Replaces `find(...) != -1` with `contains` for `String`
* Replaces `find(...) == -1` with `!contains` for `String`
* Replaces `find(...) != -1` with `has` for containers
* Replaces `find(...) == -1` with `!has` for containers
2024-05-08 12:37:42 +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
951ea2415b Make EditorInterface accessible as a singleton
- EditorPlugin.get_editor_interface() is removed as redundant.
2023-08-09 16:01:31 +02:00
8e7afec479 Fix various errors when running the unit tests
Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2023-05-09 18:40:56 +02:00
83026126d4 Add tests to ensure bound methods and signals are valid identifiers 2023-01-23 21:19:57 +01: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
8f5d56e04a [GDExtension] Use function names with underscore for TextServer extension, add macros to generate wrappers for module functions. 2022-09-28 10:04:11 +03:00
1362bc22bd Add tests for empty/unnamed arguments to ClassDB, Variant, GDScript 2022-08-08 16:36:01 +03:00
62423b691e Tests: Silence some intentional errors
Also fix printing messages in ClassDB test.
2022-08-04 22:03:44 +02:00
5ac42cf576 Implement a BitField hint
Allows to specify the binder that an enum must be treated as a bitfield.
2022-07-05 22:13:37 +02:00
860e24683f Make enum/constant binds 64-bit. 2022-06-17 16:36:26 +03:00
746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
8b7c7f5a75 Add a new HashMap implementation
Adds a new, cleaned up, HashMap implementation.

* Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing).
* Keeps elements in a double linked list for simpler, ordered, iteration.
* Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much
  for performance vs keeping the key, but helps replace old code).
* Uses a more modern C++ iterator API, deprecates the old one.
* Supports custom allocator (in case there is a wish to use a paged one).

This class aims to unify all the associative template usage and replace it by this one:
* Map<> (whereas key order does not matter, which is 99% of cases)
* HashMap<>
* OrderedHashMap<>
* OAHashMap<>
2022-05-12 11:21:29 +02:00
f19cd44346 Unify TextServer built-in module and GDExtension code. 2022-03-17 08:15:29 +02:00
fe52458154 Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
99a282f631 Move and organize tests into subfolders 2021-11-07 00:43:31 -06:00