public void UpdateUsedBuildingBlockBasedOnTemplateIn(Simulation simulation) { //only required for compound at the moment since they are the only one that can actually get out of sync. foreach (var usedBuildingBlock in simulation.UsedBuildingBlocksInSimulation <Compound>()) { var templateBuildingBlock = _buildingBlockInSimulationManager.TemplateBuildingBlockUsedBy(usedBuildingBlock); //not using a template building block so we simply keep this guy if (Equals(templateBuildingBlock, usedBuildingBlock.BuildingBlock)) { continue; } usedBuildingBlock.BuildingBlock = _cloner.Clone(templateBuildingBlock); } _compoundPropertiesUpdater.UpdateCompoundPropertiesIn(simulation); }
private void updateCompoundProperties(Simulation simulation) => _compoundPropertiesUpdater.UpdateCompoundPropertiesIn(simulation);