Class TiledMapTileSet

  • All Implemented Interfaces:
    java.lang.Iterable<TiledMapTile>

    public class TiledMapTileSet
    extends java.lang.Object
    implements java.lang.Iterable<TiledMapTile>
    • Constructor Detail

      • TiledMapTileSet

        public TiledMapTileSet()
        Creates empty tileset
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns:
        tileset's name
      • setName

        public void setName​(java.lang.String name)
        Parameters:
        name - new name for the tileset
      • getProperties

        public MapProperties getProperties()
        Returns:
        tileset's properties set
      • getTile

        public TiledMapTile getTile​(int id)
        Gets the TiledMapTile that has the given id.
        Parameters:
        id - the id of the TiledMapTile to retrieve.
        Returns:
        tile matching id, null if it doesn't exist
      • iterator

        public java.util.Iterator<TiledMapTile> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<TiledMapTile>
        Returns:
        iterator to tiles in this tileset
      • putTile

        public void putTile​(int id,
                            TiledMapTile tile)
        Adds or replaces tile with that id
        Parameters:
        id - the id of the TiledMapTile to add or replace.
        tile - the TiledMapTile to add or replace.
      • removeTile

        public void removeTile​(int id)
        Parameters:
        id - tile's id to be removed
      • size

        public int size()
        Returns:
        the size of this TiledMapTileSet.