Fix interface naming bug

This commit is contained in:
Cj 2024-06-16 19:20:42 -04:00
parent c2728ab0a4
commit e8c443d9ab

View File

@ -385,6 +385,7 @@ public class ReCodeItAutoMapper
if (pair.IsInterface) if (pair.IsInterface)
{ {
pair.Name = string.Concat("I", pair.Name.AsSpan(0)); pair.Name = string.Concat("I", pair.Name.AsSpan(0));
pair.Name = pair.Name.Replace("Class", "");
} }
/* /*
// Try and remove any trailing 's' that exist // Try and remove any trailing 's' that exist
@ -397,15 +398,19 @@ public class ReCodeItAutoMapper
} }
*/ */
// If its not an interface, its a struct or class // If its not an interface, its a struct or class
switch (pair.IsStruct && !pair.IsInterface)
{
case true:
pair.Name = string.Concat(pair.Name, "Struct");
break;
case false: if (pair.IsInterface)
pair.Name = string.Concat(pair.Name, "Class"); {
break; // Replace class if it exists
pair.Name = pair.Name.Replace("Class", "");
}
else if (pair.IsStruct)
{
pair.Name = string.Concat(pair.Name, "Struct");
}
else
{
pair.Name = string.Concat(pair.Name, "Class");
} }
Logger.Log($"------------------------------------------------------------------------"); Logger.Log($"------------------------------------------------------------------------");