Load the tile collisions.

@param mapCollision The map tile collision owner.
@param tile The tile reference.
978449
private void loadTileCollisions(MapTileCollision mapCollision, Tile tile)
    {
        final TileCollision tileCollision;
        if (!tile.hasFeature(TileCollision.class))
        {
            tileCollision = new TileCollisionModel(tile);
            tile.addFeature(tileCollision);
        }
        else
        {
            tileCollision = tile.getFeature(TileCollision.class);
        }
        tileCollision.removeCollisionFormulas();
        addTileCollisions(mapCollision, tileCollision, tile);
    }
653388
function() {
        var buffer = this.buffer + 1;
        while(true) {
            var tlTile = this.grid[0][0];
            var tlViewPort = {
                x: tlTile.position.x +
                    this.map.layerContainerOriginPx.x,
                y: tlTile.position.y +
                    this.map.layerContainerOriginPx.y
            };
            var ratio = this.getServerResolution() / this.map.getResolution();
            var tileSize = {
                w: Math.round(this.tileSize.w * ratio),
                h: Math.round(this.tileSize.h * ratio)
            };
            if (tlViewPort.x > -tileSize.w * (buffer - 1)) {
                this.shiftColumn(true, tileSize);
            } else if (tlViewPort.x < -tileSize.w * buffer) {
                this.shiftColumn(false, tileSize);
            } else if (tlViewPort.y > -tileSize.h * (buffer - 1)) {
                this.shiftRow(true, tileSize);
            } else if (tlViewPort.y < -tileSize.h * buffer) {
                this.shiftRow(false, tileSize);
            } else {
                break;
            }
        }
    }
406725
function _resolveCollisions(collisions, physicsParams) {
  collisions.forEach(collision => {
    // If neither physics job needs the standard collision restitution, then don't do it.
    if (_notifyPhysicsJobsOfCollision(collision)) {
      if (collision.collidableA.physicsJob && collision.collidableB.physicsJob) {
        // Neither of the collidables is stationary.
        _resolveCollision(collision, physicsParams);
      } else {
        // One of the two collidables is stationary.
        _resolveCollisionWithStationaryObject(collision, physicsParams);
      }
    }
  });
}
738156
public static CollisionCategory imports(Xml root, MapTileCollision map)
    {
        Check.notNull(root);
        Check.notNull(map);

        final Collection<Xml> children = root.getChildren(TileGroupsConfig.NODE_GROUP);
        final Collection<CollisionGroup> groups = new ArrayList<>(children.size());

        for (final Xml groupNode : children)
        {
            final String groupName = groupNode.getText();
            final CollisionGroup group = map.getCollisionGroup(groupName);
            groups.add(group);
        }

        final String axisName = root.readString(ATT_AXIS);
        final Axis axis;
        try
        {
            axis = Axis.valueOf(axisName);
        }
        catch (final IllegalArgumentException exception)
        {
            throw new LionEngineException(exception, ERROR_AXIS + axisName);
        }

        final int x = root.readInteger(ATT_X);
        final int y = root.readInteger(ATT_Y);
        final boolean glue = root.readBoolean(true, ATT_GLUE);
        final String name = root.readString(ATT_NAME);

        return new CollisionCategory(name, axis, x, y, glue, groups);
    }
758263
public void removeLayerFromCache(LayerImpl layer) {
		if (layer.getId() != layerId) {
			throw new IllegalStateException();
		}
		LayerCacheImpl layerCache = layerCacheRef.get();
		if (layerCache != null) {
			layerCache.remove(layer.getKey(), layer);
		}
	}
869211
@Override
    protected void createLayers() {
        TileRendererLayer tileRendererLayer = AndroidUtil.createTileRendererLayer(this.tileCaches.get(0),
                this.mapView.getModel().mapViewPosition, getMapFile(), getRenderTheme(), false, true, false);
        this.mapView.getLayerManager().getLayers().add(tileRendererLayer);
    }
944918
function(done) {
    var self = this;
    this.fire('updated');
    this.fire('loading');
    var map = this.options.map;

    this.getTiles(function(urls, err) {
      if(urls) {
        self.tilejson = urls;
        self.setUrl(self.tilejson.tiles[0]);
        // manage interaction
        self._reloadInteraction();
        self.ok && self.ok();
        done && done();
      } else {
        self.error && self.error(err);
        done && done();
      }
    });
  }
1068889
private static boolean containsCollisionFormula(TileCollision tile, CollisionCategory category)
    {
        final Collection<CollisionFormula> formulas = tile.getCollisionFormulas();
        for (final CollisionFormula formula : category.getFormulas())
        {
            if (formulas.contains(formula))
            {
                return true;
            }
        }
        return false;
    }
708452
public void accept(final PainterVisitor visitor, final Object group, final Bbox bounds, boolean recursive) {
		// Draw layer-specific stuff (see VectorLayerPainter)
		visitor.visit(this, group);

		// When visible, take care of fetching through an queryAndSync:
		if (recursive && isShowing()) {
			TileFunction<VectorTile> onDelete = new TileFunction<VectorTile>() {

				// When deleting a tile, delete selected features from the paint !
				public void execute(final VectorTile tile) {
					visitor.remove(tile, group);
				}
			};
			TileFunction<VectorTile> onUpdate = new TileFunction<VectorTile>() {

				// Updating a tile, re-rendering it:
				public void execute(VectorTile tile) {
					tile.accept(visitor, group, bounds, true);
				}
			};
			cache.queryAndSync(bounds, filter, onDelete, onUpdate);
			// also re-render the selected features !
			for (Feature feature : selectedFeatures.values()) {
				visitor.visit(feature, group);
			}

		}
	}
