APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.maps

public Class MapLayers

extends Object
implements Iterable<MapLayer>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable
Imports
java.util.Iterator, com.badlogic.gdx.utils.Array, com.badlogic.gdx.utils.reflect.ClassReflection

Ordered list of MapLayer instances owned by a Map

Field Summary

Modifier and TypeField and Description
private Array<MapLayer>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(MapLayer
layer to be added to the set
layer
)

public MapLayer
get(int index)

Returns: the MapLayer at the specified index

public MapLayer
get(String name)

Returns: the first layer having the specified name, if one exists, otherwise null

public <T extends MapLayer> Array<T>
getByType(Class<T> type)

Returns: array with all the layers matching type

public <T extends MapLayer> Array<T>
getByType(Class<T> type, Array<T>
array to be filled with the matching layers
fill
)

Returns: array with all the layers matching type

public int
getCount()

Returns: number of layers in the collection

public int
getIndex(String name)

Get the index of the layer having the specified name, or -1 if no such layer exists.

public int
getIndex(MapLayer layer)

Get the index of the layer in the collection, or -1 if no such layer exists.

public Iterator<MapLayer>

Returns:

iterator to set of layers
iterator
()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

public void
remove(int
removes layer at index
index
)

public void
remove(MapLayer
layer to be removed
layer
)

public int
size()

Returns: the number of map layers

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

layersback to summary
private Array<MapLayer> layers

Constructor Detail

MapLayersback to summary
public MapLayers()

Method Detail

addback to summary
public void add(MapLayer layer)
Parameters
layer:MapLayer

layer to be added to the set

getback to summary
public MapLayer get(int index)
Returns:MapLayer

the MapLayer at the specified index

getback to summary
public MapLayer get(String name)
Returns:MapLayer

the first layer having the specified name, if one exists, otherwise null

getByTypeback to summary
public <T extends MapLayer> Array<T> getByType(Class<T> type)
Returns:Array<T>

array with all the layers matching type

getByTypeback to summary
public <T extends MapLayer> Array<T> getByType(Class<T> type, Array<T> fill)
Parameters
fill:Array<T>

array to be filled with the matching layers

Returns:Array<T>

array with all the layers matching type

getCountback to summary
public int getCount()
Returns:int

number of layers in the collection

getIndexback to summary
public int getIndex(String name)

Get the index of the layer having the specified name, or -1 if no such layer exists.

getIndexback to summary
public int getIndex(MapLayer layer)

Get the index of the layer in the collection, or -1 if no such layer exists.

iteratorback to summary
public Iterator<MapLayer> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<MapLayer>

iterator to set of layers

Annotations
@Override
removeback to summary
public void remove(int index)
Parameters
index:int

removes layer at index

removeback to summary
public void remove(MapLayer layer)
Parameters
layer:MapLayer

layer to be removed

sizeback to summary
public int size()
Returns:int

the number of map layers