/** * {@inheritDoc} * * @param config {@inheritDoc} * @return {@inheritDoc} * @throws CouldNotPerformException {@inheritDoc} * @throws InterruptedException {@inheritDoc} */ @Override public synchronized UnitConfig applyConfigUpdate(UnitConfig config) throws CouldNotPerformException, InterruptedException { this.config = config; this.scope = new Scope(config.getMetaConfig().getEntryList().stream() .filter(e -> "scope".equals(e.getKey())) .findFirst() .orElseThrow(() -> new CouldNotPerformException("No scope was found for UnitConfig " + config.getLabel())).getValue()); Transform3D transform; try { transform = Registries.getLocationRegistry(true).getUnitToRootTransform3D(config); } catch (CouldNotPerformException ex) { throw new CouldNotPerformException("Could not get the transformation.", ex); } setTransform(transform); LOGGER.debug("RegistryTransformer for id " + config.getId() + " updated."); return this.config; }
/** * {@inheritDoc} * * @param config {@inheritDoc} * @return {@inheritDoc} * @throws CouldNotPerformException {@inheritDoc} * @throws InterruptedException {@inheritDoc} */ @Override public synchronized UnitConfig applyConfigUpdate(UnitConfig config) throws CouldNotPerformException, InterruptedException { this.config = config; Transform3D unitToRootTransform = Registries.getLocationRegistry(true).getUnitToRootTransform3D(config); AxisAlignedBoundingBox3DFloat aabb = Registries.getLocationRegistry().getUnitShape(config).getBoundingBox(); boundingBox = new BoundingBox(unitToRootTransform, aabb); return this.config; }