feat: modules moved and engine moved to submodule

This commit is contained in:
Jan van der Weide 2025-04-12 18:40:44 +02:00
parent dfb5e645cd
commit c33d2130cc
5136 changed files with 225275 additions and 64485 deletions

View file

@ -0,0 +1,15 @@
using Xunit;
namespace Godot.SourceGenerators.Tests;
public class NestedInGenericTest
{
[Fact]
public async void GenerateScriptMethodsTest()
{
await CSharpSourceGeneratorVerifier<ScriptMethodsGenerator>.Verify(
"NestedInGeneric.cs",
"GenericClass(Of T).NestedClass_ScriptMethods.generated.cs"
);
}
}

View file

@ -22,6 +22,13 @@ public class ScriptPropertyDefValGeneratorTests
);
}
[Fact]
public async void ExportedProperties2()
{
await CSharpSourceGeneratorVerifier<ScriptPropertyDefValGenerator>.Verify(
"ExportedProperties2.cs", "ExportedProperties2_ScriptPropertyDefVal.generated.cs");
}
[Fact]
public async void ExportedComplexStrings()
{

View file

@ -0,0 +1,25 @@
partial class ExportedProperties2
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
#if TOOLS
/// <summary>
/// Get the default values for all properties declared in this class.
/// This method is used by Godot to determine the value that will be
/// used by the inspector when resetting properties.
/// Do not call this method.
/// </summary>
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
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>(3);
int __Health_default_value = default;
values.Add(PropertyName.@Health, global::Godot.Variant.From<int>(__Health_default_value));
global::Godot.Resource __SubResource_default_value = default;
values.Add(PropertyName.@SubResource, global::Godot.Variant.From<global::Godot.Resource>(__SubResource_default_value));
string[] __Strings_default_value = default;
values.Add(PropertyName.@Strings, global::Godot.Variant.From<string[]>(__Strings_default_value));
return values;
}
#endif // TOOLS
#pragma warning restore CS0109
}

View file

@ -0,0 +1,16 @@
using Godot;
using Godot.NativeInterop;
partial class GenericClass<T>
{
partial class NestedClass
{
#pragma warning disable CS0109 // Disable warning about redundant 'new' keyword
/// <summary>
/// Cached StringNames for the methods contained in this class, for fast lookup.
/// </summary>
public new class MethodName : global::Godot.GodotObject.MethodName {
}
#pragma warning restore CS0109
}
}

View file

@ -0,0 +1,13 @@
using Godot;
using System;
[GlobalClass]
public partial class ExportedProperties2(int health, Resource subResource, string[] strings) : Resource
{
[Export]
public int Health { get; set; } = health;
[Export]
public Resource SubResource { get; set; } = subResource;
[Export]
public string[] Strings { get; set; } = strings ?? System.Array.Empty<string>();
}

View file

@ -0,0 +1,9 @@
using Godot;
public partial class GenericClass<T>
{
public partial class NestedClass : GodotObject
{
}
}