All Superinterfaces:
ICustomPropertyProvider
All Known Subinterfaces:
IGroupLayer, IMap
All Known Implementing Classes:
GroupLayer, TmxMap

public interface ILayerList
extends ICustomPropertyProvider
  • 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

      void addLayer​(ILayer layer)
      Adds an ILayer to the Layer list.
      Parameters:
      layer - the layer to be added
    • addLayer

      void addLayer​(int index, ILayer layer)
      Adds an ILayer to the Layer list at the given index.
      Parameters:
      index - the index
      layer - the layer to be added
    • removeLayer

      void removeLayer​(ILayer layer)
      Removes an ILayer from the Layer list.
      Parameters:
      layer - the layer to be removed
    • getMapObjectLayer

      default IMapObjectLayer getMapObjectLayer​(IMapObject mapObject)
      Gets the IMapObjectLayer containing a given IMapObject.
      Parameters:
      mapObject - the map object being searched
      Returns:
      the map object layer containing the map object
    • getMapObjectLayer

      default IMapObjectLayer getMapObjectLayer​(java.lang.String layerName)
    • getMapObjectLayer

      default IMapObjectLayer getMapObjectLayer​(int layerId)
    • removeLayer

      void removeLayer​(int index)
      Removes a layer from the Layer list.
      Parameters:
      index - the index of the layer to be removed
    • getMapObjects

      default java.util.Collection<IMapObject> getMapObjects()
      Gets all map objects in the layer list.
      Returns:
      a Collection of all IMapObjects in the layer list
    • getMapObjects

      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.
      Parameters:
      types - an array of types for which the layer list is searched
      Returns:
      a Collection of IMapObjects matching the given MapObjectTypes
    • getMapObjects

      default java.util.Collection<IMapObject> getMapObjects​(int... mapIDs)
      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 for IMapObjects (and their corresponding Entity). 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

      default IMapObject getMapObject​(int mapId)
      Gets the first IMapObject with the given ID from a layer list.
      Parameters:
      mapId - the map id of the desired IMapObject
      Returns:
      the IMapObject with the given ID
    • removeMapObject

      default void removeMapObject​(int mapId)
      Removes the first IMapObject with the given ID.
      Parameters:
      mapId - the map id of the IMapObject we want to remove
    • getTileLayers

      java.util.List<ITileLayer> getTileLayers()
      Gets the ITileLayers contained in a Layer list.
      Returns:
      a List of all ITileLayers
    • getImageLayers

      java.util.List<IImageLayer> getImageLayers()
      Gets the IImageLayers contained in a Layer list.
      Returns:
      a List of all IImageLayers
    • getGroupLayers

      java.util.List<IGroupLayer> getGroupLayers()
      Gets the IGroupLayers contained in a Layer list.
      Returns:
      a List of all IGroupLayers