@Test public void testMapAndMergeCollisionsByLayer() { int collisionLayerIndex = tiledMap.getLayerIndex("Collisions"); RegionQuadTree<CollisionBox> quadTree = new RegionQuadTree<CollisionBox>(8, 0f, 0f, tiledMap.getWidth() * tiledMap.getTileWidth(), tiledMap.getHeight() * tiledMap.getTileHeight()); collisionBoxMapper.mapAndMergeCollisionsByLayer(quadTree, tiledMap, collisionLayerIndex); Array<CollisionBox> collisions = quadTree.getElementsWithinArea(quadTree); Assert.assertEquals(4, collisions.size); CollisionBox collision = getCollisionAt(1, 5, quadTree, tiledMap); Assert.assertEquals(tiledMap.getTileWidth() * 2f, collision.getWidth()); Assert.assertEquals(tiledMap.getTileHeight() * 2f, collision.getHeight()); collision = getCollisionAt(5, 4, quadTree, tiledMap); Assert.assertEquals(tiledMap.getTileWidth() * 1f, collision.getWidth()); Assert.assertEquals(tiledMap.getTileHeight() * 1f, collision.getHeight()); collision = getCollisionAt(6, 3, quadTree, tiledMap); Assert.assertEquals(tiledMap.getTileWidth() * 1f, collision.getWidth()); Assert.assertEquals(tiledMap.getTileHeight() * 1f, collision.getHeight()); }
public void mapAndMergeCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, String layerName) { mapAndMergeCollisionsByLayer(quadTree, tiledMap, tiledMap.getLayerIndex(layerName)); }
TiledCollisionMapper { public void mapAndMergeCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, String layerName) { mapAndMergeCollisionsByLayer(quadTree, tiledMap, tiledMap.getLayerIndex(layerName)); } }
TiledCollisionMapper { public void mapAndMergeCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, String layerName) { mapAndMergeCollisionsByLayer(quadTree, tiledMap, tiledMap.getLayerIndex(layerName)); } TiledCollisionMapper(TiledCollisionFactory<T> collisionFactory);  TiledCollisionMapper(TiledCollisionFactory<T> collisionFactory, TiledCollisionMerger collisionMerger);  TiledCollisionMapper(TiledCollisionFactory<T> collisionFactory, TiledCollisionMerger collisionMerger,
			TileMergeMode mergeMode); }
TiledCollisionMapper { public void mapAndMergeCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, String layerName) { mapAndMergeCollisionsByLayer(quadTree, tiledMap, tiledMap.getLayerIndex(layerName)); } TiledCollisionMapper(TiledCollisionFactory<T> collisionFactory);  TiledCollisionMapper(TiledCollisionFactory<T> collisionFactory, TiledCollisionMerger collisionMerger);  TiledCollisionMapper(TiledCollisionFactory<T> collisionFactory, TiledCollisionMerger collisionMerger,
			TileMergeMode mergeMode); static byte[][] mapCollisionsByLayer(TiledMap tiledMap, String layerName); static byte[][] mapCollisionsByLayer(TiledMap tiledMap, int layerIndex); static byte[][] mapCollisionsByLayer(TiledMap tiledMap, TileLayer layer); static byte[][] mapEmptySpacesByLayer(TiledMap tiledMap, String layerName); static byte[][] mapEmptySpacesByLayer(TiledMap tiledMap, int layerIndex); void mapCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, int layerIndex); void mapEmptySpacesByLayer(QuadTree<T> quadTree, TiledMap tiledMap, int layerIndex); void mapCollisionsByLayer(Array<T> results, TiledMap tiledMap, int layerIndex); void mapEmptySpacesByLayer(Array<T> results, TiledMap tiledMap, int layerIndex); void mapCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, String layerName); void mapCollisionsByLayer(Array<T> results, TiledMap tiledMap, String layerName); void mapEmptySpacesByLayer(QuadTree<T> quadTree, TiledMap tiledMap, String layerName); void mapEmptySpacesByLayer(Array<T> results, TiledMap tiledMap, String layerName); void mapCollisionsByObjectGroup(QuadTree<T> quadTree, TiledMap tiledMap, String groupName); void mapCollisionsByObjectGroup(QuadTree<T> quadTree, TiledMap tiledMap, String groupName,
			String objectType); void mapCollisionsByObjectGroup(Array<T> results, TiledMap tiledMap, String groupName); void mapCollisionsByObjectGroup(Array<T> results, TiledMap tiledMap, String groupName, String objectType); void mapAndMergeCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, String layerName); void mapAndMergeCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, int layerIndex); void mapAndMergeCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, final int layerIndex,
			final int maxColumns, final int maxRows); void mapAndMergeEmptySpacesByLayer(QuadTree<T> quadTree, TiledMap tiledMap, String layerName); void mapAndMergeEmptySpacesByLayer(QuadTree<T> quadTree, TiledMap tiledMap, int layerIndex); void mapAndMergeEmptySpacesByLayer(QuadTree<T> quadTree, TiledMap tiledMap, final int layerIndex,
			final int maxColumns, final int maxRows); void mapAndMergeCollisionsByLayer(Array<T> results, TiledMap tiledMap, String layerName); void mapAndMergeCollisionsByLayer(Array<T> results, TiledMap tiledMap, int layerIndex); void mapAndMergeCollisionsByLayer(Array<T> results, TiledMap tiledMap, final int layerIndex,
			final int maxColumns, final int maxRows); void mapAndMergeEmptySpacesByLayer(Array<T> results, TiledMap tiledMap, String layerName); void mapAndMergeEmptySpacesByLayer(Array<T> results, TiledMap tiledMap, int layerIndex); void mapAndMergeEmptySpacesByLayer(Array<T> results, TiledMap tiledMap, final int layerIndex,
			final int maxColumns, final int maxRows); }
