Class StendhalMapStructure

java.lang.Object
games.stendhal.common.tiled.StendhalMapStructure

public class StendhalMapStructure extends Object
This is the map format that our client uses.
Author:
miguel
  • Constructor Details

    • StendhalMapStructure

      public StendhalMapStructure(int w, int h)
      Constructor.
      Parameters:
      w - the width of the map
      h - the height of the map.
  • Method Details

    • addTileset

      public void addTileset(TileSetDefinition set)
      Adds a new tileset to the map.
      Parameters:
      set - new tileset
    • addLayer

      public void addLayer(LayerDefinition layer)
      Adds a new layer to the map.
      Parameters:
      layer - new layer
    • getTilesets

      public List<TileSetDefinition> getTilesets()
      Returns a list of the tilesets this map contains.
      Returns:
      a list of the tilesets this map contains.
    • getLayers

      public List<LayerDefinition> getLayers()
      Returns a list of the layers this map contains.
      Returns:
      a list of the layers this map contains.
    • hasLayer

      public boolean hasLayer(String layername)
      Return true if the layer with given name exists.
      Parameters:
      layername - the layer name
      Returns:
      true if it exists.
    • getLayer

      public LayerDefinition getLayer(String layername)
      Returns the layer whose name is layer name or null.
      Parameters:
      layername - the layer name
      Returns:
      the layer object or null if it doesnt' exists
    • build

      public void build()
      Build all layers data.
    • getWidth

      public int getWidth()
      gets the width
      Returns:
      width
    • getHeight

      public int getHeight()
      gets the height
      Returns:
      height