Package games.stendhal.common.tiled
Class StendhalMapStructure
java.lang.Object
games.stendhal.common.tiled.StendhalMapStructure
This is the map format that our client uses.
- Author:
- miguel
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addLayer(LayerDefinition layer)
Adds a new layer to the map.void
addTileset(TileSetDefinition set)
Adds a new tileset to the map.void
build()
Build all layers data.int
gets the heightReturns the layer whose name is layer name or null.Returns a list of the layers this map contains.Returns a list of the tilesets this map contains.int
getWidth()
gets the widthboolean
Return true if the layer with given name exists.
-
Constructor Details
-
StendhalMapStructure
public StendhalMapStructure(int w, int h)Constructor.- Parameters:
w
- the width of the maph
- the height of the map.
-
-
Method Details
-
addTileset
Adds a new tileset to the map.- Parameters:
set
- new tileset
-
addLayer
Adds a new layer to the map.- Parameters:
layer
- new layer
-
getTilesets
Returns a list of the tilesets this map contains.- Returns:
- a list of the tilesets this map contains.
-
getLayers
Returns a list of the layers this map contains.- Returns:
- a list of the layers this map contains.
-
hasLayer
Return true if the layer with given name exists.- Parameters:
layername
- the layer name- Returns:
- true if it exists.
-
getLayer
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
-