public class TiledCollisionMapper<T extends Positionable>
extends java.lang.Object
TiledMap
data into collision data.Constructor and Description |
---|
TiledCollisionMapper(TiledCollisionFactory<T> collisionFactory)
Creates a
TiledCollisionMapper with a TileIdCollisionMerger
instance for merge operations |
TiledCollisionMapper(TiledCollisionFactory<T> collisionFactory,
TiledCollisionMerger collisionMerger)
Creates a
TiledCollisionMapper with a specifc
TiledCollisionMerger implementation for merge operations |
TiledCollisionMapper(TiledCollisionFactory<T> collisionFactory,
TiledCollisionMerger collisionMerger,
TileMergeMode mergeMode)
Creates a
TiledCollisionMapper with a specifc
TiledCollisionMerger implementation for merge operations |
Modifier and Type | Method and Description |
---|---|
void |
mapAndMergeCollisionsByLayer(java.util.List<T> results,
TiledMap tiledMap,
int layerIndex)
Extracts and merges collisions in a
TiledMap layer and adds them to a
List instance. |
void |
mapAndMergeCollisionsByLayer(java.util.List<T> results,
TiledMap tiledMap,
int layerIndex,
int maxColumns,
int maxRows)
Extracts and merges collisions in a
TiledMap layer and adds them to a
List instance. |
void |
mapAndMergeCollisionsByLayer(java.util.List<T> results,
TiledMap tiledMap,
java.lang.String layerName)
Extracts and merges collisions in a
TiledMap layer and adds them to a
List instance. |
void |
mapAndMergeCollisionsByLayer(QuadTree<T> quadTree,
TiledMap tiledMap,
int layerIndex)
|
void |
mapAndMergeCollisionsByLayer(QuadTree<T> quadTree,
TiledMap tiledMap,
int layerIndex,
int maxColumns,
int maxRows)
|
void |
mapAndMergeCollisionsByLayer(QuadTree<T> quadTree,
TiledMap tiledMap,
java.lang.String layerName)
|
void |
mapAndMergeEmptySpacesByLayer(java.util.List<T> results,
TiledMap tiledMap,
int layerIndex)
Extracts and merges empty spaces in a
TiledMap layer and adds them to
a List instance. |
void |
mapAndMergeEmptySpacesByLayer(java.util.List<T> results,
TiledMap tiledMap,
int layerIndex,
int maxColumns,
int maxRows)
Extracts and merges empty spaces in a
TiledMap layer and adds them to
a List instance. |
void |
mapAndMergeEmptySpacesByLayer(java.util.List<T> results,
TiledMap tiledMap,
java.lang.String layerName)
Extracts and merges empty spaces in a
TiledMap layer and adds them to
a List instance. |
void |
mapAndMergeEmptySpacesByLayer(QuadTree<T> quadTree,
TiledMap tiledMap,
int layerIndex)
|
void |
mapAndMergeEmptySpacesByLayer(QuadTree<T> quadTree,
TiledMap tiledMap,
int layerIndex,
int maxColumns,
int maxRows)
|
void |
mapAndMergeEmptySpacesByLayer(QuadTree<T> quadTree,
TiledMap tiledMap,
java.lang.String layerName)
|
void |
mapCollisionsByLayer(java.util.List<T> results,
TiledMap tiledMap,
int layerIndex)
Extracts collisions in a
TiledMap layer and adds them to a
List instance |
void |
mapCollisionsByLayer(java.util.List<T> results,
TiledMap tiledMap,
java.lang.String layerName)
Extracts collisions in a
TiledMap layer and adds them to a
List instance |
void |
mapCollisionsByLayer(QuadTree<T> quadTree,
TiledMap tiledMap,
int layerIndex)
|
void |
mapCollisionsByLayer(QuadTree<T> quadTree,
TiledMap tiledMap,
java.lang.String layerName)
|
static byte[][] |
mapCollisionsByLayer(TiledMap tiledMap,
int layerIndex)
Creates a 2D byte array representing the collisions in a
TiledMap
layer |
static byte[][] |
mapCollisionsByLayer(TiledMap tiledMap,
java.lang.String layerName)
Creates a 2D byte array representing the collisions in a
TiledMap
layer |
void |
mapCollisionsByObjectGroup(java.util.List<T> results,
TiledMap tiledMap,
java.lang.String groupName)
Extracts collisions in a
TiledMap object group and adds them to a
List instance |
void |
mapCollisionsByObjectGroup(java.util.List<T> results,
TiledMap tiledMap,
java.lang.String groupName,
java.lang.String objectType)
Extracts collisions in a
TiledMap object group that have a specific
value in their type field and adds them to a List instance |
void |
mapCollisionsByObjectGroup(QuadTree<T> quadTree,
TiledMap tiledMap,
java.lang.String groupName)
|
void |
mapCollisionsByObjectGroup(QuadTree<T> quadTree,
TiledMap tiledMap,
java.lang.String groupName,
java.lang.String objectType)
|
void |
mapEmptySpacesByLayer(java.util.List<T> results,
TiledMap tiledMap,
int layerIndex)
Extracts empty spaces in a
TiledMap layer and adds them to a
List instance |
void |
mapEmptySpacesByLayer(java.util.List<T> results,
TiledMap tiledMap,
java.lang.String layerName)
Extracts empty spaces in a
TiledMap layer and adds them to a
List instance |
void |
mapEmptySpacesByLayer(QuadTree<T> quadTree,
TiledMap tiledMap,
int layerIndex)
|
void |
mapEmptySpacesByLayer(QuadTree<T> quadTree,
TiledMap tiledMap,
java.lang.String layerName)
|
static byte[][] |
mapEmptySpacesByLayer(TiledMap tiledMap,
int layerIndex)
Creates a 2D byte array representing the empty spaces (non-collisions) in a
TiledMap layer |
static byte[][] |
mapEmptySpacesByLayer(TiledMap tiledMap,
java.lang.String layerName)
Creates a 2D byte array representing the empty spaces (non-collisions) in a
TiledMap layer |
public TiledCollisionMapper(TiledCollisionFactory<T> collisionFactory)
TiledCollisionMapper
with a TileIdCollisionMerger
instance for merge operationscollisionFactory
- An implementation of TiledCollisionFactory
for creating
collision instancespublic TiledCollisionMapper(TiledCollisionFactory<T> collisionFactory, TiledCollisionMerger collisionMerger)
TiledCollisionMapper
with a specifc
TiledCollisionMerger
implementation for merge operationscollisionFactory
- An implementation of TiledCollisionFactory
for creating
collision instancescollisionMerger
- An implementation of TiledCollisionMerger
for determining
if two tiles can be merged into a single collisionpublic TiledCollisionMapper(TiledCollisionFactory<T> collisionFactory, TiledCollisionMerger collisionMerger, TileMergeMode mergeMode)
TiledCollisionMapper
with a specifc
TiledCollisionMerger
implementation for merge operationscollisionFactory
- An implementation of TiledCollisionFactory
for creating
collision instancescollisionMerger
- An implementation of TiledCollisionMerger
for determining
if two tiles can be merged into a single collisionmergeMode
- The TileMergeMode
to use for searching mergable tilespublic static byte[][] mapCollisionsByLayer(TiledMap tiledMap, java.lang.String layerName)
TiledMap
layertiledMap
- The TiledMap
to extract collisions fromlayerName
- The name of the layer to extract collisions from. Each tile drawn
in the layer is treated as a collision.public static byte[][] mapCollisionsByLayer(TiledMap tiledMap, int layerIndex)
TiledMap
layertiledMap
- The TiledMap
to extract collisions fromlayerIndex
- The index of the layer to extract collisions from. Each tile drawn
in the layer is treated as a collision.public static byte[][] mapEmptySpacesByLayer(TiledMap tiledMap, java.lang.String layerName)
TiledMap
layertiledMap
- The TiledMap
to extract empty spaces fromlayerName
- The name of the layer to extract empty spaces from. Each tile
drawn in the layer is treated as a collision.public static byte[][] mapEmptySpacesByLayer(TiledMap tiledMap, int layerIndex)
TiledMap
layertiledMap
- The TiledMap
to extract empty spaces fromlayerIndex
- The index of the layer to extract empty spaces from. Each tile
drawn in the layer is treated as a collision.public void mapCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, int layerIndex)
public void mapEmptySpacesByLayer(QuadTree<T> quadTree, TiledMap tiledMap, int layerIndex)
public void mapCollisionsByLayer(java.util.List<T> results, TiledMap tiledMap, int layerIndex)
TiledMap
layer and adds them to a
List
instanceresults
- The List
instance to add collisions totiledMap
- The TiledMap
to extract collisions fromlayerIndex
- The index of the layer to extract collisions from. Each tile drawn
in the layer is treated as a collision.public void mapEmptySpacesByLayer(java.util.List<T> results, TiledMap tiledMap, int layerIndex)
TiledMap
layer and adds them to a
List
instanceresults
- The List
instance to add empty spaces totiledMap
- The TiledMap
to extract empty spaces fromlayerIndex
- The index of the layer to extract empty spaces from. Each tile
drawn in the layer is treated as a collision.public void mapCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, java.lang.String layerName)
public void mapCollisionsByLayer(java.util.List<T> results, TiledMap tiledMap, java.lang.String layerName)
TiledMap
layer and adds them to a
List
instanceresults
- The List
instance to add collisions totiledMap
- The TiledMap
to extract collisions fromlayerName
- The name of the layer to extract collisions from. Each tile drawn
in the layer is treated as a collision.public void mapEmptySpacesByLayer(QuadTree<T> quadTree, TiledMap tiledMap, java.lang.String layerName)
public void mapEmptySpacesByLayer(java.util.List<T> results, TiledMap tiledMap, java.lang.String layerName)
TiledMap
layer and adds them to a
List
instanceresults
- The List
instance to add empty spaces totiledMap
- The TiledMap
to extract empty spaces fromlayerName
- The name of the layer to extract empty spaces from. Each tile
drawn in the layer is treated as a collision.public void mapCollisionsByObjectGroup(QuadTree<T> quadTree, TiledMap tiledMap, java.lang.String groupName)
public void mapCollisionsByObjectGroup(QuadTree<T> quadTree, TiledMap tiledMap, java.lang.String groupName, java.lang.String objectType)
public void mapCollisionsByObjectGroup(java.util.List<T> results, TiledMap tiledMap, java.lang.String groupName)
TiledMap
object group and adds them to a
List
instanceresults
- The List
instance to add collisions totiledMap
- The TiledMap
to extract collisions fromgroupName
- The name of the object group to extract collisions from. Each
object is treated as a collision.public void mapCollisionsByObjectGroup(java.util.List<T> results, TiledMap tiledMap, java.lang.String groupName, java.lang.String objectType)
TiledMap
object group that have a specific
value in their type field and adds them to a List
instanceresults
- The List
instance to add collisions totiledMap
- The TiledMap
to extract collisions fromgroupName
- The name of the object group to extract collisions from. Each
object is treated as a collision.objectType
- The object type to extractpublic void mapAndMergeCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, java.lang.String layerName)
TiledMap
layer and adds them to a
QuadTree
instance. Tiles are determined as mergeable by the
TiledCollisionMerger
instance associated with this
TiledCollisionMapper
.public void mapAndMergeCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, int layerIndex)
TiledMap
layer and adds them to a
QuadTree
instance. Tiles are determined as mergeable by the
TiledCollisionMerger
instance associated with this
TiledCollisionMapper
.public void mapAndMergeCollisionsByLayer(QuadTree<T> quadTree, TiledMap tiledMap, int layerIndex, int maxColumns, int maxRows)
TiledMap
layer and adds them to a
QuadTree
instance. Tiles are determined as mergeable by the
TiledCollisionMerger
instance associated with this
TiledCollisionMapper
.quadTree
- The QuadTree
instance to add collisions totiledMap
- The TiledMap
to extract collisions fromlayerIndex
- The index of the layer to extract collisions from. Each tile drawn
in the layer is treated as a collision.maxColumns
- The maximum number of columns to mergemaxRows
- The maximum number of rows to mergepublic void mapAndMergeEmptySpacesByLayer(QuadTree<T> quadTree, TiledMap tiledMap, java.lang.String layerName)
TiledMap
layer and adds them to
a QuadTree
instance. Tiles are determined as mergeable by the
TiledCollisionMerger
instance associated with this
TiledCollisionMapper
.public void mapAndMergeEmptySpacesByLayer(QuadTree<T> quadTree, TiledMap tiledMap, int layerIndex)
TiledMap
layer and adds them to
a QuadTree
instance. Tiles are determined as mergeable by the
TiledCollisionMerger
instance associated with this
TiledCollisionMapper
.public void mapAndMergeEmptySpacesByLayer(QuadTree<T> quadTree, TiledMap tiledMap, int layerIndex, int maxColumns, int maxRows)
TiledMap
layer and adds them to
a QuadTree
instance. Tiles are determined as mergeable by the
TiledCollisionMerger
instance associated with this
TiledCollisionMapper
.quadTree
- The QuadTree
instance to add empty spaces totiledMap
- The TiledMap
to extract empty spaces fromlayerIndex
- The index of the layer to extract empty spaces from. Each tile
drawn in the layer is treated as a collision.maxColumns
- The maximum number of columns to mergemaxRows
- The maximum number of rows to mergepublic void mapAndMergeCollisionsByLayer(java.util.List<T> results, TiledMap tiledMap, java.lang.String layerName)
TiledMap
layer and adds them to a
List
instance. Tiles are determined as mergeable by the
TiledCollisionMerger
instance associated with this
TiledCollisionMapper
.results
- The List
instance to add collisions totiledMap
- The TiledMap
to extract collisions fromlayerName
- The name of the layer to extract collisions from. Each tile drawn
in the layer is treated as a collision.public void mapAndMergeCollisionsByLayer(java.util.List<T> results, TiledMap tiledMap, int layerIndex)
TiledMap
layer and adds them to a
List
instance. Tiles are determined as mergeable by the
TiledCollisionMerger
instance associated with this
TiledCollisionMapper
.results
- The List
instance to add collisions totiledMap
- The TiledMap
to extract collisions fromlayerIndex
- The index of the layer to extract collisions from. Each tile drawn
in the layer is treated as a collision.public void mapAndMergeCollisionsByLayer(java.util.List<T> results, TiledMap tiledMap, int layerIndex, int maxColumns, int maxRows)
TiledMap
layer and adds them to a
List
instance. Tiles are determined as mergeable by the
TiledCollisionMerger
instance associated with this
TiledCollisionMapper
.results
- The List
instance to add collisions totiledMap
- The TiledMap
to extract collisions fromlayerIndex
- The index of the layer to extract collisions from. Each tile drawn
in the layer is treated as a collision.maxColumns
- The maximum number of columns to mergemaxRows
- The maximum number of rows to mergepublic void mapAndMergeEmptySpacesByLayer(java.util.List<T> results, TiledMap tiledMap, java.lang.String layerName)
TiledMap
layer and adds them to
a List
instance. Tiles are determined as mergeable by the
TiledCollisionMerger
instance associated with this
TiledCollisionMapper
.results
- The List
instance to add empty spaces totiledMap
- The TiledMap
to extract empty spaces fromlayerName
- The name of the layer to extract empty spaces from. Each tile
drawn in the layer is treated as a collision.public void mapAndMergeEmptySpacesByLayer(java.util.List<T> results, TiledMap tiledMap, int layerIndex)
TiledMap
layer and adds them to
a List
instance. Tiles are determined as mergeable by the
TiledCollisionMerger
instance associated with this
TiledCollisionMapper
.results
- The List
instance to add empty spaces totiledMap
- The TiledMap
to extract empty spaces fromlayerIndex
- The index of the layer to extract empty spaces from. Each tile
drawn in the layer is treated as a collision.public void mapAndMergeEmptySpacesByLayer(java.util.List<T> results, TiledMap tiledMap, int layerIndex, int maxColumns, int maxRows)
TiledMap
layer and adds them to
a List
instance. Tiles are determined as mergeable by the
TiledCollisionMerger
instance associated with this
TiledCollisionMapper
.results
- The List
instance to add empty spaces totiledMap
- The TiledMap
to extract empty spaces fromlayerIndex
- The index of the layer to extract empty spaces from. Each tile
drawn in the layer is treated as a collision.maxColumns
- The maximum number of columns to mergemaxRows
- The maximum number of rows to merge