Fix GetDependencyClasses For Set and Map

pull/2/head
Srkmn 2 years ago
parent 969682bc95
commit 5c3d42462f
  1. 2
      .gitignore
  2. 35
      SourceCodeGenerator.cs

2
.gitignore vendored

@ -72,3 +72,5 @@ Plugins/**/Intermediate/*
# Cache files for the editor to use
DerivedDataCache/*
obj/*

@ -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);
}
}

Loading…
Cancel
Save