Skip to content

Commit

Permalink
Revert "Add ICloneable support to ComponentNetworkGenerator (#5656)" (#…
Browse files Browse the repository at this point in the history
…5687)

This reverts commit e145370.
  • Loading branch information
ElectroJr authored Feb 20, 2025
1 parent 3bbbabf commit f29949a
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions Robust.Shared.CompNetworkGenerator/ComponentNetworkGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -746,17 +746,7 @@ public void Initialize(GeneratorInitializationContext context)

private static bool IsCloneType(ITypeSymbol type)
{
if (type is not INamedTypeSymbol named)
{
return false;
}

if (ImplementsInterface(named, nameof(ICloneable)))
{
return true;
}

if (!named.IsGenericType)
if (type is not INamedTypeSymbol named || !named.IsGenericType)
{
return false;
}
Expand All @@ -768,18 +758,5 @@ private static bool IsCloneType(ITypeSymbol type)
_ => false
};
}

private static bool ImplementsInterface(ITypeSymbol type, string interfaceName)
{
foreach (var interfaceType in type.AllInterfaces)
{
if (interfaceType.ToDisplayString().Contains(interfaceName))
{
return true;
}
}

return false;
}
}
}

0 comments on commit f29949a

Please sign in to comment.