private void ApplyNewData(ArkCloudInventory[] inventories, bool decouple = true) { // Setup relations in the domain model between entities var newClusterData = new ArkClusterDataBase(inventories); newClusterData.Initialize(); foreach (var i in inventories) { i.Initialize(newClusterData); } if (decouple) //should always be true except for debugging { // Unset all references to raw extracted game objects and properties to free memory foreach (var i in inventories) { i.Decouple(); } } // Assign updated data to public properties newClusterData.CopyTo(this); // Force an immediate garbage collection because it seems more effective (extraction process requires a great deal of memory) //GC.Collect(); }
private void ApplyNewData(ArkCloudInventory[] inventories, bool decouple = true) { // Setup relations in the domain model between entities var newClusterData = new ArkClusterDataBase(inventories); newClusterData.Initialize(); foreach (var i in inventories) { i.Initialize(newClusterData); } if (decouple) //should always be true except for debugging { // Unset all references to raw extracted game objects and properties to free memory foreach (var i in inventories) { i.Decouple(); } } // Assign updated data to public properties newClusterData.CopyTo(this); }