636572
private GeoPackageTile drawTile(TileMatrix tileMatrix,
			TileResultSet tileResults, BoundingBox requestProjectedBoundingBox,
			int tileWidth, int tileHeight) {

		// Draw the resulting bitmap with the matching tiles
		GeoPackageTile geoPackageTile = null;
		Graphics graphics = null;
		while (tileResults.moveToNext()) {

			// Get the next tile
			TileRow tileRow = tileResults.getRow();
			BufferedImage tileDataImage;
			try {
				tileDataImage = tileRow.getTileDataImage();
			} catch (IOException e) {
				throw new GeoPackageException(
						"Failed to read the tile row image data", e);
			}

			// Get the bounding box of the tile
			BoundingBox tileBoundingBox = TileBoundingBoxUtils.getBoundingBox(
					tileSetBoundingBox, tileMatrix, tileRow.getTileColumn(),
					tileRow.getTileRow());

			// Get the bounding box where the requested image and
			// tile overlap
			BoundingBox overlap = requestProjectedBoundingBox
					.overlap(tileBoundingBox);

			// If the tile overlaps with the requested box
			if (overlap != null) {

				// Get the rectangle of the tile image to draw
				ImageRectangle src = TileBoundingBoxJavaUtils.getRectangle(
						tileMatrix.getTileWidth(), tileMatrix.getTileHeight(),
						tileBoundingBox, overlap);

				// Get the rectangle of where to draw the tile in
				// the resulting image
				ImageRectangle dest = TileBoundingBoxJavaUtils.getRectangle(
						tileWidth, tileHeight, requestProjectedBoundingBox,
						overlap);

				if (src.isValid() && dest.isValid()) {

					if (imageFormat != null) {

						// Create the bitmap first time through
						if (geoPackageTile == null) {
							BufferedImage bufferedImage = ImageUtils
									.createBufferedImage(tileWidth, tileHeight,
											imageFormat);
							graphics = bufferedImage.getGraphics();
							geoPackageTile = new GeoPackageTile(tileWidth,
									tileHeight, bufferedImage);
						}

						// Draw the tile to the image
						graphics.drawImage(tileDataImage, dest.getLeft(),
								dest.getTop(), dest.getRight(),
								dest.getBottom(), src.getLeft(), src.getTop(),
								src.getRight(), src.getBottom(), null);
					} else {

						// Verify only one image was found and
						// it lines up perfectly
						if (geoPackageTile != null || !src.equals(dest)) {
							throw new GeoPackageException(
									"Raw image only supported when the images are aligned with the tile format requiring no combining and cropping");
						}

						geoPackageTile = new GeoPackageTile(tileWidth,
								tileHeight, tileRow.getTileData());
					}
				}
			}
		}

		// Check if the entire image is transparent
		if (geoPackageTile != null && geoPackageTile.getImage() != null
				&& ImageUtils.isFullyTransparent(geoPackageTile.getImage())) {
			geoPackageTile = null;
		}

		return geoPackageTile;
	}
25694
private void populateSyncCachedTiles(final MapTileList pList) {
		synchronized (mCachedTiles) {
			pList.ensureCapacity(mCachedTiles.size());
			pList.clear();
			for (final long index : mCachedTiles.keySet()) {
				pList.put(index);
			}
		}
	}
281459
public void onMapViewChanged(MapViewChangedEvent event) {
		for (Layer<?> layer : layers) {
			layer.updateShowing();

			// If the map is resized quickly after a previous resize, tile requests are sent out, but when they come
			// back, the world-to-pan matrix will have altered, and so the tiles are placed at the wrong positions....
			// so we clear the store.
			if (layer instanceof RasterLayer && event.isMapResized()) {
				((RasterLayer) layer).getStore().clear();
			}
		}
	}
823973
private void onCachesCollected() {
      if (isTraceEnabled()) {
         log().tracef("[%s] All caches collected: %s", xid, cacheNames);
      }
      int size = cacheNames.size();
      if (size == 0) {
         //it can happen if all caches either commit or thrown an exception
         sendReply();
         return;
      }

      List<CompletableFuture<Void>> futures = new ArrayList<>(size);
      for (ByteString cacheName : cacheNames) {
         try {
            futures.add(completeCache(cacheName));
         } catch (Throwable t) {
            hasErrors = true;
         }
      }
      CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).thenRun(this::sendReply);
   }
1170841
protected void createLayers2() {
        this.mapView2.getLayerManager()
                .getLayers().add(AndroidUtil.createTileRendererLayer(this.tileCaches.get(1),
                this.mapView2.getModel().mapViewPosition, getMapFile2(),
                getRenderTheme2(), false, true, false));
    }
1014557
public void load(ResourceLocation resourceLocation)
	{
		try
		{
			IResource res = Minecraft.getMinecraft().getResourceManager().getResource(resourceLocation);
			load(res.getInputStream());
		}
		catch (IOException e)
		{
			MalisisCore.log.error("[ObjFileImporter] An error happened while reading the file : {}", resourceLocation, e);
		}

	}
1184681
protected void handleCollision(CmsPositionBean p1, CmsPositionBean p2) {

        CmsPositionBean positionToChange = p1;
        if (p1.getTop() <= p2.getTop()) {
            positionToChange = p2;
        }
        positionToChange.setTop(positionToChange.getTop() + 25);
    }
401646
private static boolean checkCollide(Area area, Collidable other)
    {
        final List<Rectangle> others = other.getCollisionBounds();
        final int size = others.size();
        for (int i = 0; i < size; i++)
        {
            final Area current = others.get(i);
            if (area.intersects(current))
            {
                return true;
            }
        }
        return false;
    }