summaryrefslogtreecommitdiffstats
path: root/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Sample/ExportedProperties.cs
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup C# projects, code quality & stylePaul Joannon2024-02-271-83/+83
| | | | | | | | | | | | | | | | | | | | | New rules: - Do not silence CA1805 any more - Limit where we silence CA1707, CA1711, CA1720 - Enforce severity=warning for IDE0040 - Enforce Allman style braces - Enforce naming conventions (IDE1006 is still severity=suggestion) Fixes: - Fix REFL045, CS1572, CS1573 - Suppress CS0618 when generating `InvokeGodotClassMethod` - Fix indent when generating GD_constants.cs - Temporarily silence CS1734 in generated code - Fix a lot of naming rule violations Misc.: - Remove ReSharper comments for RedundantNameQualifier - Remove suppression attributes for RedundantNameQualifier - Remove severity=warnings for CA1716, CA1304 (already included in the level of analysis we run)
* C#: Rename `Object` to `GodotObject`Raul Santos2023-01-271-3/+3
|
* C#: Renames to follow .NET naming conventionsRaul Santos2023-01-271-7/+7
| | | | Renamed C# types and members to use PascalCase and follow .NET naming conventions.
* Fix typos with codespellRémi Verschelde2022-12-151-1/+1
|
* C#: Rename SignalInfo to Signal and make awaitableRaul Santos2022-12-121-1/+1
|
* C#: Fix Generated ScriptProperty Error.Magian2022-11-271-0/+89
| | | | | 1. Add "this." to prevent errors caused by duplicate variable names. 2. Try to find the default value of property getters.
* Fix C# style with `dotnet format`Raul Santos2022-08-271-4/+8
|
* C#: Re-introduce generic Godot Array and DictionaryIgnacio Roldán Etcheverry2022-08-221-0/+6
| | | | | | | | | | | | | | | This new version does not support the following type arguments: - Generic types - Array of Godot Object (Godot.Object[]) or derived types The new implementation uses delegate pointers to call the Variant conversion methods. We do type checking only once in the static constructor to get the conversion delegates. Now, we no longer need to do type checking every time, and we no longer have to box value types. This is the best implementation I could come up with, as C# generics don't support anything similar to C++ template specializations.
* C#: Array, Dictionary and marshaling refactoringIgnacio Roldán Etcheverry2022-08-221-32/+3
| | | | | | | | | | | | | | | - Array and Dictionary now store `Variant` instead of `System.Object`. - Removed generic Array and Dictionary. They cause too much issues, heavily relying on reflection and very limited by the lack of a generic specialization. - Removed support for non-Godot collections. Support for them also relied heavily on reflection for marshaling. Support for them will likely be re-introduced in the future, but it will have to rely on source generators instead of reflection. - Reduced our use of reflection. The remaining usages will be moved to source generators soon. The only usage that I'm not sure yet how to replace is dynamic invocation of delegates.
* C#: Add dedicated Variant struct, replacing System.ObjectIgnacio Roldán Etcheverry2022-08-221-2/+1
|
* C#: Add source generator for properties and exports default valuesIgnacio Roldán Etcheverry2022-08-221-0/+133
The editor no longer needs to create temporary instances to get the default values. The initializer values of the exported properties are still evaluated at runtime. For example, in the following example, `GetInitialValue()` will be called when first looks for default values: ``` [Export] int MyValue = GetInitialValue(); ``` Exporting fields with a non-supported type now results in a compiler error rather than a runtime error when the script is used.