Fix GetDependencyClasses For Set and Map

This commit is contained in:
Srkmn committed 2024-11-17 16:40:26 +08:00
1 parent 969682bc95
commit 5c3d42462f
2 files changed
+30 -7

No files matched your search

+2
View File
@@ -72,3 +72,5 @@ Plugins/**/Intermediate/*
# Cache files for the editor to use
DerivedDataCache/*
obj/*
+28 -7
View File
@@ -267,11 +267,6 @@ namespace SourceCodeGeneratorUbtPlugin
private static bool IsPropertyTypeSupported(UhtProperty property)
{
if (property is UhtArrayProperty arrayProperty)
{
return IsPropertyTypeSupported(arrayProperty.ValueProperty);
}
if (property is UhtObjectProperty objectProperty)
{
if (!IsClassTypeSupported(objectProperty.Class))
@@ -306,6 +301,22 @@ namespace SourceCodeGeneratorUbtPlugin
return false;
}
if (property is UhtArrayProperty arrayProperty)
{
return IsPropertyTypeSupported(arrayProperty.ValueProperty);
}
if (property is UhtSetProperty setProperty)
{
return IsPropertyTypeSupported(setProperty.ValueProperty);
}
if (property is UhtMapProperty mapProperty)
{
return IsPropertyTypeSupported(mapProperty.KeyProperty) &&
IsPropertyTypeSupported(mapProperty.ValueProperty);
}
return property is { IsBitfield: false, IsStaticArray: false };
}
@@ -471,9 +482,19 @@ namespace SourceCodeGeneratorUbtPlugin
{
DependencyClasses.Add(softObjectProperty.Class);
}
else if (property is UhtArrayProperty { ValueProperty: UhtObjectProperty valueProperty })
else if (property is UhtArrayProperty arrayProperty)
{
DependencyClasses.Add(valueProperty.Class);
GetDependencyClasses(arrayProperty.ValueProperty, DependencyClasses);
}
else if (property is UhtSetProperty setProperty)
{
GetDependencyClasses(setProperty.ValueProperty, DependencyClasses);
}
else if (property is UhtMapProperty mapProperty)
{
GetDependencyClasses(mapProperty.KeyProperty, DependencyClasses);
GetDependencyClasses(mapProperty.ValueProperty, DependencyClasses);
}
}