C#: Rename Object to GodotObject

This commit is contained in:
Raul Santos
2022-12-07 16:16:51 +01:00
parent a968e51414
commit 1aceacaa6b
38 changed files with 147 additions and 145 deletions
@@ -14,9 +14,9 @@ namespace Godot.SourceGenerators
{
string message =
"Missing partial modifier on declaration of type '" +
$"{symbol.FullQualifiedNameOmitGlobal()}' which is a subclass of '{GodotClasses.Object}'";
$"{symbol.FullQualifiedNameOmitGlobal()}' which is a subclass of '{GodotClasses.GodotObject}'";
string description = $"{message}. Subclasses of '{GodotClasses.Object}' " +
string description = $"{message}. Subclasses of '{GodotClasses.GodotObject}' " +
"must be declared with the partial modifier.";
context.ReportDiagnostic(Diagnostic.Create(
@@ -46,9 +46,9 @@ namespace Godot.SourceGenerators
string message =
$"Missing partial modifier on declaration of type '{fullQualifiedName}', " +
$"which contains one or more subclasses of '{GodotClasses.Object}'";
$"which contains one or more subclasses of '{GodotClasses.GodotObject}'";
string description = $"{message}. Subclasses of '{GodotClasses.Object}' and their " +
string description = $"{message}. Subclasses of '{GodotClasses.GodotObject}' and their " +
"containing types must be declared with the partial modifier.";
context.ReportDiagnostic(Diagnostic.Create(
@@ -85,7 +85,7 @@ namespace Godot.SourceGenerators
var classTypeSymbol = sm.GetDeclaredSymbol(cds);
if (classTypeSymbol?.BaseType == null
|| !classTypeSymbol.BaseType.InheritsFrom("GodotSharp", GodotClasses.Object))
|| !classTypeSymbol.BaseType.InheritsFrom("GodotSharp", GodotClasses.GodotObject))
{
symbol = null;
return false;
@@ -2,7 +2,7 @@ namespace Godot.SourceGenerators
{
public static class GodotClasses
{
public const string Object = "Godot.Object";
public const string GodotObject = "Godot.GodotObject";
public const string AssemblyHasScriptsAttr = "Godot.AssemblyHasScriptsAttribute";
public const string ExportAttr = "Godot.ExportAttribute";
public const string ExportCategoryAttr = "Godot.ExportCategoryAttribute";
@@ -34,7 +34,7 @@ namespace GodotPlugins.Game
{
DllImportResolver dllImportResolver = new GodotDllImportResolver(godotDllHandle).OnResolveDllImport;
var coreApiAssembly = typeof(Godot.Object).Assembly;
var coreApiAssembly = typeof(global::Godot.GodotObject).Assembly;
NativeLibrary.SetDllImportResolver(coreApiAssembly, dllImportResolver);
@@ -42,7 +42,7 @@ namespace GodotPlugins.Game
ManagedCallbacks.Create(outManagedCallbacks);
ScriptManagerBridge.LookupScriptsInAssembly(typeof(GodotPlugins.Game.Main).Assembly);
ScriptManagerBridge.LookupScriptsInAssembly(typeof(global::GodotPlugins.Game.Main).Assembly);
return godot_bool.True;
}
@@ -19,7 +19,7 @@ namespace Godot.SourceGenerators
throw new InvalidOperationException($"Type not found: '{fullyQualifiedMetadataName}'.");
}
GodotObjectType = GetTypeByMetadataNameOrThrow("Godot.Object");
GodotObjectType = GetTypeByMetadataNameOrThrow(GodotClasses.GodotObject);
}
}