Interface ILayerList
- All Superinterfaces:
ICustomPropertyProvider
- All Known Subinterfaces:
IGroupLayer,IMap
- All Known Implementing Classes:
GroupLayer,TmxMap
public interface ILayerList
extends ICustomPropertyProviderMethod Summary
Modifier and Type Method Description voidaddLayer(int index, ILayer layer)Adds anILayerto the Layer list at the given index.voidaddLayer(ILayer layer)Adds anILayerto the Layer list.java.util.List<IGroupLayer>getGroupLayers()Gets theIGroupLayers contained in a Layer list.java.util.List<IImageLayer>getImageLayers()Gets theIImageLayers contained in a Layer list.default IMapObjectgetMapObject(int mapId)Gets the firstIMapObjectwith the given ID from a layer list.default IMapObjectLayergetMapObjectLayer(int layerId)default IMapObjectLayergetMapObjectLayer(IMapObject mapObject)Gets theIMapObjectLayercontaining a givenIMapObject.default IMapObjectLayergetMapObjectLayer(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 theITileLayers contained in a Layer list.voidremoveLayer(int index)Removes a layer from the Layer list.voidremoveLayer(ILayer layer)Removes anILayerfrom the Layer list.default voidremoveMapObject(int mapId)Removes the firstIMapObjectwith 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 anILayerto the Layer list.- Parameters:
layer- the layer to be added
addLayer
Adds anILayerto the Layer list at the given index.- Parameters:
index- the indexlayer- the layer to be added
removeLayer
Removes anILayerfrom the Layer list.- Parameters:
layer- the layer to be removed
getMapObjectLayer
Gets theIMapObjectLayercontaining 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 forIMapObjects (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 firstIMapObjectwith the given ID from a layer list.- Parameters:
mapId- the map id of the desiredIMapObject- Returns:
- the
IMapObjectwith the given ID
removeMapObject
default void removeMapObject(int mapId)Removes the firstIMapObjectwith the given ID.- Parameters:
mapId- the map id of theIMapObjectwe want to remove
getTileLayers
java.util.List<ITileLayer> getTileLayers()Gets theITileLayers contained in a Layer list.- Returns:
- a
Listof allITileLayers
getImageLayers
java.util.List<IImageLayer> getImageLayers()Gets theIImageLayers contained in a Layer list.- Returns:
- a
Listof allIImageLayers
getGroupLayers
java.util.List<IGroupLayer> getGroupLayers()Gets theIGroupLayers contained in a Layer list.- Returns:
- a
Listof allIGroupLayers
