private void updateParameterFromIndividual(ISpatialStructure spatialStructure, Individual individual) { //Update parameter values for parameter that have been changed in individual var allIndividualParameter = new PathCache <IParameter>(_entityPathResolver).For(individual.GetAllChildren <IParameter>()); var allContainerParameters = new PathCache <IParameter>(_entityPathResolver).For(spatialStructure.TopContainers.SelectMany(x => x.GetAllChildren <IParameter>())); var allNeighborhoodParameters = new PathCache <IParameter>(_entityPathResolver).For(spatialStructure.Neighborhoods.SelectMany(x => x.GetAllChildren <IParameter>())); _parameterSetUpdater.UpdateValues(allIndividualParameter, allContainerParameters); _parameterSetUpdater.UpdateValues(allIndividualParameter, allNeighborhoodParameters); _parameterIdUpdater.UpdateBuildingBlockId(allContainerParameters, individual); _parameterIdUpdater.UpdateBuildingBlockId(allNeighborhoodParameters, individual); copyParameterTags(allIndividualParameter, allContainerParameters); copyParameterTags(allIndividualParameter, allNeighborhoodParameters); }
private Task <LocalizedParameter[]> allParametersChangedByUserFrom(ModelIndividual individual) { var changedParameters = individual.GetAllChildren <IParameter>(x => x.ShouldExportToSnapshot()); return(_parameterMapper.LocalizedParametersFrom(changedParameters)); }