All Implemented Interfaces:
ICustomPropertyProvider, ILayer, ITileLayer

public class TileLayer
extends Layer
implements ITileLayer
  • Constructor Details

    • TileLayer

      public TileLayer()
      Instantiates a new TileLayer instance.
    • TileLayer

      public TileLayer​(TileData data)
      Instantiates a new TileLayer instance with the specified data.
      Parameters:
      data - The tile data of this instance.
  • Method Details

    • getTileByLocation

      public ITile getTileByLocation​(java.awt.geom.Point2D location)
      Description copied from interface: ITileLayer
      Gets the tile by location.
      Specified by:
      getTileByLocation in interface ITileLayer
      Parameters:
      location - the location
      Returns:
      the tile by location
    • getTile

      public ITile getTile​(int x, int y)
      Description copied from interface: ITileLayer
      Gets the tile at the specified map grid location.

      To retrieve map grid coordinates from a location on the map, use the MapUtilities#getTile(Point2D) method.

      Specified by:
      getTile in interface ITileLayer
      Parameters:
      x - The x-coordinate (on the map grid) to retrieve the tile.
      y - The y-coordinate (on the map grid) to retrieve the tile.
      Returns:
      The tile at the specified grid location.
      See Also:
      MapUtilities.getTile(Point2D)
    • setTile

      public void setTile​(int x, int y, ITile tile)
      Description copied from interface: ITileLayer
      Sets the id of the tile at the specified map grid location.
      Specified by:
      setTile in interface ITileLayer
      Parameters:
      x - The x-coordinate (on the map grid).
      y - The y-coordinate (on the map grid).
      tile - The tile that provides the tile id to be set on the tile at the specified location.
      See Also:
      ITile.getGridId()
    • setTile

      public void setTile​(int x, int y, int gid)
      Description copied from interface: ITileLayer
      Sets the id of the tile at the specified map grid location.
      Specified by:
      setTile in interface ITileLayer
      Parameters:
      x - The x-coordinate (on the map grid).
      y - The y-coordinate (on the map grid).
      gid - The id to be set on the tile at the specified location.
    • getTiles

      public java.util.List<ITile> getTiles()
      Description copied from interface: ITileLayer
      Gets the tiles.
      Specified by:
      getTiles in interface ITileLayer
      Returns:
      the tiles
    • getWidth

      public int getWidth()
      Description copied from class: Layer
      Gets the width.
      Specified by:
      getWidth in interface ILayer
      Overrides:
      getWidth in class Layer
      Returns:
      the width
    • getHeight

      public int getHeight()
      Description copied from class: Layer
      Gets the height.
      Specified by:
      getHeight in interface ILayer
      Overrides:
      getHeight in class Layer
      Returns:
      the height
    • getData

      protected java.util.List<Tile> getData()
    • getRawTileData

      protected TileData getRawTileData()