From 18b94e08f3945b8909897eab4902bb4207994635 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Tue, 30 Jun 2020 00:06:07 +0200 Subject: [PATCH] Add CppDeclarationGenerator.Reset() --- .../CppUtils/CppDeclarationGenerator.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Il2CppInspector.Common/CppUtils/CppDeclarationGenerator.cs b/Il2CppInspector.Common/CppUtils/CppDeclarationGenerator.cs index a21b5f2..bac703d 100755 --- a/Il2CppInspector.Common/CppUtils/CppDeclarationGenerator.cs +++ b/Il2CppInspector.Common/CppUtils/CppDeclarationGenerator.cs @@ -95,6 +95,14 @@ namespace Il2CppInspector.CppUtils return $"struct {TypeNamer.GetName(ti)} *"; } + // Resets the cache of visited types and pending types to output, but preserve any names we have already generated + public void Reset() { + VisitedFieldStructs.Clear(); + VisitedTypes.Clear(); + TodoFieldStructs.Clear(); + TodoTypeStructs.Clear(); + } + #region Field Struct Generation /* Generating field structures (structures for the fields of a given type) occurs in two passes. * In the first pass (VisitFieldStructs), we walk over a type and all of the types that the resulting structure would depend on.