Class TileSetDefinition

java.lang.Object
games.stendhal.common.tiled.TileSetDefinition
All Implemented Interfaces:
Serializable

public class TileSetDefinition extends Object implements Serializable
Stores a definition of a tileset. Mainly its name, the source image used and the starting global id.
Author:
miguel
  • Constructor Details

    • TileSetDefinition

      public TileSetDefinition(String name, String source, int firstGid)
      Constructor.
      Parameters:
      name - the *useless* name of the tileset.
      source - the image filename
      firstGid - the id where this tileset begins to number tiles.
  • Method Details

    • getFirstGid

      public int getFirstGid()
      Returns the id where this tileset begins to number tiles.
      Returns:
      the id where this tileset begins to number tiles
    • setSource

      public void setSource(String attributeValue)
      Set the filename of the source image of the tileset.
      Parameters:
      attributeValue - the filename
    • getSource

      public String getSource()
      Returns the filename of the source image of the tileset.
      Returns:
      the filename of the source image of the tileset.
    • encode

      public byte[] encode() throws IOException
      Throws:
      IOException
    • readObject

      public void readObject(InputSerializer in) throws IOException
      Description copied from interface: Serializable
      Method to build the object from a stream of bytes
      Specified by:
      readObject in interface Serializable
      Parameters:
      in - InputSerializer to read from
      Throws:
      IOException - in case of an IO-error
    • writeObject

      public void writeObject(OutputSerializer out) throws IOException
      Description copied from interface: Serializable
      Method to convert the object into a stream
      Specified by:
      writeObject in interface Serializable
      Parameters:
      out - OutputSerializer to write the object to
      Throws:
      IOException - in case of an IO-error
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object