Cleanup C# projects, code quality & style

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)
This commit is contained in:
Paul Joannon 2024-02-19 22:15:37 +01:00
parent bb6b06c813
commit 139a5df821
No known key found for this signature in database
GPG Key ID: C12F69B0AD0390DD
69 changed files with 1747 additions and 1712 deletions

View File

@ -13,22 +13,59 @@ trim_trailing_whitespace = true
max_line_length = 120
csharp_indent_case_contents_when_block = false
[*.cs]
# CA1707: Identifiers should not contain underscores
# TODO:
# Maybe we could disable this selectively only
# where it's not desired and for generated code.
dotnet_diagnostic.CA1707.severity = none
# CA1711: Identifiers should not have incorrect suffix
# Disable warning for suffixes like EventHandler, Flags, Enum, etc.
dotnet_diagnostic.CA1711.severity = none
# CA1716: Identifiers should not match keywords
# TODO: We should look into this.
dotnet_diagnostic.CA1716.severity = warning
# CA1720: Identifiers should not contain type names
dotnet_diagnostic.CA1720.severity = none
# CA1805: Do not initialize unnecessarily
# Don't tell me what to do.
dotnet_diagnostic.CA1805.severity = none
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
dotnet_style_require_accessibility_modifiers = always
# Diagnostics to prevent defensive copies of `in` struct parameters
resharper_possibly_impure_method_call_on_readonly_variable_highlighting = error
# IDE0040: Add accessibility modifiers
dotnet_diagnostic.IDE0040.severity = warning
# IDE1006: Naming rule violation
dotnet_diagnostic.IDE1006.severity = suggestion
# Severity levels for dotnet_naming_rule only affect IDE environments.
# To have them extra visible to people, we can set them as 'warning' here without affecting compilation.
# Everything should be PascalCase by default
dotnet_naming_rule.all_should_be_camel_case.severity = warning
dotnet_naming_rule.all_should_be_camel_case.symbols = all
dotnet_naming_rule.all_should_be_camel_case.style = pascal_case_style
# Non-public fields should be _camelCase
dotnet_naming_rule.non_public_fields_should_be_underscore_camel_case.severity = warning
dotnet_naming_rule.non_public_fields_should_be_underscore_camel_case.symbols = non_public_fields
dotnet_naming_rule.non_public_fields_should_be_underscore_camel_case.style = underscore_camel_case_style
# Constant fields (and local vars) should be PascalCase
dotnet_naming_rule.constants_should_be_pascal_case.severity = warning
dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants
dotnet_naming_rule.constants_should_be_pascal_case.style = pascal_case_style
# Locals variables should be camelCase
dotnet_naming_rule.local_vars_should_be_camel_case.severity = warning
dotnet_naming_rule.local_vars_should_be_camel_case.symbols = local_vars
dotnet_naming_rule.local_vars_should_be_camel_case.style = camel_case_style
# Parameters should be camelCase
dotnet_naming_rule.parameters_should_be_camel_case.severity = warning
dotnet_naming_rule.parameters_should_be_camel_case.symbols = parameters
dotnet_naming_rule.parameters_should_be_camel_case.style = camel_case_style
dotnet_naming_symbols.all.applicable_kinds = *
dotnet_naming_symbols.local_vars.applicable_kinds = local
dotnet_naming_symbols.parameters.applicable_kinds = parameter
dotnet_naming_symbols.constants.applicable_kinds = field, local
dotnet_naming_symbols.constants.required_modifiers = const
dotnet_naming_symbols.non_public_fields.applicable_kinds = field
dotnet_naming_symbols.non_public_fields.applicable_accessibilities = private, protected, private_protected
dotnet_naming_style.camel_case_style.capitalization = camel_case
dotnet_naming_style.camel_case_style.required_prefix =
dotnet_naming_style.underscore_camel_case_style.capitalization = camel_case
dotnet_naming_style.underscore_camel_case_style.required_prefix = _
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
dotnet_naming_style.pascal_case_style.required_prefix =

View File

