C++: Allow typedef aliases to be retrieved from CppTypeCollection indexer

This commit is contained in:
Katy Coe
2020-08-13 03:42:15 +02:00
parent 0c998de844
commit 8609523eba

View File

@@ -25,7 +25,8 @@ namespace Il2CppInspector.Cpp
// All of the literal typedef aliases // All of the literal typedef aliases
public Dictionary<string, CppType> TypedefAliases { get; } = new Dictionary<string, CppType>(); public Dictionary<string, CppType> TypedefAliases { get; } = new Dictionary<string, CppType>();
public CppType this[string s] => Types[s]; public CppType this[string s] => Types.ContainsKey(s)? Types[s] :
TypedefAliases.ContainsKey(s)? TypedefAliases[s].AsAlias(s) : null;
public IEnumerator<CppType> GetEnumerator() => Types.Values.GetEnumerator(); public IEnumerator<CppType> GetEnumerator() => Types.Values.GetEnumerator();
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();