@Test public void testMapCollisionsByObjectGroup() { QuadTree<CollisionBox> quadTree = new PointQuadTree<CollisionBox>(8, 0f, 0f, tiledMap.getWidth() * tiledMap.getTileWidth(), tiledMap.getHeight() * tiledMap.getTileHeight()); collisionBoxMapper.mapCollisionsByObjectGroup(quadTree, tiledMap, "Objects"); Rectangle area = new Rectangle(0f, 0f, tiledMap.getPixelWidth(), tiledMap.getPixelHeight()); Array<CollisionBox> collisions = quadTree.getElementsWithinArea(area); Assert.assertEquals(3, collisions.size); Assert.assertEquals(288f, collisions.get(0).getX()); Assert.assertEquals(96f, collisions.get(0).getY()); Assert.assertEquals(32f, collisions.get(0).getWidth()); Assert.assertEquals(32f, collisions.get(0).getHeight()); }
public void mapCollisionsByObjectGroup(QuadTree<T> quadTree, TiledMap tiledMap, String groupName) { TiledObjectGroup objectGroup = tiledMap.getObjectGroup(groupName); if (objectGroup == null) { return; } for (TiledObject tiledObject : objectGroup.getObjects()) { T collision = collisionFactory.createCollision(tiledMap, tiledObject); if (collision == null) { continue; } quadTree.add(collision); } }
TiledCollisionMapper { public void mapCollisionsByObjectGroup(QuadTree<T> quadTree, TiledMap tiledMap, String groupName) { TiledObjectGroup objectGroup = tiledMap.getObjectGroup(groupName); if (objectGroup == null) { return; } for (TiledObject tiledObject : objectGroup.getObjects()) { T collision = collisionFactory.createCollision(tiledMap, tiledObject); if (collision == null) { continue; } quadTree.add(collision); } } }
TiledCollisionMapper { public void mapCollisionsByObjectGroup(QuadTree<T> quadTree, TiledMap tiledMap, String groupName) { TiledObjectGroup objectGroup = tiledMap.getObjectGroup(groupName); if (objectGroup == null) { return; } for (TiledObject tiledObject : objectGroup.getObjects()) { T collision = collisionFactory.createCollision(tiledMap, tiledObject); if (collision == null) { continue; } quadTree.add(collision); } } TiledCollisionMapper(TiledCollisionFactory<T> collisionFactory);  TiledCollisionMapper(TiledCollisionFactory<T> collisionFactory, TiledCollisionMerger collisionMerger);  TiledCollisionMapper(TiledCollisionFactory<T> collisionFactory, TiledCollisionMerger collisionMerger,
			TileMergeMode mergeMode); }
TiledCollisionMapper { public void mapCollisionsByObjectGroup(QuadTree<T> quadTree, TiledMap tiledMap, String groupName) { TiledObjectGroup objectGroup = tiledMap.getObjectGroup(groupName); if (objectGroup == null) { return; } for (TiledObject tiledObject : objectGroup.getObjects()) { T collision = collisionFactory.createCollision(tiledMap, tiledObject); if (collision == null) { continue; } quadTree.add(collision); } } 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 mapCollisionsByObjectGroup(QuadTree<T> quadTree, TiledMap tiledMap, String groupName) { TiledObjectGroup objectGroup = tiledMap.getObjectGroup(groupName); if (objectGroup == null) { return; } for (TiledObject tiledObject : objectGroup.getObjects()) { T collision = collisionFactory.createCollision(tiledMap, tiledObject); if (collision == null) { continue; } quadTree.add(collision); } } 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);  }