From ef853b6fd29f78733f8121d8de31bc6e6bcd9f47 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Tue, 11 Aug 2020 07:36:53 +0200 Subject: [PATCH] Model: Add AppModel.GetAddressMap() with cache --- Il2CppInspector.Common/Model/AppModel.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Il2CppInspector.Common/Model/AppModel.cs b/Il2CppInspector.Common/Model/AppModel.cs index 4bc5cb7..6020786 100644 --- a/Il2CppInspector.Common/Model/AppModel.cs +++ b/Il2CppInspector.Common/Model/AppModel.cs @@ -274,5 +274,14 @@ namespace Il2CppInspector.Model // Get all the composite methods for a group public IEnumerable GetMethodGroup(string groupName) => Methods.Values.Where(m => m.Group == groupName); + + // Get the address map for the model + // This takes a while to construct so we only build it if requested + private AddressMap addressMap; + public AddressMap GetAddressMap() { + if (addressMap == null) + addressMap = new AddressMap(this); + return addressMap; + } } }