Interface ILayerList
- All Superinterfaces:
ICustomPropertyProvider
- All Known Subinterfaces:
IGroupLayer
,IMap
- All Known Implementing Classes:
GroupLayer
,TmxMap
public interface ILayerList
extends ICustomPropertyProvider
Method Summary
Modifier and Type Method Description void
addLayer(int index, ILayer layer)
Adds anILayer
to the Layer list at the given index.void
addLayer(ILayer layer)
Adds anILayer
to the Layer list.java.util.List<IGroupLayer>
getGroupLayers()
Gets theIGroupLayer
s contained in a Layer list.java.util.List<IImageLayer>
getImageLayers()
Gets theIImageLayer
s contained in a Layer list.default IMapObject
getMapObject(int mapId)
Gets the firstIMapObject
with the given ID from a layer list.default IMapObjectLayer
getMapObjectLayer(int layerId)
default IMapObjectLayer
getMapObjectLayer(IMapObject mapObject)
Gets theIMapObjectLayer
containing a givenIMapObject
.default IMapObjectLayer
getMapObjectLayer(java.lang.String layerName)
java.util.List<IMapObjectLayer>
getMapObjectLayers()
Gets all MapObjectLayers in the Layer list.default java.util.Collection<IMapObject>
getMapObjects()
Gets all map objects in the layer list.default java.util.Collection<IMapObject>
getMapObjects(int... mapIDs)
Gets all map objects in the layer list using the map IDs passed as a parameter.default java.util.Collection<IMapObject>
getMapObjects(java.lang.String... types)
Gets all map objects in the layer list that belong to the types passed as a parameter.java.util.List<ILayer>
getRenderLayers()
Gets all render layers in the Layer list.java.util.List<ITileLayer>
getTileLayers()
Gets theITileLayer
s contained in a Layer list.void
removeLayer(int index)
Removes a layer from the Layer list.void
removeLayer(ILayer layer)
Removes anILayer
from the Layer list.default void
removeMapObject(int mapId)
Removes the firstIMapObject
with the given ID.Methods inherited from interface de.gurkenlabs.litiengine.environment.tilemap.ICustomPropertyProvider
getBoolValue, getBoolValue, getByteValue, getByteValue, getColorValue, getColorValue, getCommaSeparatedStringValues, getDoubleValue, getDoubleValue, getEnumValue, getEnumValue, getFileValue, getFileValue, getFloatValue, getFloatValue, getIntValue, getIntValue, getLongValue, getLongValue, getProperties, getProperty, getShortValue, getShortValue, getStringValue, getStringValue, getTypeOfProperty, hasCustomProperty, removeProperty, setProperties, setTypeOfProperty, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue
Method Details
getRenderLayers
java.util.List<ILayer> getRenderLayers()Gets all render layers in the Layer list.- Returns:
- a List of ILayers
getMapObjectLayers
java.util.List<IMapObjectLayer> getMapObjectLayers()Gets all MapObjectLayers in the Layer list.- Returns:
- a List of IMapObjectLayers
addLayer
Adds anILayer
to the Layer list.- Parameters:
layer
- the layer to be added
addLayer
Adds anILayer
to the Layer list at the given index.- Parameters:
index
- the indexlayer
- the layer to be added
removeLayer
Removes anILayer
from the Layer list.- Parameters:
layer
- the layer to be removed
getMapObjectLayer
Gets theIMapObjectLayer
containing a givenIMapObject
.- Parameters:
mapObject
- the map object being searched- Returns:
- the map object layer containing the map object
getMapObjectLayer
getMapObjectLayer
removeLayer
void removeLayer(int index)Removes a layer from the Layer list.- Parameters:
index
- the index of the layer to be removed
getMapObjects
Gets all map objects in the layer list.- Returns:
- a Collection of all IMapObjects in the layer list
getMapObjects
Gets all map objects in the layer list that belong to the types passed as a parameter.- Parameters:
types
- an array of types for which the layer list is searched- Returns:
- a Collection of IMapObjects matching the given MapObjectTypes
getMapObjects
Gets all map objects in the layer list using the map IDs passed as a parameter. Please note that map IDs are intended to be unique identifiers forIMapObject
s (and their correspondingEntity
). This method is just a way of checking for non-unique IDs and re-assigning them before adding entities.- Parameters:
mapIDs
- an array of mapIDs for which the layer list is searched- Returns:
- a Collection of IMapObjects matching the given MapObject IDs
- See Also:
Environment.add(de.gurkenlabs.litiengine.entities.IEntity)
getMapObject
Gets the firstIMapObject
with the given ID from a layer list.- Parameters:
mapId
- the map id of the desiredIMapObject
- Returns:
- the
IMapObject
with the given ID
removeMapObject
default void removeMapObject(int mapId)Removes the firstIMapObject
with the given ID.- Parameters:
mapId
- the map id of theIMapObject
we want to remove
getTileLayers
java.util.List<ITileLayer> getTileLayers()Gets theITileLayer
s contained in a Layer list.- Returns:
- a
List
of allITileLayer
s
getImageLayers
java.util.List<IImageLayer> getImageLayers()Gets theIImageLayer
s contained in a Layer list.- Returns:
- a
List
of allIImageLayer
s
getGroupLayers
java.util.List<IGroupLayer> getGroupLayers()Gets theIGroupLayer
s contained in a Layer list.- Returns:
- a
List
of allIGroupLayer
s