Package com.badlogic.gdx.maps
Class MapLayers
- java.lang.Object
-
- com.badlogic.gdx.maps.MapLayers
-
-
Constructor Summary
Constructors Constructor Description MapLayers()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(MapLayer layer)
MapLayer
get(int index)
MapLayer
get(java.lang.String name)
<T extends MapLayer>
Array<T>getByType(java.lang.Class<T> type)
<T extends MapLayer>
Array<T>getByType(java.lang.Class<T> type, Array<T> fill)
int
getCount()
int
getIndex(MapLayer layer)
Get the index of the layer in the collection, or -1 if no such layer exists.int
getIndex(java.lang.String name)
Get the index of the layer having the specified name, or -1 if no such layer exists.java.util.Iterator<MapLayer>
iterator()
void
remove(int index)
void
remove(MapLayer layer)
int
size()
-
-
-
Method Detail
-
get
public MapLayer get(int index)
- Parameters:
index
-- Returns:
- the MapLayer at the specified index
-
get
public MapLayer get(java.lang.String name)
- Parameters:
name
-- Returns:
- the first layer having the specified name, if one exists, otherwise null
-
getIndex
public int getIndex(java.lang.String name)
Get the index of the layer having the specified name, or -1 if no such layer exists.
-
getIndex
public int getIndex(MapLayer layer)
Get the index of the layer in the collection, or -1 if no such layer exists.
-
getCount
public int getCount()
- Returns:
- number of layers in the collection
-
add
public void add(MapLayer layer)
- Parameters:
layer
- layer to be added to the set
-
remove
public void remove(int index)
- Parameters:
index
- removes layer at index
-
remove
public void remove(MapLayer layer)
- Parameters:
layer
- layer to be removed
-
size
public int size()
- Returns:
- the number of map layers
-
getByType
public <T extends MapLayer> Array<T> getByType(java.lang.Class<T> type)
- Parameters:
type
-- Returns:
- array with all the layers matching type
-
getByType
public <T extends MapLayer> Array<T> getByType(java.lang.Class<T> type, Array<T> fill)
- Parameters:
type
-fill
- array to be filled with the matching layers- Returns:
- array with all the layers matching type
-
-