TiledCollisionMapper { public void mapAndMergeCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, String layerName) { mapAndMergeCollisionsByLayer(quadTree, tiledMap, tiledMap.getLayerIndex(layerName)); } TiledCollisionMapper(TiledCollisionFactory<T> collisionFactory);  TiledCollisionMapper(TiledCollisionFactory<T> collisionFactory, TiledCollisionMerger collisionMerger);  TiledCollisionMapper(TiledCollisionFactory<T> collisionFactory, TiledCollisionMerger collisionMerger,
			TileMergeMode mergeMode); static byte[][] mapCollisionsByLayer(TiledMap tiledMap, String layerName); static byte[][] mapCollisionsByLayer(TiledMap tiledMap, int layerIndex); static byte[][] mapCollisionsByLayer(TiledMap tiledMap, TileLayer layer); static byte[][] mapEmptySpacesByLayer(TiledMap tiledMap, String layerName); static byte[][] mapEmptySpacesByLayer(TiledMap tiledMap, int layerIndex); void mapCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, int layerIndex); void mapEmptySpacesByLayer(QuadTree<T> quadTree, TiledMap tiledMap, int layerIndex); void mapCollisionsByLayer(Array<T> results, TiledMap tiledMap, int layerIndex); void mapEmptySpacesByLayer(Array<T> results, TiledMap tiledMap, int layerIndex); void mapCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, String layerName); void mapCollisionsByLayer(Array<T> results, TiledMap tiledMap, String layerName); void mapEmptySpacesByLayer(QuadTree<T> quadTree, TiledMap tiledMap, String layerName); void mapEmptySpacesByLayer(Array<T> results, TiledMap tiledMap, String layerName); void mapCollisionsByObjectGroup(QuadTree<T> quadTree, TiledMap tiledMap, String groupName); void mapCollisionsByObjectGroup(QuadTree<T> quadTree, TiledMap tiledMap, String groupName,
			String objectType); void mapCollisionsByObjectGroup(Array<T> results, TiledMap tiledMap, String groupName); void mapCollisionsByObjectGroup(Array<T> results, TiledMap tiledMap, String groupName, String objectType); void mapAndMergeCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, String layerName); void mapAndMergeCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, int layerIndex); void mapAndMergeCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, final int layerIndex,
			final int maxColumns, final int maxRows); void mapAndMergeEmptySpacesByLayer(QuadTree<T> quadTree, TiledMap tiledMap, String layerName); void mapAndMergeEmptySpacesByLayer(QuadTree<T> quadTree, TiledMap tiledMap, int layerIndex); void mapAndMergeEmptySpacesByLayer(QuadTree<T> quadTree, TiledMap tiledMap, final int layerIndex,
			final int maxColumns, final int maxRows); void mapAndMergeCollisionsByLayer(Array<T> results, TiledMap tiledMap, String layerName); void mapAndMergeCollisionsByLayer(Array<T> results, TiledMap tiledMap, int layerIndex); void mapAndMergeCollisionsByLayer(Array<T> results, TiledMap tiledMap, final int layerIndex,
			final int maxColumns, final int maxRows); void mapAndMergeEmptySpacesByLayer(Array<T> results, TiledMap tiledMap, String layerName); void mapAndMergeEmptySpacesByLayer(Array<T> results, TiledMap tiledMap, int layerIndex); void mapAndMergeEmptySpacesByLayer(Array<T> results, TiledMap tiledMap, final int layerIndex,
			final int maxColumns, final int maxRows);  }