diff --git a/Il2CppInspector.Common/Reflection/Il2CppModel.cs b/Il2CppInspector.Common/Reflection/Il2CppModel.cs index 2266935..8fbc79c 100644 --- a/Il2CppInspector.Common/Reflection/Il2CppModel.cs +++ b/Il2CppInspector.Common/Reflection/Il2CppModel.cs @@ -32,13 +32,8 @@ namespace Il2CppInspector.Reflection public Dictionary TypesByFullName { get; } = new Dictionary(); // Every type - public IEnumerable Types { - get { - var result = new IEnumerable[] { TypesByDefinitionIndex, TypesByReferenceIndex }.SelectMany(t => t); - result = result.Concat(result.SelectMany(t => t.CachedGeneratedTypes)); - return result.Distinct(); - } - } + public IEnumerable Types => TypesByDefinitionIndex.Concat(TypesByReferenceIndex) + .Concat(GenericMethods.Values.Select(m => m.DeclaringType)).Distinct(); // List of all methods ordered by their MethodDefinitionIndex public MethodBase[] MethodsByDefinitionIndex { get; } diff --git a/Il2CppInspector.Common/Reflection/TypeInfo.cs b/Il2CppInspector.Common/Reflection/TypeInfo.cs index 5c512b6..3f42c74 100644 --- a/Il2CppInspector.Common/Reflection/TypeInfo.cs +++ b/Il2CppInspector.Common/Reflection/TypeInfo.cs @@ -37,19 +37,6 @@ namespace Il2CppInspector.Reflection { private Dictionary generatedArrayTypes = new Dictionary(); private TypeInfo generatedByRefType; private TypeInfo generatedPointerType; - // This property exposes all types which have been generated directly from this one. - public IEnumerable CachedGeneratedTypes { - get { - IEnumerable result = generatedArrayTypes.Values; - if (genericTypeInstances != null) - result = result.Concat(genericTypeInstances.Values); - if (generatedByRefType != null) - result = result.Append(generatedByRefType); - if (generatedPointerType != null) - result = result.Append(generatedPointerType); - return result; - } - } // Information/flags about the type // Undefined if the Type represents a generic type parameter