@ -312,7 +312,7 @@ def generate_sdk_package_versions():
)
# We write in ../SdkPackageVersions.props.
with open(os.path.join(dirname(script_path), "SdkPackageVersions.props"), "w") as f:
with open(os.path.join(dirname(script_path), "SdkPackageVersions.props"), "w", encoding="utf-8") as f:
f.write(props)
f.close()
@ -320,6 +320,8 @@ def generate_sdk_package_versions():
constants = """namespace Godot.SourceGenerators
{{
// TODO: This is currently disabled because of https://github.com/dotnet/roslyn/issues/52904
#pragma warning disable IDE0040 // Add accessibility modifiers.
partial class Common
{{
public const string VersionDocsUrl = "https://docs.godotengine.org/en/{docs_branch}";
@ -338,7 +340,7 @@ def generate_sdk_package_versions():
)
os.makedirs(generators_dir, exist_ok=True)
with open(os.path.join(generators_dir, "Common.Constants.cs"), "w") as f:
with open(os.path.join(generators_dir, "Common.Constants.cs"), "w", newline="\n", encoding="utf-8") as f:
f.write(constants)
f.close()

View File

@ -1,15 +1,15 @@
namespace Godot.SourceGenerators.Sample
{
partial class Bar : GodotObject
public partial class Bar : GodotObject
{
}
// Foo in another file
partial class Foo
public partial class Foo
{
}
partial class NotSameNameAsFile : GodotObject
public partial class NotSameNameAsFile : GodotObject
{
}
}

View File

@ -13,106 +13,106 @@ namespace Godot.SourceGenerators.Sample
[SuppressMessage("ReSharper", "InconsistentNaming")]
public partial class ExportedFields : GodotObject
{
[Export] private Boolean field_Boolean = true;
[Export] private Char field_Char = 'f';
[Export] private SByte field_SByte = 10;
[Export] private Int16 field_Int16 = 10;
[Export] private Int32 field_Int32 = 10;
[Export] private Int64 field_Int64 = 10;
[Export] private Byte field_Byte = 10;
[Export] private UInt16 field_UInt16 = 10;
[Export] private UInt32 field_UInt32 = 10;
[Export] private UInt64 field_UInt64 = 10;
[Export] private Single field_Single = 10;
[Export] private Double field_Double = 10;
[Export] private String field_String = "foo";
[Export] private Boolean _fieldBoolean = true;
[Export] private Char _fieldChar = 'f';
[Export] private SByte _fieldSByte = 10;
[Export] private Int16 _fieldInt16 = 10;
[Export] private Int32 _fieldInt32 = 10;
[Export] private Int64 _fieldInt64 = 10;
[Export] private Byte _fieldByte = 10;
[Export] private UInt16 _fieldUInt16 = 10;
[Export] private UInt32 _fieldUInt32 = 10;
[Export] private UInt64 _fieldUInt64 = 10;
[Export] private Single _fieldSingle = 10;
[Export] private Double _fieldDouble = 10;
[Export] private String _fieldString = "foo";
// Godot structs
[Export] private Vector2 field_Vector2 = new(10f, 10f);
[Export] private Vector2I field_Vector2I = Vector2I.Up;
[Export] private Rect2 field_Rect2 = new(new Vector2(10f, 10f), new Vector2(10f, 10f));
[Export] private Rect2I field_Rect2I = new(new Vector2I(10, 10), new Vector2I(10, 10));
[Export] private Transform2D field_Transform2D = Transform2D.Identity;
[Export] private Vector3 field_Vector3 = new(10f, 10f, 10f);
[Export] private Vector3I field_Vector3I = Vector3I.Back;
[Export] private Basis field_Basis = new Basis(Quaternion.Identity);
[Export] private Quaternion field_Quaternion = new Quaternion(Basis.Identity);
[Export] private Transform3D field_Transform3D = Transform3D.Identity;
[Export] private Vector4 field_Vector4 = new(10f, 10f, 10f, 10f);
[Export] private Vector4I field_Vector4I = Vector4I.One;
[Export] private Projection field_Projection = Projection.Identity;
[Export] private Aabb field_Aabb = new Aabb(10f, 10f, 10f, new Vector3(1f, 1f, 1f));
[Export] private Color field_Color = Colors.Aquamarine;
[Export] private Plane field_Plane = Plane.PlaneXZ;
[Export] private Callable field_Callable = new Callable(Engine.GetMainLoop(), "_process");
[Export] private Signal field_Signal = new Signal(Engine.GetMainLoop(), "property_list_changed");
[Export] private Vector2 _fieldVector2 = new(10f, 10f);
[Export] private Vector2I _fieldVector2I = Vector2I.Up;
[Export] private Rect2 _fieldRect2 = new(new Vector2(10f, 10f), new Vector2(10f, 10f));
[Export] private Rect2I _fieldRect2I = new(new Vector2I(10, 10), new Vector2I(10, 10));
[Export] private Transform2D _fieldTransform2D = Transform2D.Identity;
[Export] private Vector3 _fieldVector3 = new(10f, 10f, 10f);
[Export] private Vector3I _fieldVector3I = Vector3I.Back;
[Export] private Basis _fieldBasis = new Basis(Quaternion.Identity);
[Export] private Quaternion _fieldQuaternion = new Quaternion(Basis.Identity);
[Export] private Transform3D _fieldTransform3D = Transform3D.Identity;
[Export] private Vector4 _fieldVector4 = new(10f, 10f, 10f, 10f);
[Export] private Vector4I _fieldVector4I = Vector4I.One;
[Export] private Projection _fieldProjection = Projection.Identity;
[Export] private Aabb _fieldAabb = new Aabb(10f, 10f, 10f, new Vector3(1f, 1f, 1f));
[Export] private Color _fieldColor = Colors.Aquamarine;
[Export] private Plane _fieldPlane = Plane.PlaneXZ;
[Export] private Callable _fieldCallable = new Callable(Engine.GetMainLoop(), "_process");
[Export] private Signal _fieldSignal = new Signal(Engine.GetMainLoop(), "property_list_changed");
// Enums
[SuppressMessage("ReSharper", "UnusedMember.Local")]
enum MyEnum
public enum MyEnum
{
A,
B,
C
}
[Export] private MyEnum field_Enum = MyEnum.C;
[Export] private MyEnum _fieldEnum = MyEnum.C;
[Flags]
[SuppressMessage("ReSharper", "UnusedMember.Local")]
enum MyFlagsEnum
public enum MyFlagsEnum
{
A,
B,
C
}
[Export] private MyFlagsEnum field_FlagsEnum = MyFlagsEnum.C;
[Export] private MyFlagsEnum _fieldFlagsEnum = MyFlagsEnum.C;
// Arrays
[Export] private Byte[] field_ByteArray = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int32[] field_Int32Array = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int64[] field_Int64Array = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Single[] field_SingleArray = { 0f, 1f, 2f, 3f, 4f, 5f, 6f };
[Export] private Double[] field_DoubleArray = { 0d, 1d, 2d, 3d, 4d, 5d, 6d };
[Export] private String[] field_StringArray = { "foo", "bar" };
[Export(PropertyHint.Enum, "A,B,C")] private String[] field_StringArrayEnum = { "foo", "bar" };
[Export] private Vector2[] field_Vector2Array = { Vector2.Up, Vector2.Down, Vector2.Left, Vector2.Right };
[Export] private Vector3[] field_Vector3Array = { Vector3.Up, Vector3.Down, Vector3.Left, Vector3.Right };
[Export] private Color[] field_ColorArray = { Colors.Aqua, Colors.Aquamarine, Colors.Azure, Colors.Beige };
[Export] private GodotObject[] field_GodotObjectOrDerivedArray = { null };
[Export] private StringName[] field_StringNameArray = { "foo", "bar" };
[Export] private NodePath[] field_NodePathArray = { "foo", "bar" };
[Export] private Rid[] field_RidArray = { default, default, default };
[Export] private Byte[] _fieldByteArray = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int32[] _fieldInt32Array = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int64[] _fieldInt64Array = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Single[] _fieldSingleArray = { 0f, 1f, 2f, 3f, 4f, 5f, 6f };
[Export] private Double[] _fieldDoubleArray = { 0d, 1d, 2d, 3d, 4d, 5d, 6d };
[Export] private String[] _fieldStringArray = { "foo", "bar" };
[Export(PropertyHint.Enum, "A,B,C")] private String[] _fieldStringArrayEnum = { "foo", "bar" };
[Export] private Vector2[] _fieldVector2Array = { Vector2.Up, Vector2.Down, Vector2.Left, Vector2.Right };
[Export] private Vector3[] _fieldVector3Array = { Vector3.Up, Vector3.Down, Vector3.Left, Vector3.Right };
[Export] private Color[] _fieldColorArray = { Colors.Aqua, Colors.Aquamarine, Colors.Azure, Colors.Beige };
[Export] private GodotObject[] _fieldGodotObjectOrDerivedArray = { null };
[Export] private StringName[] _fieldStringNameArray = { "foo", "bar" };
[Export] private NodePath[] _fieldNodePathArray = { "foo", "bar" };
[Export] private Rid[] _fieldRidArray = { default, default, default };
// Note we use Array and not System.Array. This tests the generated namespace qualification.
[Export] private Int32[] field_empty_Int32Array = Array.Empty<Int32>();
[Export] private Int32[] _fieldEmptyInt32Array = Array.Empty<Int32>();
// Note we use List and not System.Collections.Generic.
[Export] private int[] field_array_from_list = new List<int>(Array.Empty<int>()).ToArray();
[Export] private int[] _fieldArrayFromList = new List<int>(Array.Empty<int>()).ToArray();
// Variant
[Export] private Variant field_Variant = "foo";
[Export] private Variant _fieldVariant = "foo";
// Classes
[Export] private GodotObject field_GodotObjectOrDerived;
[Export] private Godot.Texture field_GodotResourceTexture;
[Export] private StringName field_StringName = new StringName("foo");
[Export] private NodePath field_NodePath = new NodePath("foo");
[Export] private Rid field_Rid;
[Export] private GodotObject _fieldGodotObjectOrDerived;
[Export] private Godot.Texture _fieldGodotResourceTexture;
[Export] private StringName _fieldStringName = new StringName("foo");
[Export] private NodePath _fieldNodePath = new NodePath("foo");
[Export] private Rid _fieldRid;
[Export]
private Godot.Collections.Dictionary field_GodotDictionary =
private Godot.Collections.Dictionary _fieldGodotDictionary =
new() { { "foo", 10 }, { Vector2.Up, Colors.Chocolate } };
[Export]
private Godot.Collections.Array field_GodotArray =
private Godot.Collections.Array _fieldGodotArray =
new() { "foo", 10, Vector2.Up, Colors.Chocolate };
[Export]
private Godot.Collections.Dictionary<string, bool> field_GodotGenericDictionary =
private Godot.Collections.Dictionary<string, bool> _fieldGodotGenericDictionary =
new() { { "foo", true }, { "bar", false } };
[Export]
private Godot.Collections.Array<int> field_GodotGenericArray =
private Godot.Collections.Array<int> _fieldGodotGenericArray =
new() { 0, 1, 2, 3, 4, 5, 6 };
}
}

View File

@ -13,41 +13,41 @@ namespace Godot.SourceGenerators.Sample
public partial class ExportedProperties : GodotObject
{
// Do not generate default value
private String _notGenerate_Property_String = new string("not generate");
private String _notGeneratePropertyString = new string("not generate");
[Export]
public String NotGenerate_Complex_Lamda_Property
public String NotGenerateComplexLambdaProperty
{
get => _notGenerate_Property_String + Convert.ToInt32("1");
set => _notGenerate_Property_String = value;
get => _notGeneratePropertyString + Convert.ToInt32("1");
set => _notGeneratePropertyString = value;
}
[Export]
public String NotGenerate_Lamda_NoField_Property
public String NotGenerateLambdaNoFieldProperty
{
get => new string("not generate");
set => _notGenerate_Property_String = value;
set => _notGeneratePropertyString = value;
}
[Export]
public String NotGenerate_Complex_Return_Property
public String NotGenerateComplexReturnProperty
{
get
{
return _notGenerate_Property_String + Convert.ToInt32("1");
return _notGeneratePropertyString + Convert.ToInt32("1");
}
set
{
_notGenerate_Property_String = value;
_notGeneratePropertyString = value;
}
}
private int _notGenerate_Property_Int = 1;
private int _notGeneratePropertyInt = 1;
[Export]
public string NotGenerate_Returns_Property
{
get
{
if (_notGenerate_Property_Int == 1)
if (_notGeneratePropertyInt == 1)
{
return "a";
}
@ -58,145 +58,145 @@ namespace Godot.SourceGenerators.Sample
}
set
{
_notGenerate_Property_Int = value == "a" ? 1 : 2;
_notGeneratePropertyInt = value == "a" ? 1 : 2;
}
}
// Full Property
private String _fullProperty_String = "FullProperty_String";
private String _fullPropertyString = "FullPropertyString";
[Export]
public String FullProperty_String
public String FullPropertyString
{
get
{
return _fullProperty_String;
return _fullPropertyString;
}
set
{
_fullProperty_String = value;
_fullPropertyString = value;
}
}
private String _fullProperty_String_Complex = new string("FullProperty_String_Complex") + Convert.ToInt32("1");
private String _fullPropertyStringComplex = new string("FullPropertyString_Complex") + Convert.ToInt32("1");
[Export]
public String FullProperty_String_Complex
public String FullPropertyStringComplex
{
get
{
return _fullProperty_String_Complex;
return _fullPropertyStringComplex;
}
set
{
_fullProperty_String_Complex = value;
_fullPropertyStringComplex = value;
}
}
// Lambda Property
private String _lamdaProperty_String = "LamdaProperty_String";
private String _lamdaPropertyString = "LamdaPropertyString";
[Export]
public String LamdaProperty_String
public String LamdaPropertyString
{
get => _lamdaProperty_String;
set => _lamdaProperty_String = value;
get => _lamdaPropertyString;
set => _lamdaPropertyString = value;
}
// Auto Property
[Export] private Boolean property_Boolean { get; set; } = true;
[Export] private Char property_Char { get; set; } = 'f';
[Export] private SByte property_SByte { get; set; } = 10;
[Export] private Int16 property_Int16 { get; set; } = 10;
[Export] private Int32 property_Int32 { get; set; } = 10;
[Export] private Int64 property_Int64 { get; set; } = 10;
[Export] private Byte property_Byte { get; set; } = 10;
[Export] private UInt16 property_UInt16 { get; set; } = 10;
[Export] private UInt32 property_UInt32 { get; set; } = 10;
[Export] private UInt64 property_UInt64 { get; set; } = 10;
[Export] private Single property_Single { get; set; } = 10;
[Export] private Double property_Double { get; set; } = 10;
[Export] private String property_String { get; set; } = "foo";
[Export] private Boolean PropertyBoolean { get; set; } = true;
[Export] private Char PropertyChar { get; set; } = 'f';
[Export] private SByte PropertySByte { get; set; } = 10;
[Export] private Int16 PropertyInt16 { get; set; } = 10;
[Export] private Int32 PropertyInt32 { get; set; } = 10;
[Export] private Int64 PropertyInt64 { get; set; } = 10;
[Export] private Byte PropertyByte { get; set; } = 10;
[Export] private UInt16 PropertyUInt16 { get; set; } = 10;
[Export] private UInt32 PropertyUInt32 { get; set; } = 10;
[Export] private UInt64 PropertyUInt64 { get; set; } = 10;
[Export] private Single PropertySingle { get; set; } = 10;
[Export] private Double PropertyDouble { get; set; } = 10;
[Export] private String PropertyString { get; set; } = "foo";
// Godot structs
[Export] private Vector2 property_Vector2 { get; set; } = new(10f, 10f);
[Export] private Vector2I property_Vector2I { get; set; } = Vector2I.Up;
[Export] private Rect2 property_Rect2 { get; set; } = new(new Vector2(10f, 10f), new Vector2(10f, 10f));
[Export] private Rect2I property_Rect2I { get; set; } = new(new Vector2I(10, 10), new Vector2I(10, 10));
[Export] private Transform2D property_Transform2D { get; set; } = Transform2D.Identity;
[Export] private Vector3 property_Vector3 { get; set; } = new(10f, 10f, 10f);
[Export] private Vector3I property_Vector3I { get; set; } = Vector3I.Back;
[Export] private Basis property_Basis { get; set; } = new Basis(Quaternion.Identity);
[Export] private Quaternion property_Quaternion { get; set; } = new Quaternion(Basis.Identity);
[Export] private Transform3D property_Transform3D { get; set; } = Transform3D.Identity;
[Export] private Vector4 property_Vector4 { get; set; } = new(10f, 10f, 10f, 10f);
[Export] private Vector4I property_Vector4I { get; set; } = Vector4I.One;
[Export] private Projection property_Projection { get; set; } = Projection.Identity;
[Export] private Aabb property_Aabb { get; set; } = new Aabb(10f, 10f, 10f, new Vector3(1f, 1f, 1f));
[Export] private Color property_Color { get; set; } = Colors.Aquamarine;
[Export] private Plane property_Plane { get; set; } = Plane.PlaneXZ;
[Export] private Callable property_Callable { get; set; } = new Callable(Engine.GetMainLoop(), "_process");
[Export] private Signal property_Signal { get; set; } = new Signal(Engine.GetMainLoop(), "property_list_changed");
[Export] private Vector2 PropertyVector2 { get; set; } = new(10f, 10f);
[Export] private Vector2I PropertyVector2I { get; set; } = Vector2I.Up;
[Export] private Rect2 PropertyRect2 { get; set; } = new(new Vector2(10f, 10f), new Vector2(10f, 10f));
[Export] private Rect2I PropertyRect2I { get; set; } = new(new Vector2I(10, 10), new Vector2I(10, 10));
[Export] private Transform2D PropertyTransform2D { get; set; } = Transform2D.Identity;
[Export] private Vector3 PropertyVector3 { get; set; } = new(10f, 10f, 10f);
[Export] private Vector3I PropertyVector3I { get; set; } = Vector3I.Back;
[Export] private Basis PropertyBasis { get; set; } = new Basis(Quaternion.Identity);
[Export] private Quaternion PropertyQuaternion { get; set; } = new Quaternion(Basis.Identity);
[Export] private Transform3D PropertyTransform3D { get; set; } = Transform3D.Identity;
[Export] private Vector4 PropertyVector4 { get; set; } = new(10f, 10f, 10f, 10f);
[Export] private Vector4I PropertyVector4I { get; set; } = Vector4I.One;
[Export] private Projection PropertyProjection { get; set; } = Projection.Identity;
[Export] private Aabb PropertyAabb { get; set; } = new Aabb(10f, 10f, 10f, new Vector3(1f, 1f, 1f));
[Export] private Color PropertyColor { get; set; } = Colors.Aquamarine;
[Export] private Plane PropertyPlane { get; set; } = Plane.PlaneXZ;
[Export] private Callable PropertyCallable { get; set; } = new Callable(Engine.GetMainLoop(), "_process");
[Export] private Signal PropertySignal { get; set; } = new Signal(Engine.GetMainLoop(), "Propertylist_changed");
// Enums
[SuppressMessage("ReSharper", "UnusedMember.Local")]
enum MyEnum
public enum MyEnum
{
A,
B,
C
}
[Export] private MyEnum property_Enum { get; set; } = MyEnum.C;
[Export] private MyEnum PropertyEnum { get; set; } = MyEnum.C;
[Flags]
[SuppressMessage("ReSharper", "UnusedMember.Local")]
enum MyFlagsEnum
public enum MyFlagsEnum
{
A,
B,
C
}
[Export] private MyFlagsEnum property_FlagsEnum { get; set; } = MyFlagsEnum.C;
[Export] private MyFlagsEnum PropertyFlagsEnum { get; set; } = MyFlagsEnum.C;
// Arrays
[Export] private Byte[] property_ByteArray { get; set; } = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int32[] property_Int32Array { get; set; } = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int64[] property_Int64Array { get; set; } = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Single[] property_SingleArray { get; set; } = { 0f, 1f, 2f, 3f, 4f, 5f, 6f };
[Export] private Double[] property_DoubleArray { get; set; } = { 0d, 1d, 2d, 3d, 4d, 5d, 6d };
[Export] private String[] property_StringArray { get; set; } = { "foo", "bar" };
[Export(PropertyHint.Enum, "A,B,C")] private String[] property_StringArrayEnum { get; set; } = { "foo", "bar" };
[Export] private Vector2[] property_Vector2Array { get; set; } = { Vector2.Up, Vector2.Down, Vector2.Left, Vector2.Right };
[Export] private Vector3[] property_Vector3Array { get; set; } = { Vector3.Up, Vector3.Down, Vector3.Left, Vector3.Right };
[Export] private Color[] property_ColorArray { get; set; } = { Colors.Aqua, Colors.Aquamarine, Colors.Azure, Colors.Beige };
[Export] private GodotObject[] property_GodotObjectOrDerivedArray { get; set; } = { null };
[Export] private StringName[] field_StringNameArray { get; set; } = { "foo", "bar" };
[Export] private NodePath[] field_NodePathArray { get; set; } = { "foo", "bar" };
[Export] private Rid[] field_RidArray { get; set; } = { default, default, default };
[Export] private Byte[] PropertyByteArray { get; set; } = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int32[] PropertyInt32Array { get; set; } = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int64[] PropertyInt64Array { get; set; } = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Single[] PropertySingleArray { get; set; } = { 0f, 1f, 2f, 3f, 4f, 5f, 6f };
[Export] private Double[] PropertyDoubleArray { get; set; } = { 0d, 1d, 2d, 3d, 4d, 5d, 6d };
[Export] private String[] PropertyStringArray { get; set; } = { "foo", "bar" };
[Export(PropertyHint.Enum, "A,B,C")] private String[] PropertyStringArrayEnum { get; set; } = { "foo", "bar" };
[Export] private Vector2[] PropertyVector2Array { get; set; } = { Vector2.Up, Vector2.Down, Vector2.Left, Vector2.Right };
[Export] private Vector3[] PropertyVector3Array { get; set; } = { Vector3.Up, Vector3.Down, Vector3.Left, Vector3.Right };
[Export] private Color[] PropertyColorArray { get; set; } = { Colors.Aqua, Colors.Aquamarine, Colors.Azure, Colors.Beige };
[Export] private GodotObject[] PropertyGodotObjectOrDerivedArray { get; set; } = { null };
[Export] private StringName[] PropertyStringNameArray { get; set; } = { "foo", "bar" };
[Export] private NodePath[] PropertyNodePathArray { get; set; } = { "foo", "bar" };
[Export] private Rid[] PropertyRidArray { get; set; } = { default, default, default };
// Variant
[Export] private Variant property_Variant { get; set; } = "foo";
[Export] private Variant PropertyVariant { get; set; } = "foo";
// Classes
[Export] private GodotObject property_GodotObjectOrDerived { get; set; }
[Export] private Godot.Texture property_GodotResourceTexture { get; set; }
[Export] private StringName property_StringName { get; set; } = new StringName("foo");
[Export] private NodePath property_NodePath { get; set; } = new NodePath("foo");
[Export] private Rid property_Rid { get; set; }
[Export] private GodotObject PropertyGodotObjectOrDerived { get; set; }
[Export] private Godot.Texture PropertyGodotResourceTexture { get; set; }
[Export] private StringName PropertyStringName { get; set; } = new StringName("foo");
[Export] private NodePath PropertyNodePath { get; set; } = new NodePath("foo");
[Export] private Rid PropertyRid { get; set; }
[Export]
private Godot.Collections.Dictionary property_GodotDictionary { get; set; } =
private Godot.Collections.Dictionary PropertyGodotDictionary { get; set; } =
new() { { "foo", 10 }, { Vector2.Up, Colors.Chocolate } };
[Export]
private Godot.Collections.Array property_GodotArray { get; set; } =
private Godot.Collections.Array PropertyGodotArray { get; set; } =
new() { "foo", 10, Vector2.Up, Colors.Chocolate };
[Export]
private Godot.Collections.Dictionary<string, bool> property_GodotGenericDictionary { get; set; } =
private Godot.Collections.Dictionary<string, bool> PropertyGodotGenericDictionary { get; set; } =
new() { { "foo", true }, { "bar", false } };
[Export]
private Godot.Collections.Array<int> property_GodotGenericArray { get; set; } =
private Godot.Collections.Array<int> PropertyGodotGenericArray { get; set; } =
new() { 0, 1, 2, 3, 4, 5, 6 };
}
}

View File

@ -1,11 +1,11 @@
namespace Godot.SourceGenerators.Sample
{
partial class Foo : GodotObject
public partial class Foo : GodotObject
{
}
// Foo again in the same file
partial class Foo
public partial class Foo
{
}
}

View File

@ -3,7 +3,7 @@
namespace Godot.SourceGenerators.Sample
{
// Generic again but without generic parameters
partial class Generic : GodotObject
public partial class Generic : GodotObject
{
private int _field;
}

View File

@ -2,7 +2,7 @@
namespace Godot.SourceGenerators.Sample
{
partial class Generic1T<T> : GodotObject
public partial class Generic1T<T> : GodotObject
{
private int _field;
}

View File

@ -3,7 +3,7 @@
namespace Godot.SourceGenerators.Sample
{
// Generic again but different generic parameters
partial class Generic2T<T, R> : GodotObject
public partial class Generic2T<T, R> : GodotObject
{
private int _field;
}

View File

@ -14,6 +14,6 @@ namespace Godot.SourceGenerators.Sample
public partial class ExportedFields : GodotObject
{
// Note we use Array and not System.Array. This tests the generated namespace qualification.
[Export] private Int64[] field_empty_Int64Array = Array.Empty<Int64>();
[Export] private Int64[] _fieldEmptyInt64Array = Array.Empty<Int64>();
}
}

View File

@ -11,8 +11,8 @@ public partial class NestedClass : GodotObject
[Signal]
public delegate void MySignalEventHandler(string str, int num);
[Export] private String field_String = "foo";
[Export] private String property_String { get; set; } = "foo";
[Export] private String _fieldString = "foo";
[Export] private String PropertyString { get; set; } = "foo";
private void Method()
{

View File

@ -2,9 +2,9 @@ namespace Godot.SourceGenerators.Sample
{
public partial class AllReadOnly : GodotObject
{
public readonly string readonly_field = "foo";
public string readonly_auto_property { get; } = "foo";
public string readonly_property { get => "foo"; }
public string initonly_auto_property { get; init; }
public readonly string ReadonlyField = "foo";
public string ReadonlyAutoProperty { get; } = "foo";
public string ReadonlyProperty { get => "foo"; }
public string InitonlyAutoProperty { get; init; }
}
}

View File

@ -4,7 +4,7 @@ namespace Godot.SourceGenerators.Sample
{
public partial class AllWriteOnly : GodotObject
{
bool writeonly_backing_field = false;
public bool writeonly_property { set => writeonly_backing_field = value; }
private bool _writeOnlyBackingField = false;
public bool WriteOnlyProperty { set => _writeOnlyBackingField = value; }
}
}

View File

@ -2,12 +2,12 @@ namespace Godot.SourceGenerators.Sample
{
public partial class MixedReadonlyWriteOnly : GodotObject
{
public readonly string readonly_field = "foo";
public string readonly_auto_property { get; } = "foo";
public string readonly_property { get => "foo"; }
public string initonly_auto_property { get; init; }
public readonly string ReadOnlyField = "foo";
public string ReadOnlyAutoProperty { get; } = "foo";
public string ReadOnlyProperty { get => "foo"; }
public string InitOnlyAutoProperty { get; init; }
bool writeonly_backing_field = false;
public bool writeonly_property { set => writeonly_backing_field = value; }
private bool _writeOnlyBackingField = false;
public bool WriteOnlyProperty { set => _writeOnlyBackingField = value; }
}
}

View File

@ -26,7 +26,7 @@ namespace Godot.SourceGenerators.Sample
}
}
partial struct OuterClass
public partial struct OuterClass
{
public partial class NesterClass : RefCounted
{

View File

@ -41,7 +41,7 @@ public class ScriptPropertiesGeneratorTests
}
[Fact]
public async void OneWayPropertiesMixedReadonlyWriteOnly()
public async void OneWayPropertiesMixedReadOnlyWriteOnly()
{
await CSharpSourceGeneratorVerifier<ScriptPropertiesGenerator>.Verify(
"MixedReadOnlyWriteOnly.cs",

View File

@ -9,40 +9,40 @@ partial class AllReadOnly
/// </summary>
public new class PropertyName : global::Godot.GodotObject.PropertyName {
/// <summary>
/// Cached name for the 'readonly_auto_property' property.
/// Cached name for the 'ReadOnlyAutoProperty' property.
/// </summary>
public new static readonly global::Godot.StringName readonly_auto_property = "readonly_auto_property";
public new static readonly global::Godot.StringName ReadOnlyAutoProperty = "ReadOnlyAutoProperty";
/// <summary>
/// Cached name for the 'readonly_property' property.
/// Cached name for the 'ReadOnlyProperty' property.
/// </summary>
public new static readonly global::Godot.StringName readonly_property = "readonly_property";
public new static readonly global::Godot.StringName ReadOnlyProperty = "ReadOnlyProperty";
/// <summary>
/// Cached name for the 'initonly_auto_property' property.
/// Cached name for the 'InitOnlyAutoProperty' property.
/// </summary>
public new static readonly global::Godot.StringName initonly_auto_property = "initonly_auto_property";
public new static readonly global::Godot.StringName InitOnlyAutoProperty = "InitOnlyAutoProperty";
/// <summary>
/// Cached name for the 'readonly_field' field.
/// Cached name for the 'ReadOnlyField' field.
/// </summary>
public new static readonly global::Godot.StringName readonly_field = "readonly_field";
public new static readonly global::Godot.StringName ReadOnlyField = "ReadOnlyField";
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool GetGodotClassPropertyValue(in godot_string_name name, out godot_variant value)
{
if (name == PropertyName.readonly_auto_property) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.readonly_auto_property);
if (name == PropertyName.ReadOnlyAutoProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.ReadOnlyAutoProperty);
return true;
}
else if (name == PropertyName.readonly_property) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.readonly_property);
else if (name == PropertyName.ReadOnlyProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.ReadOnlyProperty);
return true;
}
else if (name == PropertyName.initonly_auto_property) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.initonly_auto_property);
else if (name == PropertyName.InitOnlyAutoProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.InitOnlyAutoProperty);
return true;
}
else if (name == PropertyName.readonly_field) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.readonly_field);
else if (name == PropertyName.ReadOnlyField) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.ReadOnlyField);
return true;
}
return base.GetGodotClassPropertyValue(name, out value);
@ -56,10 +56,10 @@ partial class AllReadOnly
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo> GetGodotPropertyList()
{
var properties = new global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo>();
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.readonly_field, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.readonly_auto_property, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.readonly_property, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.initonly_auto_property, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.ReadOnlyField, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.ReadOnlyAutoProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.ReadOnlyProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.InitOnlyAutoProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
return properties;
}
#pragma warning restore CS0109

View File

@ -9,24 +9,24 @@ partial class AllWriteOnly
/// </summary>
public new class PropertyName : global::Godot.GodotObject.PropertyName {
/// <summary>
/// Cached name for the 'writeonly_property' property.
/// Cached name for the 'WriteOnlyProperty' property.
/// </summary>
public new static readonly global::Godot.StringName writeonly_property = "writeonly_property";
public new static readonly global::Godot.StringName WriteOnlyProperty = "WriteOnlyProperty";
/// <summary>
/// Cached name for the 'writeonly_backing_field' field.
/// Cached name for the '_writeOnlyBackingField' field.
/// </summary>
public new static readonly global::Godot.StringName writeonly_backing_field = "writeonly_backing_field";
public new static readonly global::Godot.StringName _writeOnlyBackingField = "_writeOnlyBackingField";
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool SetGodotClassPropertyValue(in godot_string_name name, in godot_variant value)
{
if (name == PropertyName.writeonly_property) {
this.writeonly_property = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
if (name == PropertyName.WriteOnlyProperty) {
this.WriteOnlyProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
return true;
}
else if (name == PropertyName.writeonly_backing_field) {
this.writeonly_backing_field = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
else if (name == PropertyName._writeOnlyBackingField) {
this._writeOnlyBackingField = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
return true;
}
return base.SetGodotClassPropertyValue(name, value);
@ -35,8 +35,8 @@ partial class AllWriteOnly
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool GetGodotClassPropertyValue(in godot_string_name name, out godot_variant value)
{
if (name == PropertyName.writeonly_backing_field) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<bool>(this.writeonly_backing_field);
if (name == PropertyName._writeOnlyBackingField) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<bool>(this._writeOnlyBackingField);
return true;
}
return base.GetGodotClassPropertyValue(name, out value);
@ -50,8 +50,8 @@ partial class AllWriteOnly
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo> GetGodotPropertyList()
{
var properties = new global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo>();
properties.Add(new(type: (global::Godot.Variant.Type)1, name: PropertyName.writeonly_backing_field, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)1, name: PropertyName.writeonly_property, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)1, name: PropertyName._writeOnlyBackingField, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)1, name: PropertyName.WriteOnlyProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
return properties;
}
#pragma warning restore CS0109

View File

@ -12,126 +12,126 @@ partial class ExportedFields
internal new static global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant> GetGodotPropertyDefaultValues()
{
var values = new global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant>(60);
bool __field_Boolean_default_value = true;
values.Add(PropertyName.field_Boolean, global::Godot.Variant.From<bool>(__field_Boolean_default_value));
char __field_Char_default_value = 'f';
values.Add(PropertyName.field_Char, global::Godot.Variant.From<char>(__field_Char_default_value));
sbyte __field_SByte_default_value = 10;
values.Add(PropertyName.field_SByte, global::Godot.Variant.From<sbyte>(__field_SByte_default_value));
short __field_Int16_default_value = 10;
values.Add(PropertyName.field_Int16, global::Godot.Variant.From<short>(__field_Int16_default_value));
int __field_Int32_default_value = 10;
values.Add(PropertyName.field_Int32, global::Godot.Variant.From<int>(__field_Int32_default_value));
long __field_Int64_default_value = 10;
values.Add(PropertyName.field_Int64, global::Godot.Variant.From<long>(__field_Int64_default_value));
byte __field_Byte_default_value = 10;
values.Add(PropertyName.field_Byte, global::Godot.Variant.From<byte>(__field_Byte_default_value));
ushort __field_UInt16_default_value = 10;
values.Add(PropertyName.field_UInt16, global::Godot.Variant.From<ushort>(__field_UInt16_default_value));
uint __field_UInt32_default_value = 10;
values.Add(PropertyName.field_UInt32, global::Godot.Variant.From<uint>(__field_UInt32_default_value));
ulong __field_UInt64_default_value = 10;
values.Add(PropertyName.field_UInt64, global::Godot.Variant.From<ulong>(__field_UInt64_default_value));
float __field_Single_default_value = 10;
values.Add(PropertyName.field_Single, global::Godot.Variant.From<float>(__field_Single_default_value));
double __field_Double_default_value = 10;
values.Add(PropertyName.field_Double, global::Godot.Variant.From<double>(__field_Double_default_value));
string __field_String_default_value = "foo";
values.Add(PropertyName.field_String, global::Godot.Variant.From<string>(__field_String_default_value));
global::Godot.Vector2 __field_Vector2_default_value = new(10f, 10f);
values.Add(PropertyName.field_Vector2, global::Godot.Variant.From<global::Godot.Vector2>(__field_Vector2_default_value));
global::Godot.Vector2I __field_Vector2I_default_value = global::Godot.Vector2I.Up;
values.Add(PropertyName.field_Vector2I, global::Godot.Variant.From<global::Godot.Vector2I>(__field_Vector2I_default_value));
global::Godot.Rect2 __field_Rect2_default_value = new(new global::Godot.Vector2(10f, 10f), new global::Godot.Vector2(10f, 10f));
values.Add(PropertyName.field_Rect2, global::Godot.Variant.From<global::Godot.Rect2>(__field_Rect2_default_value));
global::Godot.Rect2I __field_Rect2I_default_value = new(new global::Godot.Vector2I(10, 10), new global::Godot.Vector2I(10, 10));
values.Add(PropertyName.field_Rect2I, global::Godot.Variant.From<global::Godot.Rect2I>(__field_Rect2I_default_value));
global::Godot.Transform2D __field_Transform2D_default_value = global::Godot.Transform2D.Identity;
values.Add(PropertyName.field_Transform2D, global::Godot.Variant.From<global::Godot.Transform2D>(__field_Transform2D_default_value));
global::Godot.Vector3 __field_Vector3_default_value = new(10f, 10f, 10f);
values.Add(PropertyName.field_Vector3, global::Godot.Variant.From<global::Godot.Vector3>(__field_Vector3_default_value));
global::Godot.Vector3I __field_Vector3I_default_value = global::Godot.Vector3I.Back;
values.Add(PropertyName.field_Vector3I, global::Godot.Variant.From<global::Godot.Vector3I>(__field_Vector3I_default_value));
global::Godot.Basis __field_Basis_default_value = new global::Godot.Basis(global::Godot.Quaternion.Identity);
values.Add(PropertyName.field_Basis, global::Godot.Variant.From<global::Godot.Basis>(__field_Basis_default_value));
global::Godot.Quaternion __field_Quaternion_default_value = new global::Godot.Quaternion(global::Godot.Basis.Identity);
values.Add(PropertyName.field_Quaternion, global::Godot.Variant.From<global::Godot.Quaternion>(__field_Quaternion_default_value));
global::Godot.Transform3D __field_Transform3D_default_value = global::Godot.Transform3D.Identity;
values.Add(PropertyName.field_Transform3D, global::Godot.Variant.From<global::Godot.Transform3D>(__field_Transform3D_default_value));
global::Godot.Vector4 __field_Vector4_default_value = new(10f, 10f, 10f, 10f);
values.Add(PropertyName.field_Vector4, global::Godot.Variant.From<global::Godot.Vector4>(__field_Vector4_default_value));
global::Godot.Vector4I __field_Vector4I_default_value = global::Godot.Vector4I.One;
values.Add(PropertyName.field_Vector4I, global::Godot.Variant.From<global::Godot.Vector4I>(__field_Vector4I_default_value));
global::Godot.Projection __field_Projection_default_value = global::Godot.Projection.Identity;
values.Add(PropertyName.field_Projection, global::Godot.Variant.From<global::Godot.Projection>(__field_Projection_default_value));
global::Godot.Aabb __field_Aabb_default_value = new global::Godot.Aabb(10f, 10f, 10f, new global::Godot.Vector3(1f, 1f, 1f));
values.Add(PropertyName.field_Aabb, global::Godot.Variant.From<global::Godot.Aabb>(__field_Aabb_default_value));
global::Godot.Color __field_Color_default_value = global::Godot.Colors.Aquamarine;
values.Add(PropertyName.field_Color, global::Godot.Variant.From<global::Godot.Color>(__field_Color_default_value));
global::Godot.Plane __field_Plane_default_value = global::Godot.Plane.PlaneXZ;
values.Add(PropertyName.field_Plane, global::Godot.Variant.From<global::Godot.Plane>(__field_Plane_default_value));
global::Godot.Callable __field_Callable_default_value = new global::Godot.Callable(global::Godot.Engine.GetMainLoop(), "_process");
values.Add(PropertyName.field_Callable, global::Godot.Variant.From<global::Godot.Callable>(__field_Callable_default_value));
global::Godot.Signal __field_Signal_default_value = new global::Godot.Signal(global::Godot.Engine.GetMainLoop(), "property_list_changed");
values.Add(PropertyName.field_Signal, global::Godot.Variant.From<global::Godot.Signal>(__field_Signal_default_value));
global::ExportedFields.MyEnum __field_Enum_default_value = global::ExportedFields.MyEnum.C;
values.Add(PropertyName.field_Enum, global::Godot.Variant.From<global::ExportedFields.MyEnum>(__field_Enum_default_value));
global::ExportedFields.MyFlagsEnum __field_FlagsEnum_default_value = global::ExportedFields.MyFlagsEnum.C;
values.Add(PropertyName.field_FlagsEnum, global::Godot.Variant.From<global::ExportedFields.MyFlagsEnum>(__field_FlagsEnum_default_value));
byte[] __field_ByteArray_default_value = { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.field_ByteArray, global::Godot.Variant.From<byte[]>(__field_ByteArray_default_value));
int[] __field_Int32Array_default_value = { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.field_Int32Array, global::Godot.Variant.From<int[]>(__field_Int32Array_default_value));
long[] __field_Int64Array_default_value = { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.field_Int64Array, global::Godot.Variant.From<long[]>(__field_Int64Array_default_value));
float[] __field_SingleArray_default_value = { 0f, 1f, 2f, 3f, 4f, 5f, 6f };
values.Add(PropertyName.field_SingleArray, global::Godot.Variant.From<float[]>(__field_SingleArray_default_value));
double[] __field_DoubleArray_default_value = { 0d, 1d, 2d, 3d, 4d, 5d, 6d };
values.Add(PropertyName.field_DoubleArray, global::Godot.Variant.From<double[]>(__field_DoubleArray_default_value));
string[] __field_StringArray_default_value = { "foo", "bar" };
values.Add(PropertyName.field_StringArray, global::Godot.Variant.From<string[]>(__field_StringArray_default_value));
string[] __field_StringArrayEnum_default_value = { "foo", "bar" };
values.Add(PropertyName.field_StringArrayEnum, global::Godot.Variant.From<string[]>(__field_StringArrayEnum_default_value));
global::Godot.Vector2[] __field_Vector2Array_default_value = { global::Godot.Vector2.Up, global::Godot.Vector2.Down, global::Godot.Vector2.Left, global::Godot.Vector2.Right };
values.Add(PropertyName.field_Vector2Array, global::Godot.Variant.From<global::Godot.Vector2[]>(__field_Vector2Array_default_value));
global::Godot.Vector3[] __field_Vector3Array_default_value = { global::Godot.Vector3.Up, global::Godot.Vector3.Down, global::Godot.Vector3.Left, global::Godot.Vector3.Right };
values.Add(PropertyName.field_Vector3Array, global::Godot.Variant.From<global::Godot.Vector3[]>(__field_Vector3Array_default_value));
global::Godot.Color[] __field_ColorArray_default_value = { global::Godot.Colors.Aqua, global::Godot.Colors.Aquamarine, global::Godot.Colors.Azure, global::Godot.Colors.Beige };
values.Add(PropertyName.field_ColorArray, global::Godot.Variant.From<global::Godot.Color[]>(__field_ColorArray_default_value));
global::Godot.GodotObject[] __field_GodotObjectOrDerivedArray_default_value = { null };
values.Add(PropertyName.field_GodotObjectOrDerivedArray, global::Godot.Variant.CreateFrom(__field_GodotObjectOrDerivedArray_default_value));
global::Godot.StringName[] __field_StringNameArray_default_value = { "foo", "bar" };
values.Add(PropertyName.field_StringNameArray, global::Godot.Variant.From<global::Godot.StringName[]>(__field_StringNameArray_default_value));
global::Godot.NodePath[] __field_NodePathArray_default_value = { "foo", "bar" };
values.Add(PropertyName.field_NodePathArray, global::Godot.Variant.From<global::Godot.NodePath[]>(__field_NodePathArray_default_value));
global::Godot.Rid[] __field_RidArray_default_value = { default, default, default };
values.Add(PropertyName.field_RidArray, global::Godot.Variant.From<global::Godot.Rid[]>(__field_RidArray_default_value));
int[] __field_empty_Int32Array_default_value = global::System.Array.Empty<int>();
values.Add(PropertyName.field_empty_Int32Array, global::Godot.Variant.From<int[]>(__field_empty_Int32Array_default_value));
int[] __field_array_from_list_default_value = new global::System.Collections.Generic.List<int>(global::System.Array.Empty<int>()).ToArray();
values.Add(PropertyName.field_array_from_list, global::Godot.Variant.From<int[]>(__field_array_from_list_default_value));
global::Godot.Variant __field_Variant_default_value = "foo";
values.Add(PropertyName.field_Variant, global::Godot.Variant.From<global::Godot.Variant>(__field_Variant_default_value));
global::Godot.GodotObject __field_GodotObjectOrDerived_default_value = default;
values.Add(PropertyName.field_GodotObjectOrDerived, global::Godot.Variant.From<global::Godot.GodotObject>(__field_GodotObjectOrDerived_default_value));
global::Godot.Texture __field_GodotResourceTexture_default_value = default;
values.Add(PropertyName.field_GodotResourceTexture, global::Godot.Variant.From<global::Godot.Texture>(__field_GodotResourceTexture_default_value));
global::Godot.StringName __field_StringName_default_value = new global::Godot.StringName("foo");
values.Add(PropertyName.field_StringName, global::Godot.Variant.From<global::Godot.StringName>(__field_StringName_default_value));
global::Godot.NodePath __field_NodePath_default_value = new global::Godot.NodePath("foo");
values.Add(PropertyName.field_NodePath, global::Godot.Variant.From<global::Godot.NodePath>(__field_NodePath_default_value));
global::Godot.Rid __field_Rid_default_value = default;
values.Add(PropertyName.field_Rid, global::Godot.Variant.From<global::Godot.Rid>(__field_Rid_default_value));
global::Godot.Collections.Dictionary __field_GodotDictionary_default_value = new() { { "foo", 10 }, { global::Godot.Vector2.Up, global::Godot.Colors.Chocolate } };
values.Add(PropertyName.field_GodotDictionary, global::Godot.Variant.From<global::Godot.Collections.Dictionary>(__field_GodotDictionary_default_value));
global::Godot.Collections.Array __field_GodotArray_default_value = new() { "foo", 10, global::Godot.Vector2.Up, global::Godot.Colors.Chocolate };
values.Add(PropertyName.field_GodotArray, global::Godot.Variant.From<global::Godot.Collections.Array>(__field_GodotArray_default_value));
global::Godot.Collections.Dictionary<string, bool> __field_GodotGenericDictionary_default_value = new() { { "foo", true }, { "bar", false } };
values.Add(PropertyName.field_GodotGenericDictionary, global::Godot.Variant.CreateFrom(__field_GodotGenericDictionary_default_value));
global::Godot.Collections.Array<int> __field_GodotGenericArray_default_value = new() { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.field_GodotGenericArray, global::Godot.Variant.CreateFrom(__field_GodotGenericArray_default_value));
long[] __field_empty_Int64Array_default_value = global::System.Array.Empty<long>();
values.Add(PropertyName.field_empty_Int64Array, global::Godot.Variant.From<long[]>(__field_empty_Int64Array_default_value));
bool ___fieldBoolean_default_value = true;
values.Add(PropertyName._fieldBoolean, global::Godot.Variant.From<bool>(___fieldBoolean_default_value));
char ___fieldChar_default_value = 'f';
values.Add(PropertyName._fieldChar, global::Godot.Variant.From<char>(___fieldChar_default_value));
sbyte ___fieldSByte_default_value = 10;
values.Add(PropertyName._fieldSByte, global::Godot.Variant.From<sbyte>(___fieldSByte_default_value));
short ___fieldInt16_default_value = 10;
values.Add(PropertyName._fieldInt16, global::Godot.Variant.From<short>(___fieldInt16_default_value));
int ___fieldInt32_default_value = 10;
values.Add(PropertyName._fieldInt32, global::Godot.Variant.From<int>(___fieldInt32_default_value));
long ___fieldInt64_default_value = 10;
values.Add(PropertyName._fieldInt64, global::Godot.Variant.From<long>(___fieldInt64_default_value));
byte ___fieldByte_default_value = 10;
values.Add(PropertyName._fieldByte, global::Godot.Variant.From<byte>(___fieldByte_default_value));
ushort ___fieldUInt16_default_value = 10;
values.Add(PropertyName._fieldUInt16, global::Godot.Variant.From<ushort>(___fieldUInt16_default_value));
uint ___fieldUInt32_default_value = 10;
values.Add(PropertyName._fieldUInt32, global::Godot.Variant.From<uint>(___fieldUInt32_default_value));
ulong ___fieldUInt64_default_value = 10;
values.Add(PropertyName._fieldUInt64, global::Godot.Variant.From<ulong>(___fieldUInt64_default_value));
float ___fieldSingle_default_value = 10;
values.Add(PropertyName._fieldSingle, global::Godot.Variant.From<float>(___fieldSingle_default_value));
double ___fieldDouble_default_value = 10;
values.Add(PropertyName._fieldDouble, global::Godot.Variant.From<double>(___fieldDouble_default_value));
string ___fieldString_default_value = "foo";
values.Add(PropertyName._fieldString, global::Godot.Variant.From<string>(___fieldString_default_value));
global::Godot.Vector2 ___fieldVector2_default_value = new(10f, 10f);
values.Add(PropertyName._fieldVector2, global::Godot.Variant.From<global::Godot.Vector2>(___fieldVector2_default_value));
global::Godot.Vector2I ___fieldVector2I_default_value = global::Godot.Vector2I.Up;
values.Add(PropertyName._fieldVector2I, global::Godot.Variant.From<global::Godot.Vector2I>(___fieldVector2I_default_value));
global::Godot.Rect2 ___fieldRect2_default_value = new(new global::Godot.Vector2(10f, 10f), new global::Godot.Vector2(10f, 10f));
values.Add(PropertyName._fieldRect2, global::Godot.Variant.From<global::Godot.Rect2>(___fieldRect2_default_value));
global::Godot.Rect2I ___fieldRect2I_default_value = new(new global::Godot.Vector2I(10, 10), new global::Godot.Vector2I(10, 10));
values.Add(PropertyName._fieldRect2I, global::Godot.Variant.From<global::Godot.Rect2I>(___fieldRect2I_default_value));
global::Godot.Transform2D ___fieldTransform2D_default_value = global::Godot.Transform2D.Identity;
values.Add(PropertyName._fieldTransform2D, global::Godot.Variant.From<global::Godot.Transform2D>(___fieldTransform2D_default_value));
global::Godot.Vector3 ___fieldVector3_default_value = new(10f, 10f, 10f);
values.Add(PropertyName._fieldVector3, global::Godot.Variant.From<global::Godot.Vector3>(___fieldVector3_default_value));
global::Godot.Vector3I ___fieldVector3I_default_value = global::Godot.Vector3I.Back;
values.Add(PropertyName._fieldVector3I, global::Godot.Variant.From<global::Godot.Vector3I>(___fieldVector3I_default_value));
global::Godot.Basis ___fieldBasis_default_value = new global::Godot.Basis(global::Godot.Quaternion.Identity);
values.Add(PropertyName._fieldBasis, global::Godot.Variant.From<global::Godot.Basis>(___fieldBasis_default_value));
global::Godot.Quaternion ___fieldQuaternion_default_value = new global::Godot.Quaternion(global::Godot.Basis.Identity);
values.Add(PropertyName._fieldQuaternion, global::Godot.Variant.From<global::Godot.Quaternion>(___fieldQuaternion_default_value));
global::Godot.Transform3D ___fieldTransform3D_default_value = global::Godot.Transform3D.Identity;
values.Add(PropertyName._fieldTransform3D, global::Godot.Variant.From<global::Godot.Transform3D>(___fieldTransform3D_default_value));
global::Godot.Vector4 ___fieldVector4_default_value = new(10f, 10f, 10f, 10f);
values.Add(PropertyName._fieldVector4, global::Godot.Variant.From<global::Godot.Vector4>(___fieldVector4_default_value));
global::Godot.Vector4I ___fieldVector4I_default_value = global::Godot.Vector4I.One;
values.Add(PropertyName._fieldVector4I, global::Godot.Variant.From<global::Godot.Vector4I>(___fieldVector4I_default_value));
global::Godot.Projection ___fieldProjection_default_value = global::Godot.Projection.Identity;
values.Add(PropertyName._fieldProjection, global::Godot.Variant.From<global::Godot.Projection>(___fieldProjection_default_value));
global::Godot.Aabb ___fieldAabb_default_value = new global::Godot.Aabb(10f, 10f, 10f, new global::Godot.Vector3(1f, 1f, 1f));
values.Add(PropertyName._fieldAabb, global::Godot.Variant.From<global::Godot.Aabb>(___fieldAabb_default_value));
global::Godot.Color ___fieldColor_default_value = global::Godot.Colors.Aquamarine;
values.Add(PropertyName._fieldColor, global::Godot.Variant.From<global::Godot.Color>(___fieldColor_default_value));
global::Godot.Plane ___fieldPlane_default_value = global::Godot.Plane.PlaneXZ;
values.Add(PropertyName._fieldPlane, global::Godot.Variant.From<global::Godot.Plane>(___fieldPlane_default_value));
global::Godot.Callable ___fieldCallable_default_value = new global::Godot.Callable(global::Godot.Engine.GetMainLoop(), "_process");
values.Add(PropertyName._fieldCallable, global::Godot.Variant.From<global::Godot.Callable>(___fieldCallable_default_value));
global::Godot.Signal ___fieldSignal_default_value = new global::Godot.Signal(global::Godot.Engine.GetMainLoop(), "property_list_changed");
values.Add(PropertyName._fieldSignal, global::Godot.Variant.From<global::Godot.Signal>(___fieldSignal_default_value));
global::ExportedFields.MyEnum ___fieldEnum_default_value = global::ExportedFields.MyEnum.C;
values.Add(PropertyName._fieldEnum, global::Godot.Variant.From<global::ExportedFields.MyEnum>(___fieldEnum_default_value));
global::ExportedFields.MyFlagsEnum ___fieldFlagsEnum_default_value = global::ExportedFields.MyFlagsEnum.C;
values.Add(PropertyName._fieldFlagsEnum, global::Godot.Variant.From<global::ExportedFields.MyFlagsEnum>(___fieldFlagsEnum_default_value));
byte[] ___fieldByteArray_default_value = { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName._fieldByteArray, global::Godot.Variant.From<byte[]>(___fieldByteArray_default_value));
int[] ___fieldInt32Array_default_value = { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName._fieldInt32Array, global::Godot.Variant.From<int[]>(___fieldInt32Array_default_value));
long[] ___fieldInt64Array_default_value = { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName._fieldInt64Array, global::Godot.Variant.From<long[]>(___fieldInt64Array_default_value));
float[] ___fieldSingleArray_default_value = { 0f, 1f, 2f, 3f, 4f, 5f, 6f };
values.Add(PropertyName._fieldSingleArray, global::Godot.Variant.From<float[]>(___fieldSingleArray_default_value));
double[] ___fieldDoubleArray_default_value = { 0d, 1d, 2d, 3d, 4d, 5d, 6d };
values.Add(PropertyName._fieldDoubleArray, global::Godot.Variant.From<double[]>(___fieldDoubleArray_default_value));
string[] ___fieldStringArray_default_value = { "foo", "bar" };
values.Add(PropertyName._fieldStringArray, global::Godot.Variant.From<string[]>(___fieldStringArray_default_value));
string[] ___fieldStringArrayEnum_default_value = { "foo", "bar" };
values.Add(PropertyName._fieldStringArrayEnum, global::Godot.Variant.From<string[]>(___fieldStringArrayEnum_default_value));
global::Godot.Vector2[] ___fieldVector2Array_default_value = { global::Godot.Vector2.Up, global::Godot.Vector2.Down, global::Godot.Vector2.Left, global::Godot.Vector2.Right };
values.Add(PropertyName._fieldVector2Array, global::Godot.Variant.From<global::Godot.Vector2[]>(___fieldVector2Array_default_value));
global::Godot.Vector3[] ___fieldVector3Array_default_value = { global::Godot.Vector3.Up, global::Godot.Vector3.Down, global::Godot.Vector3.Left, global::Godot.Vector3.Right };
values.Add(PropertyName._fieldVector3Array, global::Godot.Variant.From<global::Godot.Vector3[]>(___fieldVector3Array_default_value));
global::Godot.Color[] ___fieldColorArray_default_value = { global::Godot.Colors.Aqua, global::Godot.Colors.Aquamarine, global::Godot.Colors.Azure, global::Godot.Colors.Beige };
values.Add(PropertyName._fieldColorArray, global::Godot.Variant.From<global::Godot.Color[]>(___fieldColorArray_default_value));
global::Godot.GodotObject[] ___fieldGodotObjectOrDerivedArray_default_value = { null };
values.Add(PropertyName._fieldGodotObjectOrDerivedArray, global::Godot.Variant.CreateFrom(___fieldGodotObjectOrDerivedArray_default_value));
global::Godot.StringName[] ___fieldStringNameArray_default_value = { "foo", "bar" };
values.Add(PropertyName._fieldStringNameArray, global::Godot.Variant.From<global::Godot.StringName[]>(___fieldStringNameArray_default_value));
global::Godot.NodePath[] ___fieldNodePathArray_default_value = { "foo", "bar" };
values.Add(PropertyName._fieldNodePathArray, global::Godot.Variant.From<global::Godot.NodePath[]>(___fieldNodePathArray_default_value));
global::Godot.Rid[] ___fieldRidArray_default_value = { default, default, default };
values.Add(PropertyName._fieldRidArray, global::Godot.Variant.From<global::Godot.Rid[]>(___fieldRidArray_default_value));
int[] ___fieldEmptyInt32Array_default_value = global::System.Array.Empty<int>();
values.Add(PropertyName._fieldEmptyInt32Array, global::Godot.Variant.From<int[]>(___fieldEmptyInt32Array_default_value));
int[] ___fieldArrayFromList_default_value = new global::System.Collections.Generic.List<int>(global::System.Array.Empty<int>()).ToArray();
values.Add(PropertyName._fieldArrayFromList, global::Godot.Variant.From<int[]>(___fieldArrayFromList_default_value));
global::Godot.Variant ___fieldVariant_default_value = "foo";
values.Add(PropertyName._fieldVariant, global::Godot.Variant.From<global::Godot.Variant>(___fieldVariant_default_value));
global::Godot.GodotObject ___fieldGodotObjectOrDerived_default_value = default;
values.Add(PropertyName._fieldGodotObjectOrDerived, global::Godot.Variant.From<global::Godot.GodotObject>(___fieldGodotObjectOrDerived_default_value));
global::Godot.Texture ___fieldGodotResourceTexture_default_value = default;
values.Add(PropertyName._fieldGodotResourceTexture, global::Godot.Variant.From<global::Godot.Texture>(___fieldGodotResourceTexture_default_value));
global::Godot.StringName ___fieldStringName_default_value = new global::Godot.StringName("foo");
values.Add(PropertyName._fieldStringName, global::Godot.Variant.From<global::Godot.StringName>(___fieldStringName_default_value));
global::Godot.NodePath ___fieldNodePath_default_value = new global::Godot.NodePath("foo");
values.Add(PropertyName._fieldNodePath, global::Godot.Variant.From<global::Godot.NodePath>(___fieldNodePath_default_value));
global::Godot.Rid ___fieldRid_default_value = default;
values.Add(PropertyName._fieldRid, global::Godot.Variant.From<global::Godot.Rid>(___fieldRid_default_value));
global::Godot.Collections.Dictionary ___fieldGodotDictionary_default_value = new() { { "foo", 10 }, { global::Godot.Vector2.Up, global::Godot.Colors.Chocolate } };
values.Add(PropertyName._fieldGodotDictionary, global::Godot.Variant.From<global::Godot.Collections.Dictionary>(___fieldGodotDictionary_default_value));
global::Godot.Collections.Array ___fieldGodotArray_default_value = new() { "foo", 10, global::Godot.Vector2.Up, global::Godot.Colors.Chocolate };
values.Add(PropertyName._fieldGodotArray, global::Godot.Variant.From<global::Godot.Collections.Array>(___fieldGodotArray_default_value));
global::Godot.Collections.Dictionary<string, bool> ___fieldGodotGenericDictionary_default_value = new() { { "foo", true }, { "bar", false } };
values.Add(PropertyName._fieldGodotGenericDictionary, global::Godot.Variant.CreateFrom(___fieldGodotGenericDictionary_default_value));
global::Godot.Collections.Array<int> ___fieldGodotGenericArray_default_value = new() { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName._fieldGodotGenericArray, global::Godot.Variant.CreateFrom(___fieldGodotGenericArray_default_value));
long[] ___fieldEmptyInt64Array_default_value = global::System.Array.Empty<long>();
values.Add(PropertyName._fieldEmptyInt64Array, global::Godot.Variant.From<long[]>(___fieldEmptyInt64Array_default_value));
return values;
}
#endif // TOOLS

View File

@ -12,134 +12,134 @@ partial class ExportedProperties
internal new static global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant> GetGodotPropertyDefaultValues()
{
var values = new global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant>(64);
string __NotGenerate_Complex_Lamda_Property_default_value = default;
values.Add(PropertyName.NotGenerate_Complex_Lamda_Property, global::Godot.Variant.From<string>(__NotGenerate_Complex_Lamda_Property_default_value));
string __NotGenerate_Lamda_NoField_Property_default_value = default;
values.Add(PropertyName.NotGenerate_Lamda_NoField_Property, global::Godot.Variant.From<string>(__NotGenerate_Lamda_NoField_Property_default_value));
string __NotGenerate_Complex_Return_Property_default_value = default;
values.Add(PropertyName.NotGenerate_Complex_Return_Property, global::Godot.Variant.From<string>(__NotGenerate_Complex_Return_Property_default_value));
string __NotGenerate_Returns_Property_default_value = default;
values.Add(PropertyName.NotGenerate_Returns_Property, global::Godot.Variant.From<string>(__NotGenerate_Returns_Property_default_value));
string __FullProperty_String_default_value = "FullProperty_String";
values.Add(PropertyName.FullProperty_String, global::Godot.Variant.From<string>(__FullProperty_String_default_value));
string __FullProperty_String_Complex_default_value = new string("FullProperty_String_Complex") + global::System.Convert.ToInt32("1");
values.Add(PropertyName.FullProperty_String_Complex, global::Godot.Variant.From<string>(__FullProperty_String_Complex_default_value));
string __LamdaProperty_String_default_value = "LamdaProperty_String";
values.Add(PropertyName.LamdaProperty_String, global::Godot.Variant.From<string>(__LamdaProperty_String_default_value));
bool __property_Boolean_default_value = true;
values.Add(PropertyName.property_Boolean, global::Godot.Variant.From<bool>(__property_Boolean_default_value));
char __property_Char_default_value = 'f';
values.Add(PropertyName.property_Char, global::Godot.Variant.From<char>(__property_Char_default_value));
sbyte __property_SByte_default_value = 10;
values.Add(PropertyName.property_SByte, global::Godot.Variant.From<sbyte>(__property_SByte_default_value));
short __property_Int16_default_value = 10;
values.Add(PropertyName.property_Int16, global::Godot.Variant.From<short>(__property_Int16_default_value));
int __property_Int32_default_value = 10;
values.Add(PropertyName.property_Int32, global::Godot.Variant.From<int>(__property_Int32_default_value));
long __property_Int64_default_value = 10;
values.Add(PropertyName.property_Int64, global::Godot.Variant.From<long>(__property_Int64_default_value));
byte __property_Byte_default_value = 10;
values.Add(PropertyName.property_Byte, global::Godot.Variant.From<byte>(__property_Byte_default_value));
ushort __property_UInt16_default_value = 10;
values.Add(PropertyName.property_UInt16, global::Godot.Variant.From<ushort>(__property_UInt16_default_value));
uint __property_UInt32_default_value = 10;
values.Add(PropertyName.property_UInt32, global::Godot.Variant.From<uint>(__property_UInt32_default_value));
ulong __property_UInt64_default_value = 10;
values.Add(PropertyName.property_UInt64, global::Godot.Variant.From<ulong>(__property_UInt64_default_value));
float __property_Single_default_value = 10;
values.Add(PropertyName.property_Single, global::Godot.Variant.From<float>(__property_Single_default_value));
double __property_Double_default_value = 10;
values.Add(PropertyName.property_Double, global::Godot.Variant.From<double>(__property_Double_default_value));
string __property_String_default_value = "foo";
values.Add(PropertyName.property_String, global::Godot.Variant.From<string>(__property_String_default_value));
global::Godot.Vector2 __property_Vector2_default_value = new(10f, 10f);
values.Add(PropertyName.property_Vector2, global::Godot.Variant.From<global::Godot.Vector2>(__property_Vector2_default_value));
global::Godot.Vector2I __property_Vector2I_default_value = global::Godot.Vector2I.Up;
values.Add(PropertyName.property_Vector2I, global::Godot.Variant.From<global::Godot.Vector2I>(__property_Vector2I_default_value));
global::Godot.Rect2 __property_Rect2_default_value = new(new global::Godot.Vector2(10f, 10f), new global::Godot.Vector2(10f, 10f));
values.Add(PropertyName.property_Rect2, global::Godot.Variant.From<global::Godot.Rect2>(__property_Rect2_default_value));
global::Godot.Rect2I __property_Rect2I_default_value = new(new global::Godot.Vector2I(10, 10), new global::Godot.Vector2I(10, 10));
values.Add(PropertyName.property_Rect2I, global::Godot.Variant.From<global::Godot.Rect2I>(__property_Rect2I_default_value));
global::Godot.Transform2D __property_Transform2D_default_value = global::Godot.Transform2D.Identity;
values.Add(PropertyName.property_Transform2D, global::Godot.Variant.From<global::Godot.Transform2D>(__property_Transform2D_default_value));
global::Godot.Vector3 __property_Vector3_default_value = new(10f, 10f, 10f);
values.Add(PropertyName.property_Vector3, global::Godot.Variant.From<global::Godot.Vector3>(__property_Vector3_default_value));
global::Godot.Vector3I __property_Vector3I_default_value = global::Godot.Vector3I.Back;
values.Add(PropertyName.property_Vector3I, global::Godot.Variant.From<global::Godot.Vector3I>(__property_Vector3I_default_value));
global::Godot.Basis __property_Basis_default_value = new global::Godot.Basis(global::Godot.Quaternion.Identity);
values.Add(PropertyName.property_Basis, global::Godot.Variant.From<global::Godot.Basis>(__property_Basis_default_value));
global::Godot.Quaternion __property_Quaternion_default_value = new global::Godot.Quaternion(global::Godot.Basis.Identity);
values.Add(PropertyName.property_Quaternion, global::Godot.Variant.From<global::Godot.Quaternion>(__property_Quaternion_default_value));
global::Godot.Transform3D __property_Transform3D_default_value = global::Godot.Transform3D.Identity;
values.Add(PropertyName.property_Transform3D, global::Godot.Variant.From<global::Godot.Transform3D>(__property_Transform3D_default_value));
global::Godot.Vector4 __property_Vector4_default_value = new(10f, 10f, 10f, 10f);
values.Add(PropertyName.property_Vector4, global::Godot.Variant.From<global::Godot.Vector4>(__property_Vector4_default_value));
global::Godot.Vector4I __property_Vector4I_default_value = global::Godot.Vector4I.One;
values.Add(PropertyName.property_Vector4I, global::Godot.Variant.From<global::Godot.Vector4I>(__property_Vector4I_default_value));
global::Godot.Projection __property_Projection_default_value = global::Godot.Projection.Identity;
values.Add(PropertyName.property_Projection, global::Godot.Variant.From<global::Godot.Projection>(__property_Projection_default_value));
global::Godot.Aabb __property_Aabb_default_value = new global::Godot.Aabb(10f, 10f, 10f, new global::Godot.Vector3(1f, 1f, 1f));
values.Add(PropertyName.property_Aabb, global::Godot.Variant.From<global::Godot.Aabb>(__property_Aabb_default_value));
global::Godot.Color __property_Color_default_value = global::Godot.Colors.Aquamarine;
values.Add(PropertyName.property_Color, global::Godot.Variant.From<global::Godot.Color>(__property_Color_default_value));
global::Godot.Plane __property_Plane_default_value = global::Godot.Plane.PlaneXZ;
values.Add(PropertyName.property_Plane, global::Godot.Variant.From<global::Godot.Plane>(__property_Plane_default_value));
global::Godot.Callable __property_Callable_default_value = new global::Godot.Callable(global::Godot.Engine.GetMainLoop(), "_process");
values.Add(PropertyName.property_Callable, global::Godot.Variant.From<global::Godot.Callable>(__property_Callable_default_value));
global::Godot.Signal __property_Signal_default_value = new global::Godot.Signal(global::Godot.Engine.GetMainLoop(), "property_list_changed");
values.Add(PropertyName.property_Signal, global::Godot.Variant.From<global::Godot.Signal>(__property_Signal_default_value));
global::ExportedProperties.MyEnum __property_Enum_default_value = global::ExportedProperties.MyEnum.C;
values.Add(PropertyName.property_Enum, global::Godot.Variant.From<global::ExportedProperties.MyEnum>(__property_Enum_default_value));
global::ExportedProperties.MyFlagsEnum __property_FlagsEnum_default_value = global::ExportedProperties.MyFlagsEnum.C;
values.Add(PropertyName.property_FlagsEnum, global::Godot.Variant.From<global::ExportedProperties.MyFlagsEnum>(__property_FlagsEnum_default_value));
byte[] __property_ByteArray_default_value = { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.property_ByteArray, global::Godot.Variant.From<byte[]>(__property_ByteArray_default_value));
int[] __property_Int32Array_default_value = { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.property_Int32Array, global::Godot.Variant.From<int[]>(__property_Int32Array_default_value));
long[] __property_Int64Array_default_value = { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.property_Int64Array, global::Godot.Variant.From<long[]>(__property_Int64Array_default_value));
float[] __property_SingleArray_default_value = { 0f, 1f, 2f, 3f, 4f, 5f, 6f };
values.Add(PropertyName.property_SingleArray, global::Godot.Variant.From<float[]>(__property_SingleArray_default_value));
double[] __property_DoubleArray_default_value = { 0d, 1d, 2d, 3d, 4d, 5d, 6d };
values.Add(PropertyName.property_DoubleArray, global::Godot.Variant.From<double[]>(__property_DoubleArray_default_value));
string[] __property_StringArray_default_value = { "foo", "bar" };
values.Add(PropertyName.property_StringArray, global::Godot.Variant.From<string[]>(__property_StringArray_default_value));
string[] __property_StringArrayEnum_default_value = { "foo", "bar" };
values.Add(PropertyName.property_StringArrayEnum, global::Godot.Variant.From<string[]>(__property_StringArrayEnum_default_value));
global::Godot.Vector2[] __property_Vector2Array_default_value = { global::Godot.Vector2.Up, global::Godot.Vector2.Down, global::Godot.Vector2.Left, global::Godot.Vector2.Right };
values.Add(PropertyName.property_Vector2Array, global::Godot.Variant.From<global::Godot.Vector2[]>(__property_Vector2Array_default_value));
global::Godot.Vector3[] __property_Vector3Array_default_value = { global::Godot.Vector3.Up, global::Godot.Vector3.Down, global::Godot.Vector3.Left, global::Godot.Vector3.Right };
values.Add(PropertyName.property_Vector3Array, global::Godot.Variant.From<global::Godot.Vector3[]>(__property_Vector3Array_default_value));
global::Godot.Color[] __property_ColorArray_default_value = { global::Godot.Colors.Aqua, global::Godot.Colors.Aquamarine, global::Godot.Colors.Azure, global::Godot.Colors.Beige };
values.Add(PropertyName.property_ColorArray, global::Godot.Variant.From<global::Godot.Color[]>(__property_ColorArray_default_value));
global::Godot.GodotObject[] __property_GodotObjectOrDerivedArray_default_value = { null };
values.Add(PropertyName.property_GodotObjectOrDerivedArray, global::Godot.Variant.CreateFrom(__property_GodotObjectOrDerivedArray_default_value));
string __NotGenerateComplexLamdaProperty_default_value = default;
values.Add(PropertyName.NotGenerateComplexLamdaProperty, global::Godot.Variant.From<string>(__NotGenerateComplexLamdaProperty_default_value));
string __NotGenerateLamdaNoFieldProperty_default_value = default;
values.Add(PropertyName.NotGenerateLamdaNoFieldProperty, global::Godot.Variant.From<string>(__NotGenerateLamdaNoFieldProperty_default_value));
string __NotGenerateComplexReturnProperty_default_value = default;
values.Add(PropertyName.NotGenerateComplexReturnProperty, global::Godot.Variant.From<string>(__NotGenerateComplexReturnProperty_default_value));
string __NotGenerateReturnsProperty_default_value = default;
values.Add(PropertyName.NotGenerateReturnsProperty, global::Godot.Variant.From<string>(__NotGenerateReturnsProperty_default_value));
string __FullPropertyString_default_value = "FullPropertyString";
values.Add(PropertyName.FullPropertyString, global::Godot.Variant.From<string>(__FullPropertyString_default_value));
string __FullPropertyString_Complex_default_value = new string("FullPropertyString_Complex") + global::System.Convert.ToInt32("1");
values.Add(PropertyName.FullPropertyString_Complex, global::Godot.Variant.From<string>(__FullPropertyString_Complex_default_value));
string __LamdaPropertyString_default_value = "LamdaPropertyString";
values.Add(PropertyName.LamdaPropertyString, global::Godot.Variant.From<string>(__LamdaPropertyString_default_value));
bool __PropertyBoolean_default_value = true;
values.Add(PropertyName.PropertyBoolean, global::Godot.Variant.From<bool>(__PropertyBoolean_default_value));
char __PropertyChar_default_value = 'f';
values.Add(PropertyName.PropertyChar, global::Godot.Variant.From<char>(__PropertyChar_default_value));
sbyte __PropertySByte_default_value = 10;
values.Add(PropertyName.PropertySByte, global::Godot.Variant.From<sbyte>(__PropertySByte_default_value));
short __PropertyInt16_default_value = 10;
values.Add(PropertyName.PropertyInt16, global::Godot.Variant.From<short>(__PropertyInt16_default_value));
int __PropertyInt32_default_value = 10;
values.Add(PropertyName.PropertyInt32, global::Godot.Variant.From<int>(__PropertyInt32_default_value));
long __PropertyInt64_default_value = 10;
values.Add(PropertyName.PropertyInt64, global::Godot.Variant.From<long>(__PropertyInt64_default_value));
byte __PropertyByte_default_value = 10;
values.Add(PropertyName.PropertyByte, global::Godot.Variant.From<byte>(__PropertyByte_default_value));
ushort __PropertyUInt16_default_value = 10;
values.Add(PropertyName.PropertyUInt16, global::Godot.Variant.From<ushort>(__PropertyUInt16_default_value));
uint __PropertyUInt32_default_value = 10;
values.Add(PropertyName.PropertyUInt32, global::Godot.Variant.From<uint>(__PropertyUInt32_default_value));
ulong __PropertyUInt64_default_value = 10;
values.Add(PropertyName.PropertyUInt64, global::Godot.Variant.From<ulong>(__PropertyUInt64_default_value));
float __PropertySingle_default_value = 10;
values.Add(PropertyName.PropertySingle, global::Godot.Variant.From<float>(__PropertySingle_default_value));
double __PropertyDouble_default_value = 10;
values.Add(PropertyName.PropertyDouble, global::Godot.Variant.From<double>(__PropertyDouble_default_value));
string __PropertyString_default_value = "foo";
values.Add(PropertyName.PropertyString, global::Godot.Variant.From<string>(__PropertyString_default_value));
global::Godot.Vector2 __PropertyVector2_default_value = new(10f, 10f);
values.Add(PropertyName.PropertyVector2, global::Godot.Variant.From<global::Godot.Vector2>(__PropertyVector2_default_value));
global::Godot.Vector2I __PropertyVector2I_default_value = global::Godot.Vector2I.Up;
values.Add(PropertyName.PropertyVector2I, global::Godot.Variant.From<global::Godot.Vector2I>(__PropertyVector2I_default_value));
global::Godot.Rect2 __PropertyRect2_default_value = new(new global::Godot.Vector2(10f, 10f), new global::Godot.Vector2(10f, 10f));
values.Add(PropertyName.PropertyRect2, global::Godot.Variant.From<global::Godot.Rect2>(__PropertyRect2_default_value));
global::Godot.Rect2I __PropertyRect2I_default_value = new(new global::Godot.Vector2I(10, 10), new global::Godot.Vector2I(10, 10));
values.Add(PropertyName.PropertyRect2I, global::Godot.Variant.From<global::Godot.Rect2I>(__PropertyRect2I_default_value));
global::Godot.Transform2D __PropertyTransform2D_default_value = global::Godot.Transform2D.Identity;
values.Add(PropertyName.PropertyTransform2D, global::Godot.Variant.From<global::Godot.Transform2D>(__PropertyTransform2D_default_value));
global::Godot.Vector3 __PropertyVector3_default_value = new(10f, 10f, 10f);
values.Add(PropertyName.PropertyVector3, global::Godot.Variant.From<global::Godot.Vector3>(__PropertyVector3_default_value));
global::Godot.Vector3I __PropertyVector3I_default_value = global::Godot.Vector3I.Back;
values.Add(PropertyName.PropertyVector3I, global::Godot.Variant.From<global::Godot.Vector3I>(__PropertyVector3I_default_value));
global::Godot.Basis __PropertyBasis_default_value = new global::Godot.Basis(global::Godot.Quaternion.Identity);
values.Add(PropertyName.PropertyBasis, global::Godot.Variant.From<global::Godot.Basis>(__PropertyBasis_default_value));
global::Godot.Quaternion __PropertyQuaternion_default_value = new global::Godot.Quaternion(global::Godot.Basis.Identity);
values.Add(PropertyName.PropertyQuaternion, global::Godot.Variant.From<global::Godot.Quaternion>(__PropertyQuaternion_default_value));
global::Godot.Transform3D __PropertyTransform3D_default_value = global::Godot.Transform3D.Identity;
values.Add(PropertyName.PropertyTransform3D, global::Godot.Variant.From<global::Godot.Transform3D>(__PropertyTransform3D_default_value));
global::Godot.Vector4 __PropertyVector4_default_value = new(10f, 10f, 10f, 10f);
values.Add(PropertyName.PropertyVector4, global::Godot.Variant.From<global::Godot.Vector4>(__PropertyVector4_default_value));
global::Godot.Vector4I __PropertyVector4I_default_value = global::Godot.Vector4I.One;
values.Add(PropertyName.PropertyVector4I, global::Godot.Variant.From<global::Godot.Vector4I>(__PropertyVector4I_default_value));
global::Godot.Projection __PropertyProjection_default_value = global::Godot.Projection.Identity;
values.Add(PropertyName.PropertyProjection, global::Godot.Variant.From<global::Godot.Projection>(__PropertyProjection_default_value));
global::Godot.Aabb __PropertyAabb_default_value = new global::Godot.Aabb(10f, 10f, 10f, new global::Godot.Vector3(1f, 1f, 1f));
values.Add(PropertyName.PropertyAabb, global::Godot.Variant.From<global::Godot.Aabb>(__PropertyAabb_default_value));
global::Godot.Color __PropertyColor_default_value = global::Godot.Colors.Aquamarine;
values.Add(PropertyName.PropertyColor, global::Godot.Variant.From<global::Godot.Color>(__PropertyColor_default_value));
global::Godot.Plane __PropertyPlane_default_value = global::Godot.Plane.PlaneXZ;
values.Add(PropertyName.PropertyPlane, global::Godot.Variant.From<global::Godot.Plane>(__PropertyPlane_default_value));
global::Godot.Callable __PropertyCallable_default_value = new global::Godot.Callable(global::Godot.Engine.GetMainLoop(), "_process");
values.Add(PropertyName.PropertyCallable, global::Godot.Variant.From<global::Godot.Callable>(__PropertyCallable_default_value));
global::Godot.Signal __PropertySignal_default_value = new global::Godot.Signal(global::Godot.Engine.GetMainLoop(), "Propertylist_changed");
values.Add(PropertyName.PropertySignal, global::Godot.Variant.From<global::Godot.Signal>(__PropertySignal_default_value));
global::ExportedProperties.MyEnum __PropertyEnum_default_value = global::ExportedProperties.MyEnum.C;
values.Add(PropertyName.PropertyEnum, global::Godot.Variant.From<global::ExportedProperties.MyEnum>(__PropertyEnum_default_value));
global::ExportedProperties.MyFlagsEnum __PropertyFlagsEnum_default_value = global::ExportedProperties.MyFlagsEnum.C;
values.Add(PropertyName.PropertyFlagsEnum, global::Godot.Variant.From<global::ExportedProperties.MyFlagsEnum>(__PropertyFlagsEnum_default_value));
byte[] __PropertyByteArray_default_value = { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.PropertyByteArray, global::Godot.Variant.From<byte[]>(__PropertyByteArray_default_value));
int[] __PropertyInt32Array_default_value = { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.PropertyInt32Array, global::Godot.Variant.From<int[]>(__PropertyInt32Array_default_value));
long[] __PropertyInt64Array_default_value = { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.PropertyInt64Array, global::Godot.Variant.From<long[]>(__PropertyInt64Array_default_value));
float[] __PropertySingleArray_default_value = { 0f, 1f, 2f, 3f, 4f, 5f, 6f };
values.Add(PropertyName.PropertySingleArray, global::Godot.Variant.From<float[]>(__PropertySingleArray_default_value));
double[] __PropertyDoubleArray_default_value = { 0d, 1d, 2d, 3d, 4d, 5d, 6d };
values.Add(PropertyName.PropertyDoubleArray, global::Godot.Variant.From<double[]>(__PropertyDoubleArray_default_value));
string[] __PropertyStringArray_default_value = { "foo", "bar" };
values.Add(PropertyName.PropertyStringArray, global::Godot.Variant.From<string[]>(__PropertyStringArray_default_value));
string[] __PropertyStringArrayEnum_default_value = { "foo", "bar" };
values.Add(PropertyName.PropertyStringArrayEnum, global::Godot.Variant.From<string[]>(__PropertyStringArrayEnum_default_value));
global::Godot.Vector2[] __PropertyVector2Array_default_value = { global::Godot.Vector2.Up, global::Godot.Vector2.Down, global::Godot.Vector2.Left, global::Godot.Vector2.Right };
values.Add(PropertyName.PropertyVector2Array, global::Godot.Variant.From<global::Godot.Vector2[]>(__PropertyVector2Array_default_value));
global::Godot.Vector3[] __PropertyVector3Array_default_value = { global::Godot.Vector3.Up, global::Godot.Vector3.Down, global::Godot.Vector3.Left, global::Godot.Vector3.Right };
values.Add(PropertyName.PropertyVector3Array, global::Godot.Variant.From<global::Godot.Vector3[]>(__PropertyVector3Array_default_value));
global::Godot.Color[] __PropertyColorArray_default_value = { global::Godot.Colors.Aqua, global::Godot.Colors.Aquamarine, global::Godot.Colors.Azure, global::Godot.Colors.Beige };
values.Add(PropertyName.PropertyColorArray, global::Godot.Variant.From<global::Godot.Color[]>(__PropertyColorArray_default_value));
global::Godot.GodotObject[] __PropertyGodotObjectOrDerivedArray_default_value = { null };
values.Add(PropertyName.PropertyGodotObjectOrDerivedArray, global::Godot.Variant.CreateFrom(__PropertyGodotObjectOrDerivedArray_default_value));
global::Godot.StringName[] __field_StringNameArray_default_value = { "foo", "bar" };
values.Add(PropertyName.field_StringNameArray, global::Godot.Variant.From<global::Godot.StringName[]>(__field_StringNameArray_default_value));
global::Godot.NodePath[] __field_NodePathArray_default_value = { "foo", "bar" };
values.Add(PropertyName.field_NodePathArray, global::Godot.Variant.From<global::Godot.NodePath[]>(__field_NodePathArray_default_value));
global::Godot.Rid[] __field_RidArray_default_value = { default, default, default };
values.Add(PropertyName.field_RidArray, global::Godot.Variant.From<global::Godot.Rid[]>(__field_RidArray_default_value));
global::Godot.Variant __property_Variant_default_value = "foo";
values.Add(PropertyName.property_Variant, global::Godot.Variant.From<global::Godot.Variant>(__property_Variant_default_value));
global::Godot.GodotObject __property_GodotObjectOrDerived_default_value = default;
values.Add(PropertyName.property_GodotObjectOrDerived, global::Godot.Variant.From<global::Godot.GodotObject>(__property_GodotObjectOrDerived_default_value));
global::Godot.Texture __property_GodotResourceTexture_default_value = default;
values.Add(PropertyName.property_GodotResourceTexture, global::Godot.Variant.From<global::Godot.Texture>(__property_GodotResourceTexture_default_value));
global::Godot.StringName __property_StringName_default_value = new global::Godot.StringName("foo");
values.Add(PropertyName.property_StringName, global::Godot.Variant.From<global::Godot.StringName>(__property_StringName_default_value));
global::Godot.NodePath __property_NodePath_default_value = new global::Godot.NodePath("foo");
values.Add(PropertyName.property_NodePath, global::Godot.Variant.From<global::Godot.NodePath>(__property_NodePath_default_value));
global::Godot.Rid __property_Rid_default_value = default;
values.Add(PropertyName.property_Rid, global::Godot.Variant.From<global::Godot.Rid>(__property_Rid_default_value));
global::Godot.Collections.Dictionary __property_GodotDictionary_default_value = new() { { "foo", 10 }, { global::Godot.Vector2.Up, global::Godot.Colors.Chocolate } };
values.Add(PropertyName.property_GodotDictionary, global::Godot.Variant.From<global::Godot.Collections.Dictionary>(__property_GodotDictionary_default_value));
global::Godot.Collections.Array __property_GodotArray_default_value = new() { "foo", 10, global::Godot.Vector2.Up, global::Godot.Colors.Chocolate };
values.Add(PropertyName.property_GodotArray, global::Godot.Variant.From<global::Godot.Collections.Array>(__property_GodotArray_default_value));
global::Godot.Collections.Dictionary<string, bool> __property_GodotGenericDictionary_default_value = new() { { "foo", true }, { "bar", false } };
values.Add(PropertyName.property_GodotGenericDictionary, global::Godot.Variant.CreateFrom(__property_GodotGenericDictionary_default_value));
global::Godot.Collections.Array<int> __property_GodotGenericArray_default_value = new() { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.property_GodotGenericArray, global::Godot.Variant.CreateFrom(__property_GodotGenericArray_default_value));
global::Godot.Variant __PropertyVariant_default_value = "foo";
values.Add(PropertyName.PropertyVariant, global::Godot.Variant.From<global::Godot.Variant>(__PropertyVariant_default_value));
global::Godot.GodotObject __PropertyGodotObjectOrDerived_default_value = default;
values.Add(PropertyName.PropertyGodotObjectOrDerived, global::Godot.Variant.From<global::Godot.GodotObject>(__PropertyGodotObjectOrDerived_default_value));
global::Godot.Texture __PropertyGodotResourceTexture_default_value = default;
values.Add(PropertyName.PropertyGodotResourceTexture, global::Godot.Variant.From<global::Godot.Texture>(__PropertyGodotResourceTexture_default_value));
global::Godot.StringName __PropertyStringName_default_value = new global::Godot.StringName("foo");
values.Add(PropertyName.PropertyStringName, global::Godot.Variant.From<global::Godot.StringName>(__PropertyStringName_default_value));
global::Godot.NodePath __PropertyNodePath_default_value = new global::Godot.NodePath("foo");
values.Add(PropertyName.PropertyNodePath, global::Godot.Variant.From<global::Godot.NodePath>(__PropertyNodePath_default_value));
global::Godot.Rid __PropertyRid_default_value = default;
values.Add(PropertyName.PropertyRid, global::Godot.Variant.From<global::Godot.Rid>(__PropertyRid_default_value));
global::Godot.Collections.Dictionary __PropertyGodotDictionary_default_value = new() { { "foo", 10 }, { global::Godot.Vector2.Up, global::Godot.Colors.Chocolate } };
values.Add(PropertyName.PropertyGodotDictionary, global::Godot.Variant.From<global::Godot.Collections.Dictionary>(__PropertyGodotDictionary_default_value));
global::Godot.Collections.Array __PropertyGodotArray_default_value = new() { "foo", 10, global::Godot.Vector2.Up, global::Godot.Colors.Chocolate };
values.Add(PropertyName.PropertyGodotArray, global::Godot.Variant.From<global::Godot.Collections.Array>(__PropertyGodotArray_default_value));
global::Godot.Collections.Dictionary<string, bool> __PropertyGodotGenericDictionary_default_value = new() { { "foo", true }, { "bar", false } };
values.Add(PropertyName.PropertyGodotGenericDictionary, global::Godot.Variant.CreateFrom(__PropertyGodotGenericDictionary_default_value));
global::Godot.Collections.Array<int> __PropertyGodotGenericArray_default_value = new() { 0, 1, 2, 3, 4, 5, 6 };
values.Add(PropertyName.PropertyGodotGenericArray, global::Godot.Variant.CreateFrom(__PropertyGodotGenericArray_default_value));
return values;
}
#endif // TOOLS

View File

@ -9,40 +9,40 @@ partial class MixedReadOnlyWriteOnly
/// </summary>
public new class PropertyName : global::Godot.GodotObject.PropertyName {
/// <summary>
/// Cached name for the 'readonly_auto_property' property.
/// Cached name for the 'ReadOnlyAutoProperty' property.
/// </summary>
public new static readonly global::Godot.StringName readonly_auto_property = "readonly_auto_property";
public new static readonly global::Godot.StringName ReadOnlyAutoProperty = "ReadOnlyAutoProperty";
/// <summary>
/// Cached name for the 'readonly_property' property.
/// Cached name for the 'ReadOnlyProperty' property.
/// </summary>
public new static readonly global::Godot.StringName readonly_property = "readonly_property";
public new static readonly global::Godot.StringName ReadOnlyProperty = "ReadOnlyProperty";
/// <summary>
/// Cached name for the 'initonly_auto_property' property.
/// Cached name for the 'InitOnlyAutoProperty' property.
/// </summary>
public new static readonly global::Godot.StringName initonly_auto_property = "initonly_auto_property";
public new static readonly global::Godot.StringName InitOnlyAutoProperty = "InitOnlyAutoProperty";
/// <summary>
/// Cached name for the 'writeonly_property' property.
/// Cached name for the 'WriteOnlyProperty' property.
/// </summary>
public new static readonly global::Godot.StringName writeonly_property = "writeonly_property";
public new static readonly global::Godot.StringName WriteOnlyProperty = "WriteOnlyProperty";
/// <summary>
/// Cached name for the 'readonly_field' field.
/// Cached name for the 'ReadOnlyField' field.
/// </summary>
public new static readonly global::Godot.StringName readonly_field = "readonly_field";
public new static readonly global::Godot.StringName ReadOnlyField = "ReadOnlyField";
/// <summary>
/// Cached name for the 'writeonly_backing_field' field.
/// Cached name for the '_writeOnlyBackingField' field.
/// </summary>
public new static readonly global::Godot.StringName writeonly_backing_field = "writeonly_backing_field";
public new static readonly global::Godot.StringName _writeOnlyBackingField = "_writeOnlyBackingField";
}
/// <inheritdoc/>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool SetGodotClassPropertyValue(in godot_string_name name, in godot_variant value)
{
if (name == PropertyName.writeonly_property) {
this.writeonly_property = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
if (name == PropertyName.WriteOnlyProperty) {
this.WriteOnlyProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
return true;
}
else if (name == PropertyName.writeonly_backing_field) {
this.writeonly_backing_field = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
else if (name == PropertyName._writeOnlyBackingField) {
this._writeOnlyBackingField = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value);
return true;
}
return base.SetGodotClassPropertyValue(name, value);
@ -51,24 +51,24 @@ partial class MixedReadOnlyWriteOnly
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
protected override bool GetGodotClassPropertyValue(in godot_string_name name, out godot_variant value)
{
if (name == PropertyName.readonly_auto_property) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.readonly_auto_property);
if (name == PropertyName.ReadOnlyAutoProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.ReadOnlyAutoProperty);
return true;
}
else if (name == PropertyName.readonly_property) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.readonly_property);
else if (name == PropertyName.ReadOnlyProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.ReadOnlyProperty);
return true;
}
else if (name == PropertyName.initonly_auto_property) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.initonly_auto_property);
else if (name == PropertyName.InitOnlyAutoProperty) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.InitOnlyAutoProperty);
return true;
}
else if (name == PropertyName.readonly_field) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.readonly_field);
else if (name == PropertyName.ReadOnlyField) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.ReadOnlyField);
return true;
}
else if (name == PropertyName.writeonly_backing_field) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<bool>(this.writeonly_backing_field);
else if (name == PropertyName._writeOnlyBackingField) {
value = global::Godot.NativeInterop.VariantUtils.CreateFrom<bool>(this._writeOnlyBackingField);
return true;
}
return base.GetGodotClassPropertyValue(name, out value);
@ -82,12 +82,12 @@ partial class MixedReadOnlyWriteOnly
internal new static global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo> GetGodotPropertyList()
{
var properties = new global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo>();
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.readonly_field, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.readonly_auto_property, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.readonly_property, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.initonly_auto_property, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)1, name: PropertyName.writeonly_backing_field, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)1, name: PropertyName.writeonly_property, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.ReadOnlyField, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.ReadOnlyAutoProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.ReadOnlyProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)4, name: PropertyName.InitOnlyAutoProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)1, name: PropertyName._writeOnlyBackingField, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
properties.Add(new(type: (global::Godot.Variant.Type)1, name: PropertyName.WriteOnlyProperty, hint: (global::Godot.PropertyHint)0, hintString: "", usage: (global::Godot.PropertyUsageFlags)4096, exported: false));
return properties;
}
#pragma warning restore CS0109

View File

@ -2,8 +2,8 @@ using Godot;
public partial class AllReadOnly : GodotObject
{
public readonly string readonly_field = "foo";
public string readonly_auto_property { get; } = "foo";
public string readonly_property { get => "foo"; }
public string initonly_auto_property { get; init; }
public readonly string ReadOnlyField = "foo";
public string ReadOnlyAutoProperty { get; } = "foo";
public string ReadOnlyProperty { get => "foo"; }
public string InitOnlyAutoProperty { get; init; }
}

View File

@ -2,6 +2,6 @@ using Godot;
public partial class AllWriteOnly : GodotObject
{
bool writeonly_backing_field = false;
public bool writeonly_property { set => writeonly_backing_field = value; }
private bool _writeOnlyBackingField = false;
public bool WriteOnlyProperty { set => _writeOnlyBackingField = value; }
}

View File

@ -1,14 +1,14 @@
using Godot;
partial class Bar : GodotObject
public partial class Bar : GodotObject
{
}
// Foo in another file
partial class Foo
public partial class Foo
{
}
partial class NotSameNameAsFile : GodotObject
public partial class NotSameNameAsFile : GodotObject
{
}

View File

@ -4,99 +4,99 @@ using System.Collections.Generic;
public partial class ExportedFields : GodotObject
{
[Export] private Boolean field_Boolean = true;
[Export] private Char field_Char = 'f';
[Export] private SByte field_SByte = 10;
[Export] private Int16 field_Int16 = 10;
[Export] private Int32 field_Int32 = 10;
[Export] private Int64 field_Int64 = 10;
[Export] private Byte field_Byte = 10;
[Export] private UInt16 field_UInt16 = 10;
[Export] private UInt32 field_UInt32 = 10;
[Export] private UInt64 field_UInt64 = 10;
[Export] private Single field_Single = 10;
[Export] private Double field_Double = 10;
[Export] private String field_String = "foo";
[Export] private Boolean _fieldBoolean = true;
[Export] private Char _fieldChar = 'f';
[Export] private SByte _fieldSByte = 10;
[Export] private Int16 _fieldInt16 = 10;
[Export] private Int32 _fieldInt32 = 10;
[Export] private Int64 _fieldInt64 = 10;
[Export] private Byte _fieldByte = 10;
[Export] private UInt16 _fieldUInt16 = 10;
[Export] private UInt32 _fieldUInt32 = 10;
[Export] private UInt64 _fieldUInt64 = 10;
[Export] private Single _fieldSingle = 10;
[Export] private Double _fieldDouble = 10;
[Export] private String _fieldString = "foo";
// Godot structs
[Export] private Vector2 field_Vector2 = new(10f, 10f);
[Export] private Vector2I field_Vector2I = Vector2I.Up;
[Export] private Rect2 field_Rect2 = new(new Vector2(10f, 10f), new Vector2(10f, 10f));
[Export] private Rect2I field_Rect2I = new(new Vector2I(10, 10), new Vector2I(10, 10));
[Export] private Transform2D field_Transform2D = Transform2D.Identity;
[Export] private Vector3 field_Vector3 = new(10f, 10f, 10f);
[Export] private Vector3I field_Vector3I = Vector3I.Back;
[Export] private Basis field_Basis = new Basis(Quaternion.Identity);
[Export] private Quaternion field_Quaternion = new Quaternion(Basis.Identity);
[Export] private Transform3D field_Transform3D = Transform3D.Identity;
[Export] private Vector4 field_Vector4 = new(10f, 10f, 10f, 10f);
[Export] private Vector4I field_Vector4I = Vector4I.One;
[Export] private Projection field_Projection = Projection.Identity;
[Export] private Aabb field_Aabb = new Aabb(10f, 10f, 10f, new Vector3(1f, 1f, 1f));
[Export] private Color field_Color = Colors.Aquamarine;
[Export] private Plane field_Plane = Plane.PlaneXZ;
[Export] private Callable field_Callable = new Callable(Engine.GetMainLoop(), "_process");
[Export] private Signal field_Signal = new Signal(Engine.GetMainLoop(), "property_list_changed");
[Export] private Vector2 _fieldVector2 = new(10f, 10f);
[Export] private Vector2I _fieldVector2I = Vector2I.Up;
[Export] private Rect2 _fieldRect2 = new(new Vector2(10f, 10f), new Vector2(10f, 10f));
[Export] private Rect2I _fieldRect2I = new(new Vector2I(10, 10), new Vector2I(10, 10));
[Export] private Transform2D _fieldTransform2D = Transform2D.Identity;
[Export] private Vector3 _fieldVector3 = new(10f, 10f, 10f);
[Export] private Vector3I _fieldVector3I = Vector3I.Back;
[Export] private Basis _fieldBasis = new Basis(Quaternion.Identity);
[Export] private Quaternion _fieldQuaternion = new Quaternion(Basis.Identity);
[Export] private Transform3D _fieldTransform3D = Transform3D.Identity;
[Export] private Vector4 _fieldVector4 = new(10f, 10f, 10f, 10f);
[Export] private Vector4I _fieldVector4I = Vector4I.One;
[Export] private Projection _fieldProjection = Projection.Identity;
[Export] private Aabb _fieldAabb = new Aabb(10f, 10f, 10f, new Vector3(1f, 1f, 1f));
[Export] private Color _fieldColor = Colors.Aquamarine;
[Export] private Plane _fieldPlane = Plane.PlaneXZ;
[Export] private Callable _fieldCallable = new Callable(Engine.GetMainLoop(), "_process");
[Export] private Signal _fieldSignal = new Signal(Engine.GetMainLoop(), "property_list_changed");
// Enums
enum MyEnum
public enum MyEnum
{
A,
B,
C
}
[Export] private MyEnum field_Enum = MyEnum.C;
[Export] private MyEnum _fieldEnum = MyEnum.C;
[Flags]
enum MyFlagsEnum
public enum MyFlagsEnum
{
A,
B,
C
}
[Export] private MyFlagsEnum field_FlagsEnum = MyFlagsEnum.C;
[Export] private MyFlagsEnum _fieldFlagsEnum = MyFlagsEnum.C;
// Arrays
[Export] private Byte[] field_ByteArray = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int32[] field_Int32Array = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int64[] field_Int64Array = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Single[] field_SingleArray = { 0f, 1f, 2f, 3f, 4f, 5f, 6f };
[Export] private Double[] field_DoubleArray = { 0d, 1d, 2d, 3d, 4d, 5d, 6d };
[Export] private String[] field_StringArray = { "foo", "bar" };
[Export(PropertyHint.Enum, "A,B,C")] private String[] field_StringArrayEnum = { "foo", "bar" };
[Export] private Vector2[] field_Vector2Array = { Vector2.Up, Vector2.Down, Vector2.Left, Vector2.Right };
[Export] private Vector3[] field_Vector3Array = { Vector3.Up, Vector3.Down, Vector3.Left, Vector3.Right };
[Export] private Color[] field_ColorArray = { Colors.Aqua, Colors.Aquamarine, Colors.Azure, Colors.Beige };
[Export] private GodotObject[] field_GodotObjectOrDerivedArray = { null };
[Export] private StringName[] field_StringNameArray = { "foo", "bar" };
[Export] private NodePath[] field_NodePathArray = { "foo", "bar" };
[Export] private Rid[] field_RidArray = { default, default, default };
[Export] private Byte[] _fieldByteArray = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int32[] _fieldInt32Array = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int64[] _fieldInt64Array = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Single[] _fieldSingleArray = { 0f, 1f, 2f, 3f, 4f, 5f, 6f };
[Export] private Double[] _fieldDoubleArray = { 0d, 1d, 2d, 3d, 4d, 5d, 6d };
[Export] private String[] _fieldStringArray = { "foo", "bar" };
[Export(PropertyHint.Enum, "A,B,C")] private String[] _fieldStringArrayEnum = { "foo", "bar" };
[Export] private Vector2[] _fieldVector2Array = { Vector2.Up, Vector2.Down, Vector2.Left, Vector2.Right };
[Export] private Vector3[] _fieldVector3Array = { Vector3.Up, Vector3.Down, Vector3.Left, Vector3.Right };
[Export] private Color[] _fieldColorArray = { Colors.Aqua, Colors.Aquamarine, Colors.Azure, Colors.Beige };
[Export] private GodotObject[] _fieldGodotObjectOrDerivedArray = { null };
[Export] private StringName[] _fieldStringNameArray = { "foo", "bar" };
[Export] private NodePath[] _fieldNodePathArray = { "foo", "bar" };
[Export] private Rid[] _fieldRidArray = { default, default, default };
// Note we use Array and not System.Array. This tests the generated namespace qualification.
[Export] private Int32[] field_empty_Int32Array = Array.Empty<Int32>();
[Export] private Int32[] _fieldEmptyInt32Array = Array.Empty<Int32>();
// Note we use List and not System.Collections.Generic.
[Export] private int[] field_array_from_list = new List<int>(Array.Empty<int>()).ToArray();
[Export] private int[] _fieldArrayFromList = new List<int>(Array.Empty<int>()).ToArray();
// Variant
[Export] private Variant field_Variant = "foo";
[Export] private Variant _fieldVariant = "foo";
// Classes
[Export] private GodotObject field_GodotObjectOrDerived;
[Export] private Godot.Texture field_GodotResourceTexture;
[Export] private StringName field_StringName = new StringName("foo");
[Export] private NodePath field_NodePath = new NodePath("foo");
[Export] private Rid field_Rid;
[Export] private GodotObject _fieldGodotObjectOrDerived;
[Export] private Godot.Texture _fieldGodotResourceTexture;
[Export] private StringName _fieldStringName = new StringName("foo");
[Export] private NodePath _fieldNodePath = new NodePath("foo");
[Export] private Rid _fieldRid;
[Export]
private Godot.Collections.Dictionary field_GodotDictionary = new() { { "foo", 10 }, { Vector2.Up, Colors.Chocolate } };
private Godot.Collections.Dictionary _fieldGodotDictionary = new() { { "foo", 10 }, { Vector2.Up, Colors.Chocolate } };
[Export]
private Godot.Collections.Array field_GodotArray = new() { "foo", 10, Vector2.Up, Colors.Chocolate };
private Godot.Collections.Array _fieldGodotArray = new() { "foo", 10, Vector2.Up, Colors.Chocolate };
[Export]
private Godot.Collections.Dictionary<string, bool> field_GodotGenericDictionary = new() { { "foo", true }, { "bar", false } };
private Godot.Collections.Dictionary<string, bool> _fieldGodotGenericDictionary = new() { { "foo", true }, { "bar", false } };
[Export]
private Godot.Collections.Array<int> field_GodotGenericArray = new() { 0, 1, 2, 3, 4, 5, 6 };
private Godot.Collections.Array<int> _fieldGodotGenericArray = new() { 0, 1, 2, 3, 4, 5, 6 };
}

View File

@ -4,41 +4,41 @@ using System;
public partial class ExportedProperties : GodotObject
{
// Do not generate default value
private String _notGenerate_Property_String = new string("not generate");
private String _notGeneratePropertyString = new string("not generate");
[Export]
public String NotGenerate_Complex_Lamda_Property
public String NotGenerateComplexLamdaProperty
{
get => _notGenerate_Property_String + Convert.ToInt32("1");
set => _notGenerate_Property_String = value;
get => _notGeneratePropertyString + Convert.ToInt32("1");
set => _notGeneratePropertyString = value;
}
[Export]
public String NotGenerate_Lamda_NoField_Property
public String NotGenerateLamdaNoFieldProperty
{
get => new string("not generate");
set => _notGenerate_Property_String = value;
set => _notGeneratePropertyString = value;
}
[Export]
public String NotGenerate_Complex_Return_Property
public String NotGenerateComplexReturnProperty
{
get
{
return _notGenerate_Property_String + Convert.ToInt32("1");
return _notGeneratePropertyString + Convert.ToInt32("1");
}
set
{
_notGenerate_Property_String = value;
_notGeneratePropertyString = value;
}
}
private int _notGenerate_Property_Int = 1;
private int _notGeneratePropertyInt = 1;
[Export]
public string NotGenerate_Returns_Property
public string NotGenerateReturnsProperty
{
get
{
if (_notGenerate_Property_Int == 1)
if (_notGeneratePropertyInt == 1)
{
return "a";
}
@ -49,138 +49,138 @@ public partial class ExportedProperties : GodotObject
}
set
{
_notGenerate_Property_Int = value == "a" ? 1 : 2;
_notGeneratePropertyInt = value == "a" ? 1 : 2;
}
}
// Full Property
private String _fullProperty_String = "FullProperty_String";
private String _fullPropertyString = "FullPropertyString";
[Export]
public String FullProperty_String
public String FullPropertyString
{
get
{
return _fullProperty_String;
return _fullPropertyString;
}
set
{
_fullProperty_String = value;
_fullPropertyString = value;
}
}
private String _fullProperty_String_Complex = new string("FullProperty_String_Complex") + Convert.ToInt32("1");
private String _fullPropertyStringComplex = new string("FullPropertyString_Complex") + Convert.ToInt32("1");
[Export]
public String FullProperty_String_Complex
public String FullPropertyString_Complex
{
get
{
return _fullProperty_String_Complex;
return _fullPropertyStringComplex;
}
set
{
_fullProperty_String_Complex = value;
_fullPropertyStringComplex = value;
}
}
// Lambda Property
private String _lamdaProperty_String = "LamdaProperty_String";
private String _lamdaPropertyString = "LamdaPropertyString";
[Export]
public String LamdaProperty_String
public String LamdaPropertyString
{
get => _lamdaProperty_String;
set => _lamdaProperty_String = value;
get => _lamdaPropertyString;
set => _lamdaPropertyString = value;
}
// Auto Property
[Export] private Boolean property_Boolean { get; set; } = true;
[Export] private Char property_Char { get; set; } = 'f';
[Export] private SByte property_SByte { get; set; } = 10;
[Export] private Int16 property_Int16 { get; set; } = 10;
[Export] private Int32 property_Int32 { get; set; } = 10;
[Export] private Int64 property_Int64 { get; set; } = 10;
[Export] private Byte property_Byte { get; set; } = 10;
[Export] private UInt16 property_UInt16 { get; set; } = 10;
[Export] private UInt32 property_UInt32 { get; set; } = 10;
[Export] private UInt64 property_UInt64 { get; set; } = 10;
[Export] private Single property_Single { get; set; } = 10;
[Export] private Double property_Double { get; set; } = 10;
[Export] private String property_String { get; set; } = "foo";
[Export] private Boolean PropertyBoolean { get; set; } = true;
[Export] private Char PropertyChar { get; set; } = 'f';
[Export] private SByte PropertySByte { get; set; } = 10;
[Export] private Int16 PropertyInt16 { get; set; } = 10;
[Export] private Int32 PropertyInt32 { get; set; } = 10;
[Export] private Int64 PropertyInt64 { get; set; } = 10;
[Export] private Byte PropertyByte { get; set; } = 10;
[Export] private UInt16 PropertyUInt16 { get; set; } = 10;
[Export] private UInt32 PropertyUInt32 { get; set; } = 10;
[Export] private UInt64 PropertyUInt64 { get; set; } = 10;
[Export] private Single PropertySingle { get; set; } = 10;
[Export] private Double PropertyDouble { get; set; } = 10;
[Export] private String PropertyString { get; set; } = "foo";
// Godot structs
[Export] private Vector2 property_Vector2 { get; set; } = new(10f, 10f);
[Export] private Vector2I property_Vector2I { get; set; } = Vector2I.Up;
[Export] private Rect2 property_Rect2 { get; set; } = new(new Vector2(10f, 10f), new Vector2(10f, 10f));
[Export] private Rect2I property_Rect2I { get; set; } = new(new Vector2I(10, 10), new Vector2I(10, 10));
[Export] private Transform2D property_Transform2D { get; set; } = Transform2D.Identity;
[Export] private Vector3 property_Vector3 { get; set; } = new(10f, 10f, 10f);
[Export] private Vector3I property_Vector3I { get; set; } = Vector3I.Back;
[Export] private Basis property_Basis { get; set; } = new Basis(Quaternion.Identity);
[Export] private Quaternion property_Quaternion { get; set; } = new Quaternion(Basis.Identity);
[Export] private Transform3D property_Transform3D { get; set; } = Transform3D.Identity;
[Export] private Vector4 property_Vector4 { get; set; } = new(10f, 10f, 10f, 10f);
[Export] private Vector4I property_Vector4I { get; set; } = Vector4I.One;
[Export] private Projection property_Projection { get; set; } = Projection.Identity;
[Export] private Aabb property_Aabb { get; set; } = new Aabb(10f, 10f, 10f, new Vector3(1f, 1f, 1f));
[Export] private Color property_Color { get; set; } = Colors.Aquamarine;
[Export] private Plane property_Plane { get; set; } = Plane.PlaneXZ;
[Export] private Callable property_Callable { get; set; } = new Callable(Engine.GetMainLoop(), "_process");
[Export] private Signal property_Signal { get; set; } = new Signal(Engine.GetMainLoop(), "property_list_changed");
[Export] private Vector2 PropertyVector2 { get; set; } = new(10f, 10f);
[Export] private Vector2I PropertyVector2I { get; set; } = Vector2I.Up;
[Export] private Rect2 PropertyRect2 { get; set; } = new(new Vector2(10f, 10f), new Vector2(10f, 10f));
[Export] private Rect2I PropertyRect2I { get; set; } = new(new Vector2I(10, 10), new Vector2I(10, 10));
[Export] private Transform2D PropertyTransform2D { get; set; } = Transform2D.Identity;
[Export] private Vector3 PropertyVector3 { get; set; } = new(10f, 10f, 10f);
[Export] private Vector3I PropertyVector3I { get; set; } = Vector3I.Back;
[Export] private Basis PropertyBasis { get; set; } = new Basis(Quaternion.Identity);
[Export] private Quaternion PropertyQuaternion { get; set; } = new Quaternion(Basis.Identity);
[Export] private Transform3D PropertyTransform3D { get; set; } = Transform3D.Identity;
[Export] private Vector4 PropertyVector4 { get; set; } = new(10f, 10f, 10f, 10f);
[Export] private Vector4I PropertyVector4I { get; set; } = Vector4I.One;
[Export] private Projection PropertyProjection { get; set; } = Projection.Identity;
[Export] private Aabb PropertyAabb { get; set; } = new Aabb(10f, 10f, 10f, new Vector3(1f, 1f, 1f));
[Export] private Color PropertyColor { get; set; } = Colors.Aquamarine;
[Export] private Plane PropertyPlane { get; set; } = Plane.PlaneXZ;
[Export] private Callable PropertyCallable { get; set; } = new Callable(Engine.GetMainLoop(), "_process");
[Export] private Signal PropertySignal { get; set; } = new Signal(Engine.GetMainLoop(), "Propertylist_changed");
// Enums
enum MyEnum
public enum MyEnum
{
A,
B,
C
}
[Export] private MyEnum property_Enum { get; set; } = MyEnum.C;
[Export] private MyEnum PropertyEnum { get; set; } = MyEnum.C;
[Flags]
enum MyFlagsEnum
public enum MyFlagsEnum
{
A,
B,
C
}
[Export] private MyFlagsEnum property_FlagsEnum { get; set; } = MyFlagsEnum.C;
[Export] private MyFlagsEnum PropertyFlagsEnum { get; set; } = MyFlagsEnum.C;
// Arrays
[Export] private Byte[] property_ByteArray { get; set; } = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int32[] property_Int32Array { get; set; } = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int64[] property_Int64Array { get; set; } = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Single[] property_SingleArray { get; set; } = { 0f, 1f, 2f, 3f, 4f, 5f, 6f };
[Export] private Double[] property_DoubleArray { get; set; } = { 0d, 1d, 2d, 3d, 4d, 5d, 6d };
[Export] private String[] property_StringArray { get; set; } = { "foo", "bar" };
[Export(PropertyHint.Enum, "A,B,C")] private String[] property_StringArrayEnum { get; set; } = { "foo", "bar" };
[Export] private Vector2[] property_Vector2Array { get; set; } = { Vector2.Up, Vector2.Down, Vector2.Left, Vector2.Right };
[Export] private Vector3[] property_Vector3Array { get; set; } = { Vector3.Up, Vector3.Down, Vector3.Left, Vector3.Right };
[Export] private Color[] property_ColorArray { get; set; } = { Colors.Aqua, Colors.Aquamarine, Colors.Azure, Colors.Beige };
[Export] private GodotObject[] property_GodotObjectOrDerivedArray { get; set; } = { null };
[Export] private Byte[] PropertyByteArray { get; set; } = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int32[] PropertyInt32Array { get; set; } = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Int64[] PropertyInt64Array { get; set; } = { 0, 1, 2, 3, 4, 5, 6 };
[Export] private Single[] PropertySingleArray { get; set; } = { 0f, 1f, 2f, 3f, 4f, 5f, 6f };
[Export] private Double[] PropertyDoubleArray { get; set; } = { 0d, 1d, 2d, 3d, 4d, 5d, 6d };
[Export] private String[] PropertyStringArray { get; set; } = { "foo", "bar" };
[Export(PropertyHint.Enum, "A,B,C")] private String[] PropertyStringArrayEnum { get; set; } = { "foo", "bar" };
[Export] private Vector2[] PropertyVector2Array { get; set; } = { Vector2.Up, Vector2.Down, Vector2.Left, Vector2.Right };
[Export] private Vector3[] PropertyVector3Array { get; set; } = { Vector3.Up, Vector3.Down, Vector3.Left, Vector3.Right };
[Export] private Color[] PropertyColorArray { get; set; } = { Colors.Aqua, Colors.Aquamarine, Colors.Azure, Colors.Beige };
[Export] private GodotObject[] PropertyGodotObjectOrDerivedArray { get; set; } = { null };
[Export] private StringName[] field_StringNameArray { get; set; } = { "foo", "bar" };
[Export] private NodePath[] field_NodePathArray { get; set; } = { "foo", "bar" };
[Export] private Rid[] field_RidArray { get; set; } = { default, default, default };
// Variant
[Export] private Variant property_Variant { get; set; } = "foo";
[Export] private Variant PropertyVariant { get; set; } = "foo";
// Classes
[Export] private GodotObject property_GodotObjectOrDerived { get; set; }
[Export] private Godot.Texture property_GodotResourceTexture { get; set; }
[Export] private StringName property_StringName { get; set; } = new StringName("foo");
[Export] private NodePath property_NodePath { get; set; } = new NodePath("foo");
[Export] private Rid property_Rid { get; set; }
[Export] private GodotObject PropertyGodotObjectOrDerived { get; set; }
[Export] private Godot.Texture PropertyGodotResourceTexture { get; set; }
[Export] private StringName PropertyStringName { get; set; } = new StringName("foo");
[Export] private NodePath PropertyNodePath { get; set; } = new NodePath("foo");
[Export] private Rid PropertyRid { get; set; }
[Export]
private Godot.Collections.Dictionary property_GodotDictionary { get; set; } = new() { { "foo", 10 }, { Vector2.Up, Colors.Chocolate } };
private Godot.Collections.Dictionary PropertyGodotDictionary { get; set; } = new() { { "foo", 10 }, { Vector2.Up, Colors.Chocolate } };
[Export]
private Godot.Collections.Array property_GodotArray { get; set; } = new() { "foo", 10, Vector2.Up, Colors.Chocolate };
private Godot.Collections.Array PropertyGodotArray { get; set; } = new() { "foo", 10, Vector2.Up, Colors.Chocolate };
[Export]
private Godot.Collections.Dictionary<string, bool> property_GodotGenericDictionary { get; set; } = new() { { "foo", true }, { "bar", false } };
private Godot.Collections.Dictionary<string, bool> PropertyGodotGenericDictionary { get; set; } = new() { { "foo", true }, { "bar", false } };
[Export]
private Godot.Collections.Array<int> property_GodotGenericArray { get; set; } = new() { 0, 1, 2, 3, 4, 5, 6 };
private Godot.Collections.Array<int> PropertyGodotGenericArray { get; set; } = new() { 0, 1, 2, 3, 4, 5, 6 };
}

View File

@ -1,10 +1,10 @@
using Godot;
partial class Foo : GodotObject
public partial class Foo : GodotObject
{
}
// Foo again in the same file
partial class Foo
public partial class Foo
{
}

View File

@ -1,18 +1,18 @@
using Godot;
partial class Generic<T> : GodotObject
public partial class Generic<T> : GodotObject
{
private int _field;
}
// Generic again but different generic parameters
partial class {|GD0003:Generic|}<T, R> : GodotObject
public partial class {|GD0003:Generic|}<T, R> : GodotObject
{
private int _field;
}
// Generic again but without generic parameters
partial class {|GD0003:Generic|} : GodotObject
public partial class {|GD0003:Generic|} : GodotObject
{
private int _field;
}

View File

@ -1,6 +1,6 @@
using Godot;
partial class Generic<T> : GodotObject
public partial class Generic<T> : GodotObject
{
private int _field;
}

View File

@ -2,11 +2,11 @@ using Godot;
public partial class MixedReadOnlyWriteOnly : GodotObject
{
public readonly string readonly_field = "foo";
public string readonly_auto_property { get; } = "foo";
public string readonly_property { get => "foo"; }
public string initonly_auto_property { get; init; }
public readonly string ReadOnlyField = "foo";
public string ReadOnlyAutoProperty { get; } = "foo";
public string ReadOnlyProperty { get => "foo"; }
public string InitOnlyAutoProperty { get; init; }
bool writeonly_backing_field = false;
public bool writeonly_property { set => writeonly_backing_field = value; }
bool _writeOnlyBackingField = false;
public bool WriteOnlyProperty { set => _writeOnlyBackingField = value; }
}

View File

@ -4,5 +4,5 @@ using System;
public partial class ExportedFields : GodotObject
{
// Note we use Array and not System.Array. This tests the generated namespace qualification.
[Export] private Int64[] field_empty_Int64Array = Array.Empty<Int64>();
[Export] private Int64[] _fieldEmptyInt64Array = Array.Empty<Int64>();
}

View File

@ -24,7 +24,7 @@ public partial class ScriptBoilerplate : Node
}
}
partial struct OuterClass
public partial struct OuterClass
{
public partial class NestedClass : RefCounted
{

View File

@ -9,7 +9,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace Godot.SourceGenerators
{
static class ExtensionMethods
internal static class ExtensionMethods
{
public static bool TryGetGlobalAnalyzerProperty(
this GeneratorExecutionContext context, string property, out string? value

View File

@ -1,9 +1,7 @@
using System.Collections.Immutable;
using System.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
namespace Godot.SourceGenerators
@ -23,10 +21,8 @@ namespace Godot.SourceGenerators
context.RegisterSyntaxNodeAction(AnalyzeNode, SyntaxKind.ClassDeclaration);
}
private void AnalyzeNode(SyntaxNodeAnalysisContext context)
private static void AnalyzeNode(SyntaxNodeAnalysisContext context)
{
var typeClassDecl = (ClassDeclarationSyntax)context.Node;
// Return if not a type symbol or the type is not a global class.
if (context.ContainingSymbol is not INamedTypeSymbol typeSymbol ||
!typeSymbol.GetAttributes().Any(a => a.AttributeClass?.IsGodotGlobalClassAttribute() ?? false))

View File

@ -171,7 +171,7 @@ namespace Godot.SourceGenerators
if (godotClassMethods.Length > 0)
{
const string listType = "global::System.Collections.Generic.List<global::Godot.Bridge.MethodInfo>";
const string ListType = "global::System.Collections.Generic.List<global::Godot.Bridge.MethodInfo>";
source.Append(" /// <summary>\n")
.Append(" /// Get the method information for all the methods declared in this class.\n")
@ -182,11 +182,11 @@ namespace Godot.SourceGenerators
source.Append(" [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]\n");
source.Append(" internal new static ")
.Append(listType)
.Append(ListType)
.Append(" GetGodotMethodList()\n {\n");
source.Append(" var methods = new ")
.Append(listType)
.Append(ListType)
.Append("(")
.Append(godotClassMethods.Length)
.Append(");\n");

View File

@ -246,7 +246,7 @@ namespace Godot.SourceGenerators
}
// Generate GetGodotPropertyList
const string dictionaryType = "global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo>";
const string DictionaryType = "global::System.Collections.Generic.List<global::Godot.Bridge.PropertyInfo>";
source.Append(" /// <summary>\n")
.Append(" /// Get the property information for all the properties declared in this class.\n")
@ -257,11 +257,11 @@ namespace Godot.SourceGenerators
source.Append(" [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]\n");
source.Append(" internal new static ")
.Append(dictionaryType)
.Append(DictionaryType)
.Append(" GetGodotPropertyList()\n {\n");
source.Append(" var properties = new ")
.Append(dictionaryType)
.Append(DictionaryType)
.Append("();\n");
// To retain the definition order (and display categories correctly), we want to

View File

@ -351,7 +351,7 @@ namespace Godot.SourceGenerators
{
source.Append("#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword\n");
const string dictionaryType =
const string DictionaryType =
"global::System.Collections.Generic.Dictionary<global::Godot.StringName, global::Godot.Variant>";
source.Append("#if TOOLS\n");
@ -366,11 +366,11 @@ namespace Godot.SourceGenerators
source.Append(" [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]\n");
source.Append(" internal new static ");
source.Append(dictionaryType);
source.Append(DictionaryType);
source.Append(" GetGodotPropertyDefaultValues()\n {\n");
source.Append(" var values = new ");
source.Append(dictionaryType);
source.Append(DictionaryType);
source.Append("(");
source.Append(exportedMembers.Count);
source.Append(");\n");

View File

@ -225,7 +225,7 @@ namespace Godot.SourceGenerators
if (godotSignalDelegates.Count > 0)
{
const string listType = "global::System.Collections.Generic.List<global::Godot.Bridge.MethodInfo>";
const string ListType = "global::System.Collections.Generic.List<global::Godot.Bridge.MethodInfo>";
source.Append(" /// <summary>\n")
.Append(" /// Get the signal information for all the signals declared in this class.\n")
@ -236,11 +236,11 @@ namespace Godot.SourceGenerators
source.Append(" [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]\n");
source.Append(" internal new static ")
.Append(listType)
.Append(ListType)
.Append(" GetGodotSignalList()\n {\n");
source.Append(" var signals = new ")
.Append(listType)
.Append(ListType)
.Append("(")
.Append(godotSignalDelegates.Count)
.Append(");\n");

View File

@ -210,7 +210,7 @@ namespace GodotTools.OpenVisualStudio
return null;
}
static string NormalizePath(string path)
private static string NormalizePath(string path)
{
return new Uri(Path.GetFullPath(path)).LocalPath
.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar)

View File

@ -1,3 +1,6 @@
#pragma warning disable IDE1006 // Naming rule violation
// ReSharper disable InconsistentNaming
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
@ -8,7 +11,6 @@ using GodotTools.IdeMessaging.Requests;
namespace GodotTools.Internals
{
[SuppressMessage("ReSharper", "InconsistentNaming")]
[GenerateUnmanagedCallbacks(typeof(InternalUnmanagedCallbacks))]
internal static partial class Internal
{

View File

@ -1538,7 +1538,7 @@ void BindingsGenerator::_generate_global_constants(StringBuilder &p_output) {
p_output.append("namespace " BINDINGS_NAMESPACE ";\n\n");
p_output.append("public static partial class " BINDINGS_GLOBAL_SCOPE_CLASS "\n{");
p_output.append("public static partial class " BINDINGS_GLOBAL_SCOPE_CLASS "\n" OPEN_BLOCK);
for (const ConstantInterface &iconstant : global_constants) {
if (iconstant.const_doc && iconstant.const_doc->description.size()) {
@ -1589,50 +1589,48 @@ void BindingsGenerator::_generate_global_constants(StringBuilder &p_output) {
_log("Declaring global enum '%s' inside struct '%s'\n", enum_proxy_name.utf8().get_data(), enum_class_name.utf8().get_data());
p_output.append("\npublic partial struct ");
p_output.append(enum_class_name);
p_output.append("\n" OPEN_BLOCK);
p_output << "\npublic partial struct " << enum_class_name << "\n" OPEN_BLOCK;
}
const String maybe_indent = !enum_in_static_class ? "" : INDENT1;
if (ienum.is_flags) {
p_output.append("\n[System.Flags]");
p_output << "\n"
<< maybe_indent << "[System.Flags]";
}
p_output.append("\npublic enum ");
p_output.append(enum_proxy_name);
p_output.append(" : long");
p_output.append("\n" OPEN_BLOCK);
p_output << "\n"
<< maybe_indent << "public enum " << enum_proxy_name << " : long"
<< "\n"
<< maybe_indent << OPEN_BLOCK;
const ConstantInterface &last = ienum.constants.back()->get();
for (const ConstantInterface &iconstant : ienum.constants) {
if (iconstant.const_doc && iconstant.const_doc->description.size()) {
String xml_summary = bbcode_to_xml(fix_doc_description(iconstant.const_doc->description), nullptr);
Vector<String> summary_lines = xml_summary.length() ? xml_summary.split("\n") : Vector<String>();
if (summary_lines.size()) {
p_output.append(INDENT1 "/// <summary>\n");
p_output << maybe_indent << INDENT1 "/// <summary>\n";
for (int i = 0; i < summary_lines.size(); i++) {
p_output.append(INDENT1 "/// ");
p_output.append(summary_lines[i]);
p_output.append("\n");
p_output << maybe_indent << INDENT1 "/// " << summary_lines[i] << "\n";
}
p_output.append(INDENT1 "/// </summary>\n");
p_output << maybe_indent << INDENT1 "/// </summary>\n";
}
}
p_output.append(INDENT1);
p_output.append(iconstant.proxy_name);
p_output.append(" = ");
p_output.append(itos(iconstant.value));
p_output.append(&iconstant != &last ? ",\n" : "\n");
p_output << maybe_indent << INDENT1
<< iconstant.proxy_name
<< " = "
<< itos(iconstant.value)
<< ",\n";
}
p_output.append(CLOSE_BLOCK);
p_output << maybe_indent << CLOSE_BLOCK;
if (enum_in_static_class) {
p_output.append(CLOSE_BLOCK);
p_output << CLOSE_BLOCK;
}
}
}
@ -2162,7 +2160,7 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str
output << MEMBER_BEGIN "public " << itype.proxy_name << "() : this("
<< (itype.memory_own ? "true" : "false") << ")\n" OPEN_BLOCK_L1
<< INDENT2 "unsafe\n" INDENT2 OPEN_BLOCK
<< INDENT3 "_ConstructAndInitialize(" CS_STATIC_FIELD_NATIVE_CTOR ", "
<< INDENT3 "ConstructAndInitialize(" CS_STATIC_FIELD_NATIVE_CTOR ", "
<< BINDINGS_NATIVE_NAME_FIELD ", CachedType, refCounted: "
<< (itype.is_ref_counted ? "true" : "false") << ");\n"
<< CLOSE_BLOCK_L2 CLOSE_BLOCK_L1;
@ -2171,7 +2169,7 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str
output << MEMBER_BEGIN "internal " << itype.proxy_name << "() : this("
<< (itype.memory_own ? "true" : "false") << ")\n" OPEN_BLOCK_L1
<< INDENT2 "unsafe\n" INDENT2 OPEN_BLOCK
<< INDENT3 "_ConstructAndInitialize(null, "
<< INDENT3 "ConstructAndInitialize(null, "
<< BINDINGS_NATIVE_NAME_FIELD ", CachedType, refCounted: "
<< (itype.is_ref_counted ? "true" : "false") << ");\n"
<< CLOSE_BLOCK_L2 CLOSE_BLOCK_L1;
@ -2180,7 +2178,7 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str
// Add.. em.. trick constructor. Sort of.
output.append(MEMBER_BEGIN "internal ");
output.append(itype.proxy_name);
output.append("(bool " CS_PARAM_MEMORYOWN ") : base(" CS_PARAM_MEMORYOWN ") {}\n");
output.append("(bool " CS_PARAM_MEMORYOWN ") : base(" CS_PARAM_MEMORYOWN ") { }\n");
}
}
@ -2241,6 +2239,9 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str
<< INDENT1 "/// <param name=\"args\">Arguments to use with the invoked method.</param>\n"
<< INDENT1 "/// <param name=\"ret\">Value returned by the invoked method.</param>\n";
// Avoid raising diagnostics because of calls to obsolete methods.
output << "#pragma warning disable CS0618 // Member is obsolete\n";
output << INDENT1 "protected internal " << (is_derived_type ? "override" : "virtual")
<< " bool " CS_METHOD_INVOKE_GODOT_CLASS_METHOD "(in godot_string_name method, "
<< "NativeVariantPtrArgs args, out godot_variant ret)\n"
@ -2319,6 +2320,8 @@ Error BindingsGenerator::_generate_cs_type(const TypeInterface &itype, const Str
output << INDENT1 "}\n";
output << "#pragma warning restore CS0618\n";
// Generate HasGodotClassMethod
output << MEMBER_BEGIN "/// <summary>\n"
@ -2969,7 +2972,7 @@ Error BindingsGenerator::_generate_cs_signal(const BindingsGenerator::TypeInterf
ERR_FAIL_NULL_V(arg_type, ERR_BUG); // Argument type not found
if (idx != 0) {
p_output << ",";
p_output << ", ";
}
p_output << sformat(arg_type->cs_variant_to_managed,

View File

@ -1,18 +1,37 @@
# This file should only contain severity override to diagnostics, in order to make generated and
# interop code compilation readable. We want to limit the scope of suppression as much as possible.
[**/Generated/**.cs]
# IDE1006: Naming rule violation
dotnet_diagnostic.IDE1006.severity = none
# CA1062: Validate parameter is non-null before using it
# Useful for generated code, as it disables nullable
dotnet_diagnostic.CA1062.severity = error
# CA1069: Enums should not have duplicate values
dotnet_diagnostic.CA1069.severity = none
# CA1707: Identifiers should not contain underscores
dotnet_diagnostic.CA1707.severity = none
# CA1708: Identifiers should differ by more than case
dotnet_diagnostic.CA1708.severity = none
# CA1711: Identifiers should not have incorrect suffix
# Disable warning for suffixes like EventHandler, Flags, Enum, etc.
dotnet_diagnostic.CA1711.severity = none
# CA1716: Identifiers should not match keywords
# This is suppressed, because it will report `@event` as well as `event`
dotnet_diagnostic.CA1716.severity = none
# CA1720: Identifiers should not contain type names
dotnet_diagnostic.CA1720.severity = none
# CS1591: Missing XML comment for publicly visible type or member
dotnet_diagnostic.CS1591.severity = none
# CS1573: Parameter has no matching param tag in the XML comment
dotnet_diagnostic.CS1573.severity = none
# TODO: Temporary change to not pollute the warnings, but this denotes with ou doc generation
# CS1734: XML comment on '' has a paramref tag for '', but there is no parameter by that name
dotnet_diagnostic.CS1734.severity = none
[GodotSharp/Core/NativeInterop/**.cs]
# CA1720: Identifiers should not contain type names
dotnet_diagnostic.CA1720.severity = none
[GodotSharp/Core/**.cs]
# CS1591: Missing XML comment for publicly visible type or member

View File

@ -387,7 +387,7 @@ using Godot.NativeInterop;
}
private static bool IsGodotInteropStruct(ITypeSymbol type) =>
GodotInteropStructs.Contains(type.FullQualifiedNameOmitGlobal());
_godotInteropStructs.Contains(type.FullQualifiedNameOmitGlobal());
private static bool IsByRefParameter(IParameterSymbol parameter) =>
parameter.RefKind is RefKind.In or RefKind.Out or RefKind.Ref;
@ -448,7 +448,7 @@ using Godot.NativeInterop;
source.Append(";\n");
}
private static readonly string[] GodotInteropStructs =
private static readonly string[] _godotInteropStructs =
{
"Godot.NativeInterop.godot_ref",
"Godot.NativeInterop.godot_variant_call_error",

View File

@ -8,6 +8,8 @@ using System.ComponentModel;
namespace Godot;
#pragma warning disable CS1734 // XML comment on 'X' has a paramref tag for 'Y', but there is no parameter by that name.
// TODO: This is currently disabled because of https://github.com/dotnet/roslyn/issues/52904
#pragma warning disable IDE0040 // Add accessibility modifiers.
partial class AnimationNode
{

View File

@ -151,7 +151,6 @@ namespace Godot.Collections
// from derived types (e.g.: Node[]). Implicit conversion from Derived[] to Base[] are
// fine as long as the array is not mutated. However, Span does this type checking at
// instantiation, so it's not possible to use it even when not mutating anything.
// ReSharper disable once RedundantNameQualifier
/// <summary>
/// Constructs a new <see cref="Array"/> from the given ReadOnlySpan's elements.
/// </summary>

View File

@ -19,7 +19,7 @@ namespace Godot
/// <summary>
/// If the method will also be called locally; otherwise, it is only called remotely.
/// </summary>
public bool CallLocal { get; init; } = false;
public bool CallLocal { get; init; }
/// <summary>
/// Transfer mode for the annotated method.
@ -29,7 +29,7 @@ namespace Godot
/// <summary>
/// Transfer channel for the annotated mode.
/// </summary>
public int TransferChannel { get; init; } = 0;
public int TransferChannel { get; init; }
/// <summary>
/// Constructs a <see cref="RpcAttribute"/> instance.

View File

@ -2,7 +2,7 @@ namespace Godot.Bridge;
public static class AlcReloadCfg
{
private static bool _configured = false;
private static bool _configured;
public static void Configure(bool alcReloadEnabled)
{
@ -14,5 +14,5 @@ public static class AlcReloadCfg
IsAlcReloadingEnabled = alcReloadEnabled;
}
internal static bool IsAlcReloadingEnabled = false;
internal static bool IsAlcReloadingEnabled;
}

View File

@ -30,7 +30,8 @@ namespace Godot.Bridge
foreach (var type in typesInAlc.Keys)
{
if (_scriptTypeBiMap.RemoveByScriptType(type, out IntPtr scriptPtr) &&
(!_pathTypeBiMap.TryGetScriptPath(type, out string? scriptPath) || scriptPath.StartsWith("csharp://")))
(!_pathTypeBiMap.TryGetScriptPath(type, out string? scriptPath) ||
scriptPath.StartsWith("csharp://", StringComparison.Ordinal)))
{
// For scripts without a path, we need to keep the class qualified name for reloading
_scriptDataForReload.TryAdd(scriptPtr,
@ -584,7 +585,7 @@ namespace Godot.Bridge
// (every Resource must have a unique path). So we create a unique "virtual" path
// for each type.
if (!scriptPath.StartsWith("res://"))
if (!scriptPath.StartsWith("res://", StringComparison.Ordinal))
{
throw new ArgumentException("Script path must start with 'res://'.", nameof(scriptPath));
}
@ -597,7 +598,7 @@ namespace Godot.Bridge
{
// This path is slower, but it's only executed for the first instantiation of the type
if (scriptType.IsConstructedGenericType && !scriptPath.StartsWith("csharp://"))
if (scriptType.IsConstructedGenericType && !scriptPath.StartsWith("csharp://", StringComparison.Ordinal))
{
// If the script type is generic it can't be loaded using the real script path.
// Construct a virtual path unique to this constructed generic type and add it
@ -700,7 +701,6 @@ namespace Godot.Bridge
return godot_bool.False;
}
// ReSharper disable once RedundantNameQualifier
if (!typeof(GodotObject).IsAssignableFrom(scriptType))
{
// The class no longer inherits GodotObject, can't reload
@ -1007,8 +1007,9 @@ namespace Godot.Bridge
return (List<MethodInfo>?)getGodotMethodListMethod.Invoke(null, null);
}
#pragma warning disable IDE1006 // Naming rule violation
// ReSharper disable once InconsistentNaming
[SuppressMessage("ReSharper", "NotAccessedField.Local")]
// ReSharper disable once NotAccessedField.Local
[StructLayout(LayoutKind.Sequential)]
private ref struct godotsharp_property_info
{
@ -1025,6 +1026,7 @@ namespace Godot.Bridge
HintString.Dispose();
}
}
#pragma warning restore IDE1006
[UnmanagedCallersOnly]
internal static unsafe void GetPropertyInfoList(IntPtr scriptPtr,
@ -1063,9 +1065,9 @@ namespace Godot.Bridge
int length = properties.Count;
// There's no recursion here, so it's ok to go with a big enough number for most cases
// stackMaxSize = stackMaxLength * sizeof(godotsharp_property_info)
const int stackMaxLength = 32;
bool useStack = length < stackMaxLength;
// StackMaxSize = StackMaxLength * sizeof(godotsharp_property_info)
const int StackMaxLength = 32;
bool useStack = length < StackMaxLength;
godotsharp_property_info* interopProperties;
@ -1073,7 +1075,7 @@ namespace Godot.Bridge
{
// Weird limitation, hence the need for aux:
// "In the case of pointer types, you can use a stackalloc expression only in a local variable declaration to initialize the variable."
var aux = stackalloc godotsharp_property_info[stackMaxLength];
var aux = stackalloc godotsharp_property_info[StackMaxLength];
interopProperties = aux;
}
else
@ -1124,8 +1126,9 @@ namespace Godot.Bridge
}
}
#pragma warning disable IDE1006 // Naming rule violation
// ReSharper disable once InconsistentNaming
[SuppressMessage("ReSharper", "NotAccessedField.Local")]
// ReSharper disable once NotAccessedField.Local
[StructLayout(LayoutKind.Sequential)]
private ref struct godotsharp_property_def_val_pair
{
@ -1133,6 +1136,7 @@ namespace Godot.Bridge
public godot_string_name Name; // Not owned
public godot_variant Value; // Not owned
}
#pragma warning restore IDE1006
private delegate bool InvokeGodotClassStaticMethodDelegate(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret);
@ -1252,9 +1256,9 @@ namespace Godot.Bridge
int length = defaultValues.Count;
// There's no recursion here, so it's ok to go with a big enough number for most cases
// stackMaxSize = stackMaxLength * sizeof(godotsharp_property_def_val_pair)
const int stackMaxLength = 32;
bool useStack = length < stackMaxLength;
// StackMaxSize = StackMaxLength * sizeof(godotsharp_property_def_val_pair)
const int StackMaxLength = 32;
bool useStack = length < StackMaxLength;
godotsharp_property_def_val_pair* interopDefaultValues;
@ -1262,7 +1266,7 @@ namespace Godot.Bridge
{
// Weird limitation, hence the need for aux:
// "In the case of pointer types, you can use a stackalloc expression only in a local variable declaration to initialize the variable."
var aux = stackalloc godotsharp_property_def_val_pair[stackMaxLength];
var aux = stackalloc godotsharp_property_def_val_pair[StackMaxLength];
interopDefaultValues = aux;
}
else

View File

@ -784,7 +784,7 @@ namespace Godot
name = name.Replace(".", string.Empty, StringComparison.Ordinal);
name = name.ToUpperInvariant();
return Colors.namedColors.TryGetValue(name, out color);
return Colors.NamedColors.TryGetValue(name, out color);
}
/// <summary>

View File

@ -9,7 +9,7 @@ namespace Godot
public static class Colors
{
// Color names and values are derived from core/math/color_names.inc
internal static readonly Dictionary<string, Color> namedColors = new Dictionary<string, Color> {
internal static readonly Dictionary<string, Color> NamedColors = new Dictionary<string, Color> {
{ "ALICEBLUE", Colors.AliceBlue },
{ "ANTIQUEWHITE", Colors.AntiqueWhite },
{ "AQUA", Colors.Aqua },

View File

@ -26,7 +26,6 @@ public static class CustomGCHandle
[MethodImpl(MethodImplOptions.NoInlining)]
public static bool IsAlcBeingUnloaded(AssemblyLoadContext alc) => _alcsBeingUnloaded.TryGetValue(alc, out _);
// ReSharper disable once RedundantNameQualifier
private static ConcurrentDictionary<
AssemblyLoadContext,
ConcurrentDictionary<GCHandle, object>

View File

@ -62,8 +62,9 @@ namespace Godot
Trace.Listeners.Add(new GodotTraceListener());
}
[StructLayout(LayoutKind.Sequential)]
#pragma warning disable IDE1006 // Naming rule violation
// ReSharper disable once InconsistentNaming
[StructLayout(LayoutKind.Sequential)]
internal ref struct godot_stack_info
{
public godot_string File;
@ -71,8 +72,8 @@ namespace Godot
public int Line;
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
[StructLayout(LayoutKind.Sequential)]
internal ref struct godot_stack_info_vector
{
private IntPtr _writeProxy;
@ -101,6 +102,7 @@ namespace Godot
_ptr = null;
}
}
#pragma warning restore IDE1006
internal static unsafe StackFrame? GetCurrentStackFrame(int skipFrames = 0)
{

View File

@ -141,7 +141,6 @@ namespace Godot
return true;
}
}
// ReSharper disable once RedundantNameQualifier
case GodotObject godotObject:
{
using (var stream = new MemoryStream())
@ -414,7 +413,6 @@ namespace Godot
case TargetKind.GodotObject:
{
ulong objectId = reader.ReadUInt64();
// ReSharper disable once RedundantNameQualifier
GodotObject? godotObject = GodotObject.InstanceFromId(objectId);
if (godotObject == null)
return false;
@ -495,7 +493,7 @@ namespace Godot
string methodName = reader.ReadString();
int flags = reader.ReadInt32();
BindingFlags flags = (BindingFlags)reader.ReadInt32();
bool hasReturn = reader.ReadBoolean();
Type? returnType = hasReturn ? DeserializeType(reader) : typeof(void);
@ -511,7 +509,11 @@ namespace Godot
parameterTypes[i] = parameterType;
}
methodInfo = declaringType.GetMethod(methodName, (BindingFlags)flags, null, parameterTypes, null);
#pragma warning disable REFL045 // These flags are insufficient to match any members
// TODO: Suppressing invalid warning, remove when issue is fixed
// https://github.com/DotNetAnalyzers/ReflectionAnalyzers/issues/209
methodInfo = declaringType.GetMethod(methodName, flags, null, parameterTypes, null);
#pragma warning restore REFL045
return methodInfo != null && methodInfo.ReturnType == returnType;
}
@ -588,7 +590,6 @@ namespace Godot
internal static class RuntimeTypeConversionHelper
{
[SuppressMessage("ReSharper", "RedundantNameQualifier")]
public static godot_variant ConvertToVariant(object? obj)
{
if (obj == null)
@ -713,10 +714,8 @@ namespace Godot
private delegate object? ConvertToSystemObjectFunc(in godot_variant managed);
[SuppressMessage("ReSharper", "RedundantNameQualifier")]
// ReSharper disable once RedundantNameQualifier
private static readonly System.Collections.Generic.Dictionary<Type, ConvertToSystemObjectFunc>
ToSystemObjectFuncByType = new()
_toSystemObjectFuncByType = new()
{
[typeof(bool)] = (in godot_variant variant) => VariantUtils.ConvertTo<bool>(variant),
[typeof(char)] = (in godot_variant variant) => VariantUtils.ConvertTo<char>(variant),
@ -771,10 +770,9 @@ namespace Godot
[typeof(Variant)] = (in godot_variant variant) => VariantUtils.ConvertTo<Variant>(variant),
};
[SuppressMessage("ReSharper", "RedundantNameQualifier")]
public static object? ConvertToObjectOfType(in godot_variant variant, Type type)
{
if (ToSystemObjectFuncByType.TryGetValue(type, out var func))
if (_toSystemObjectFuncByType.TryGetValue(type, out var func))
return func(variant);
if (typeof(GodotObject).IsAssignableFrom(type))
@ -838,8 +836,7 @@ namespace Godot
if (genericTypeDef == typeof(Godot.Collections.Dictionary<,>))
{
var ctor = type.GetConstructor(BindingFlags.Default,
new[] { typeof(Godot.Collections.Dictionary) });
var ctor = type.GetConstructor(new[] { typeof(Godot.Collections.Dictionary) });
if (ctor == null)
throw new InvalidOperationException("Dictionary constructor not found");
@ -852,8 +849,7 @@ namespace Godot
if (genericTypeDef == typeof(Godot.Collections.Array<>))
{
var ctor = type.GetConstructor(BindingFlags.Default,
new[] { typeof(Godot.Collections.Array) });
var ctor = type.GetConstructor(new[] { typeof(Godot.Collections.Array) });
if (ctor == null)
throw new InvalidOperationException("Array constructor not found");

View File

@ -59,7 +59,6 @@ namespace Godot
GD.Print("Unloading: Finished disposing tracked instances.");
}
// ReSharper disable once RedundantNameQualifier
private static ConcurrentDictionary<WeakReference<GodotObject>, byte> GodotObjectInstances { get; } =
new();

View File

@ -10,8 +10,8 @@ namespace Godot
{
public partial class GodotObject : IDisposable
{
private bool _disposed = false;
private static readonly Type CachedType = typeof(GodotObject);
private bool _disposed;
private static readonly Type _cachedType = typeof(GodotObject);
internal IntPtr NativePtr;
private bool _memoryOwn;
@ -25,11 +25,11 @@ namespace Godot
{
unsafe
{
_ConstructAndInitialize(NativeCtor, NativeName, CachedType, refCounted: false);
ConstructAndInitialize(NativeCtor, NativeName, _cachedType, refCounted: false);
}
}
internal unsafe void _ConstructAndInitialize(
internal unsafe void ConstructAndInitialize(
delegate* unmanaged<IntPtr> nativeCtor,
StringName nativeName,
Type cachedType,

View File

@ -36,11 +36,11 @@ namespace Godot
public const real_t NaN = real_t.NaN;
// 0.0174532924f and 0.0174532925199433
private const float _degToRadConstF = (float)0.0174532925199432957692369077M;
private const double _degToRadConstD = (double)0.0174532925199432957692369077M;
private const float DegToRadConstF = (float)0.0174532925199432957692369077M;
private const double DegToRadConstD = (double)0.0174532925199432957692369077M;
// 57.29578f and 57.2957795130823
private const float _radToDegConstF = (float)57.295779513082320876798154814M;
private const double _radToDegConstD = (double)57.295779513082320876798154814M;
private const float RadToDegConstF = (float)57.295779513082320876798154814M;
private const double RadToDegConstD = (double)57.295779513082320876798154814M;
/// <summary>
/// Returns the absolute value of <paramref name="s"/> (i.e. positive value).
@ -760,7 +760,7 @@ namespace Godot
/// <returns>The same angle expressed in radians.</returns>
public static float DegToRad(float deg)
{
return deg * _degToRadConstF;
return deg * DegToRadConstF;
}
/// <summary>
@ -770,7 +770,7 @@ namespace Godot
/// <returns>The same angle expressed in radians.</returns>
public static double DegToRad(double deg)
{
return deg * _degToRadConstD;
return deg * DegToRadConstD;
}
/// <summary>
@ -957,10 +957,10 @@ namespace Godot
return true;
}
// Then check for approximate equality.
float tolerance = _epsilonF * Math.Abs(a);
if (tolerance < _epsilonF)
float tolerance = EpsilonF * Math.Abs(a);
if (tolerance < EpsilonF)
{
tolerance = _epsilonF;
tolerance = EpsilonF;
}
return Math.Abs(a - b) < tolerance;
}
@ -981,10 +981,10 @@ namespace Godot
return true;
}
// Then check for approximate equality.
double tolerance = _epsilonD * Math.Abs(a);
if (tolerance < _epsilonD)
double tolerance = EpsilonD * Math.Abs(a);
if (tolerance < EpsilonD)
{
tolerance = _epsilonD;
tolerance = EpsilonD;
}
return Math.Abs(a - b) < tolerance;
}
@ -1069,7 +1069,7 @@ namespace Godot
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsZeroApprox(float s)
{
return Math.Abs(s) < _epsilonF;
return Math.Abs(s) < EpsilonF;
}
/// <summary>
@ -1084,7 +1084,7 @@ namespace Godot
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsZeroApprox(double s)
{
return Math.Abs(s) < _epsilonD;
return Math.Abs(s) < EpsilonD;
}
/// <summary>
@ -1412,7 +1412,7 @@ namespace Godot
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static float RadToDeg(float rad)
{
return rad * _radToDegConstF;
return rad * RadToDegConstF;
}
/// <summary>
@ -1423,7 +1423,7 @@ namespace Godot
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static double RadToDeg(double rad)
{
return rad * _radToDegConstD;
return rad * RadToDegConstD;
}
/// <summary>

View File

@ -21,8 +21,8 @@ namespace Godot
public const real_t Sqrt2 = (real_t)1.4142135623730950488016887242M; // 1.4142136f and 1.414213562373095
// Epsilon size should depend on the precision used.
private const float _epsilonF = 1e-06f;
private const double _epsilonD = 1e-14;
private const float EpsilonF = 1e-06f;
private const double EpsilonD = 1e-14;
/// <summary>
/// A very small number used for float comparison with error tolerance.
@ -31,7 +31,7 @@ namespace Godot
#if REAL_T_IS_DOUBLE
public const real_t Epsilon = _epsilonD;
#else
public const real_t Epsilon = _epsilonF;
public const real_t Epsilon = EpsilonF;
#endif
/// <summary>

View File

@ -1,3 +1,7 @@
#pragma warning disable CA1707 // Identifiers should not contain underscores
#pragma warning disable IDE1006 // Naming rule violation
// ReSharper disable InconsistentNaming
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
@ -24,7 +28,6 @@ namespace Godot.NativeInterop
}
// Apparently a struct with a byte is not blittable? It crashes when calling a UnmanagedCallersOnly function ptr.
// ReSharper disable once InconsistentNaming
public enum godot_bool : byte
{
True = 1,
@ -32,7 +35,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
public ref struct godot_ref
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -62,7 +64,6 @@ namespace Godot.NativeInterop
}
}
[SuppressMessage("ReSharper", "InconsistentNaming")]
public enum godot_variant_call_error_error
{
GODOT_CALL_ERROR_CALL_OK = 0,
@ -75,7 +76,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
public ref struct godot_variant_call_error
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -106,7 +106,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
public ref struct godot_csharp_type_info
{
private godot_string _className;
@ -161,7 +160,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential, Pack = 8)]
// ReSharper disable once InconsistentNaming
public ref struct godot_variant
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -176,7 +174,6 @@ namespace Godot.NativeInterop
private godot_variant_data _data;
[StructLayout(LayoutKind.Explicit)]
// ReSharper disable once InconsistentNaming
private unsafe ref struct godot_variant_data
{
[FieldOffset(0)] public godot_bool _bool;
@ -212,7 +209,6 @@ namespace Godot.NativeInterop
[FieldOffset(0)] public godot_array _m_array;
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
public struct godot_variant_obj_data
{
public ulong id;
@ -220,7 +216,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
public struct godot_variant_data_mem
{
#pragma warning disable 169
@ -480,7 +475,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Explicit)]
// ReSharper disable once InconsistentNaming
internal struct movable
{
// Variant.Type is generated as an enum of type long, so we can't use for the field as it must only take 32-bits.
@ -502,7 +496,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
public ref struct godot_string
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -534,7 +527,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
public ref struct godot_string_name
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -590,7 +582,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
internal struct movable
{
private IntPtr _data;
@ -607,7 +598,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
public ref struct godot_node_path
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -638,7 +628,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
internal struct movable
{
private IntPtr _data;
@ -655,7 +644,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Explicit)]
// ReSharper disable once InconsistentNaming
public ref struct godot_signal
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -698,7 +686,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Explicit)]
// ReSharper disable once InconsistentNaming
public ref struct godot_callable
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -736,7 +723,6 @@ namespace Godot.NativeInterop
// Don't pass a C# default constructed `godot_array` to native code, unless it's going to
// be re-assigned a new value (the copy constructor checks if `_p` is null so that's fine).
[StructLayout(LayoutKind.Explicit)]
// ReSharper disable once InconsistentNaming
public ref struct godot_array
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -817,7 +803,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
internal struct movable
{
private unsafe ArrayPrivate* _p;
@ -838,7 +823,6 @@ namespace Godot.NativeInterop
// Don't pass a C# default constructed `godot_dictionary` to native code, unless it's going to
// be re-assigned a new value (the copy constructor checks if `_p` is null so that's fine).
[StructLayout(LayoutKind.Explicit)]
// ReSharper disable once InconsistentNaming
public ref struct godot_dictionary
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -886,7 +870,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
internal struct movable
{
private unsafe DictionaryPrivate* _p;
@ -903,7 +886,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
public ref struct godot_packed_byte_array
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -935,7 +917,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
public ref struct godot_packed_int32_array
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -967,7 +948,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
public ref struct godot_packed_int64_array
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -999,7 +979,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
public ref struct godot_packed_float32_array
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -1031,7 +1010,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
public ref struct godot_packed_float64_array
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -1063,7 +1041,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
public ref struct godot_packed_string_array
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -1095,7 +1072,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
public ref struct godot_packed_vector2_array
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -1127,7 +1103,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
public ref struct godot_packed_vector3_array
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -1159,7 +1134,6 @@ namespace Godot.NativeInterop
}
[StructLayout(LayoutKind.Sequential)]
// ReSharper disable once InconsistentNaming
public ref struct godot_packed_color_array
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -1190,7 +1164,6 @@ namespace Godot.NativeInterop
}
}
[SuppressMessage("ReSharper", "InconsistentNaming")]
public enum godot_error_handler_type
{
ERR_HANDLER_ERROR = 0,

View File

@ -1,3 +1,5 @@
#pragma warning disable CA1707 // Identifiers should not contain underscores
using System;
using System.Runtime.InteropServices;
using Godot.Collections;
@ -213,13 +215,13 @@ namespace Godot.NativeInterop
if (p_string.Buffer == IntPtr.Zero)
return string.Empty;
const int sizeOfChar32 = 4;
const int SizeOfChar32 = 4;
byte* bytes = (byte*)p_string.Buffer;
int size = p_string.Size;
if (size == 0)
return string.Empty;
size -= 1; // zero at the end
int sizeInBytes = size * sizeOfChar32;
int sizeInBytes = size * SizeOfChar32;
return System.Text.Encoding.UTF32.GetString(bytes, sizeInBytes);
}

View File

@ -1,9 +1,11 @@
#pragma warning disable CA1707 // Identifiers should not contain underscores
#pragma warning disable IDE1006 // Naming rule violation
// ReSharper disable InconsistentNaming
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using Godot.SourceGenerators.Internal;
// ReSharper disable InconsistentNaming
namespace Godot.NativeInterop
{
@ -16,7 +18,7 @@ namespace Godot.NativeInterop
[GenerateUnmanagedCallbacks(typeof(UnmanagedCallbacks))]
public static unsafe partial class NativeFuncs
{
private static bool initialized = false;
private static bool initialized;
// ReSharper disable once ParameterOnlyUsedForPreconditionCheck.Global
public static void Initialize(IntPtr unmanagedCallbacks, int unmanagedCallbacksSize)

View File

@ -1,3 +1,5 @@
#pragma warning disable CA1707 // Identifiers should not contain underscores
#pragma warning disable IDE1006 // Naming rule violation
// ReSharper disable InconsistentNaming
namespace Godot.NativeInterop

View File

@ -1,8 +1,11 @@
#pragma warning disable CA1707 // Identifiers should not contain underscores
#pragma warning disable IDE1006 // Naming rule violation
// ReSharper disable InconsistentNaming
using System;
using System.Runtime.CompilerServices;
using Godot.Collections;
// ReSharper disable InconsistentNaming
#nullable enable
@ -240,7 +243,6 @@ namespace Godot.NativeInterop
public static godot_variant CreateFromSystemArrayOfRid(Span<Rid> from)
=> CreateFromArray(new Collections.Array(from));
// ReSharper disable once RedundantNameQualifier
public static godot_variant CreateFromSystemArrayOfGodotObject(GodotObject[]? from)
{
if (from == null)
@ -306,7 +308,6 @@ namespace Godot.NativeInterop
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
// ReSharper disable once RedundantNameQualifier
public static godot_variant CreateFromGodotObject(GodotObject? from)
=> from != null ? CreateFromGodotObjectPtr(GodotObject.GetPtr(from)) : default;
@ -459,7 +460,6 @@ namespace Godot.NativeInterop
=> p_var.Type == Variant.Type.Object ? p_var.Object : IntPtr.Zero;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
// ReSharper disable once RedundantNameQualifier
public static GodotObject ConvertToGodotObject(in godot_variant p_var)
=> InteropUtils.UnmanagedGetManaged(ConvertToGodotObjectPtr(p_var));
@ -615,7 +615,6 @@ namespace Godot.NativeInterop
}
public static T[] ConvertToSystemArrayOfGodotObject<T>(in godot_variant p_var)
// ReSharper disable once RedundantNameQualifier
where T : GodotObject
{
using var godotArray = NativeFuncs.godotsharp_variant_as_array(p_var);

View File

@ -1,5 +1,4 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
namespace Godot.NativeInterop;
@ -25,7 +24,6 @@ public partial class VariantUtils
// ReSharper disable once StaticMemberInGenericType
internal static unsafe delegate*<in godot_variant, T> FromVariantCb;
[SuppressMessage("ReSharper", "RedundantNameQualifier")]
static GenericConversion()
{
RuntimeHelpers.RunClassConstructor(typeof(T).TypeHandle);
@ -33,7 +31,6 @@ public partial class VariantUtils
}
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
[SuppressMessage("ReSharper", "RedundantNameQualifier")]
public static godot_variant CreateFrom<[MustBeVariant] T>(in T from)
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -224,7 +221,6 @@ public partial class VariantUtils
}
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
[SuppressMessage("ReSharper", "RedundantNameQualifier")]
public static T ConvertTo<[MustBeVariant] T>(in godot_variant variant)
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]

View File

@ -251,10 +251,10 @@ namespace Godot
/// <param name="right">The right clipping distance.</param>
/// <param name="bottom">The bottom clipping distance.</param>
/// <param name="top">The top clipping distance.</param>
/// <param name="near">The near clipping distance.</param>
/// <param name="far">The far clipping distance.</param>
/// <param name="depthNear">The near clipping distance.</param>
/// <param name="depthFar">The far clipping distance.</param>
/// <returns>The created projection.</returns>
public static Projection CreateFrustum(real_t left, real_t right, real_t bottom, real_t top, real_t depth_near, real_t depth_far)
public static Projection CreateFrustum(real_t left, real_t right, real_t bottom, real_t top, real_t depthNear, real_t depthFar)
{
if (right <= left)
{
@ -264,18 +264,18 @@ namespace Godot
{
throw new ArgumentException("top is less or equal to bottom.");
}
if (depth_far <= depth_near)
if (depthFar <= depthNear)
{
throw new ArgumentException("far is less or equal to near.");
}
real_t x = 2 * depth_near / (right - left);
real_t y = 2 * depth_near / (top - bottom);
real_t x = 2 * depthNear / (right - left);
real_t y = 2 * depthNear / (top - bottom);
real_t a = (right + left) / (right - left);
real_t b = (top + bottom) / (top - bottom);
real_t c = -(depth_far + depth_near) / (depth_far - depth_near);
real_t d = -2 * depth_far * depth_near / (depth_far - depth_near);
real_t c = -(depthFar + depthNear) / (depthFar - depthNear);
real_t d = -2 * depthFar * depthNear / (depthFar - depthNear);
return new Projection(
new Vector4(x, 0, 0, 0),
@ -293,17 +293,17 @@ namespace Godot
/// <param name="size">The frustum size.</param>
/// <param name="aspect">The aspect ratio.</param>
/// <param name="offset">The offset to apply.</param>
/// <param name="near">The near clipping distance.</param>
/// <param name="far">The far clipping distance.</param>
/// <param name="depthNear">The near clipping distance.</param>
/// <param name="depthFar">The far clipping distance.</param>
/// <param name="flipFov">If the field of view is flipped over the projection's diagonal.</param>
/// <returns>The created projection.</returns>
public static Projection CreateFrustumAspect(real_t size, real_t aspect, Vector2 offset, real_t depth_near, real_t depth_far, bool flipFov)
public static Projection CreateFrustumAspect(real_t size, real_t aspect, Vector2 offset, real_t depthNear, real_t depthFar, bool flipFov)
{
if (!flipFov)
{
size *= aspect;
}
return CreateFrustum(-size / 2 + offset.X, +size / 2 + offset.X, -size / aspect / 2 + offset.Y, +size / aspect / 2 + offset.Y, depth_near, depth_far);
return CreateFrustum(-size / 2 + offset.X, +size / 2 + offset.X, -size / aspect / 2 + offset.Y, +size / aspect / 2 + offset.Y, depthNear, depthFar);
}
/// <summary>

View File

@ -1836,8 +1836,8 @@ namespace Godot
return Uri.EscapeDataString(instance);
}
private const string _uniqueNodePrefix = "%";
private static readonly string[] _invalidNodeNameCharacters = { ".", ":", "@", "/", "\"", _uniqueNodePrefix };
private const string UniqueNodePrefix = "%";
private static readonly string[] _invalidNodeNameCharacters = { ".", ":", "@", "/", "\"", UniqueNodePrefix };
/// <summary>
/// Removes any characters from the string that are prohibited in

View File

@ -1,5 +1,4 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using Godot.NativeInterop;
@ -7,7 +6,6 @@ namespace Godot;
#nullable enable
[SuppressMessage("ReSharper", "RedundantNameQualifier")]
public partial struct Variant : IDisposable
{
internal godot_variant.movable NativeVar;

View File

@ -7,6 +7,9 @@ using System.ComponentModel;
namespace Godot;
// TODO: This is currently disabled because of https://github.com/dotnet/roslyn/issues/52904
#pragma warning disable IDE0040 // Add accessibility modifiers.
partial class EditorUndoRedoManager
{
/// <inheritdoc cref="CreateAction(string, UndoRedo.MergeMode, GodotObject, bool)"/>