Class TmxMap
java.lang.Object
de.gurkenlabs.litiengine.environment.tilemap.xml.CustomPropertyProvider
de.gurkenlabs.litiengine.environment.tilemap.xml.TmxMap
- All Implemented Interfaces:
ICustomPropertyProvider
,ILayerList
,IMap
,java.lang.Comparable<IMap>
public final class TmxMap
extends CustomPropertyProvider
implements IMap
Field Summary
Fields Modifier and Type Field Description static java.lang.String
FILE_EXTENSION
static int
MAX_MAJOR
static int
MAX_MINOR
Constructor Summary
Constructors Constructor Description TmxMap()
TmxMap(IMapOrientation orientation)
Method Summary
Modifier and Type Method Description void
addLayer(int index, ILayer layer)
Adds anILayer
to the Layer list at the given index.void
addLayer(ILayer layer)
Adds anILayer
to the Layer list.boolean
equals(java.lang.Object anObject)
void
finish(java.net.URL location)
java.awt.Color
getBackgroundColor()
java.awt.geom.Rectangle2D
getBounds()
protected int
getChunkOffsetX()
protected int
getChunkOffsetY()
java.util.List<Tileset>
getExternalTilesets()
java.util.List<IGroupLayer>
getGroupLayers()
Gets theIGroupLayer
s contained in a Layer list.int
getHeight()
Gets the map height in tiles.int
getHexSideLength()
Gets the straight edges' length for hexagonal maps.java.util.List<IImageLayer>
getImageLayers()
Gets theIImageLayer
s contained in a Layer list.java.util.List<IMapObjectLayer>
getMapObjectLayers()
Gets all MapObjectLayers in the Layer list.java.lang.String
getName()
int
getNextLayerId()
int
getNextObjectId()
Gets the next object id.IMapOrientation
getOrientation()
Gets the orientation.java.net.URL
getPath()
java.util.List<ILayer>
getRenderLayers()
Gets all render layers in the Layer list.RenderOrder
getRenderOrder()
Gets the renderorder.java.awt.Dimension
getSizeInPixels()
Gets the size in pixels.java.awt.Dimension
getSizeInTiles()
Gets the sizein tiles.StaggerAxis
getStaggerAxis()
Gets the staggering axisStaggerIndex
getStaggerIndex()
Gets the tile size.java.lang.String
getTiledVersion()
int
getTileHeight()
Gets the vertical tile size.java.util.List<ITileLayer>
getTileLayers()
Gets theITileLayer
s contained in a Layer list.ITilesetEntry
getTilesetEntry(int gid)
java.util.List<ITileset>
getTilesets()
Gets the tilesets.java.awt.Dimension
getTileSize()
Gets the tile size.int
getTileWidth()
Gets the horizontal tile size.double
getVersion()
Gets the version.int
getWidth()
Gets the map width in tiles.int
hashCode()
boolean
isInfinite()
void
removeLayer(int index)
Removes a layer from the Layer list.void
removeLayer(ILayer layer)
Removes anILayer
from the Layer list.void
setHeight(int height)
void
setHexSideLength(int hexSideLength)
void
setName(java.lang.String name)
Sets the name.void
setOrientation(IMapOrientation orientation)
void
setPath(java.net.URL path)
void
setRenderOrder(RenderOrder renderorder)
void
setStaggerAxis(StaggerAxis staggerAxis)
void
setStaggerIndex(StaggerIndex staggerIndex)
void
setTiledVersion(java.lang.String tiledversion)
void
setTileHeight(int tileheight)
void
setTileWidth(int tilewidth)
void
setVersion(double version)
void
setWidth(int width)
java.lang.String
toString()
Methods inherited from class de.gurkenlabs.litiengine.environment.tilemap.xml.CustomPropertyProvider
getBoolValue, getBoolValue, getByteValue, getByteValue, getColorValue, getColorValue, getCommaSeparatedStringValues, getDoubleValue, getDoubleValue, getEnumValue, getEnumValue, getFileValue, getFileValue, getFloatValue, getFloatValue, getIntValue, getIntValue, getLongValue, getProperties, getProperty, getShortValue, getShortValue, getStringValue, getStringValue, getTypeOfProperty, hasCustomProperty, removeProperty, setProperties, setTypeOfProperty, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface de.gurkenlabs.litiengine.environment.tilemap.ICustomPropertyProvider
getBoolValue, getBoolValue, getByteValue, getByteValue, getColorValue, getColorValue, getCommaSeparatedStringValues, getDoubleValue, getDoubleValue, getEnumValue, getEnumValue, getFileValue, getFileValue, getFloatValue, getFloatValue, getIntValue, getIntValue, getLongValue, getLongValue, getProperties, getProperty, getShortValue, getShortValue, getStringValue, getStringValue, getTypeOfProperty, hasCustomProperty, removeProperty, setProperties, setTypeOfProperty, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue
Methods inherited from interface de.gurkenlabs.litiengine.environment.tilemap.ILayerList
getMapObject, getMapObjectLayer, getMapObjectLayer, getMapObjectLayer, getMapObjects, getMapObjects, getMapObjects, removeMapObject
Field Details
FILE_EXTENSION
public static final java.lang.String FILE_EXTENSION- See Also:
- Constant Field Values
MAX_MAJOR
public static final int MAX_MAJOR- See Also:
- Constant Field Values
MAX_MINOR
public static final int MAX_MINOR- See Also:
- Constant Field Values
Constructor Details
Method Details
getImageLayers
Description copied from interface:ILayerList
Gets theIImageLayer
s contained in a Layer list.- Specified by:
getImageLayers
in interfaceILayerList
- Returns:
- a
List
of allIImageLayer
s
getNextObjectId
public int getNextObjectId()Gets the next object id.- Specified by:
getNextObjectId
in interfaceIMap
- Returns:
- the next object id
getNextLayerId
public int getNextLayerId()- Specified by:
getNextLayerId
in interfaceIMap
getOrientation
Description copied from interface:IMap
Gets the orientation.- Specified by:
getOrientation
in interfaceIMap
- Returns:
- the orientation
getPath
public java.net.URL getPath()getRenderOrder
Description copied from interface:IMap
Gets the renderorder.- Specified by:
getRenderOrder
in interfaceIMap
- Returns:
- the renderorder
getMapObjectLayers
Description copied from interface:ILayerList
Gets all MapObjectLayers in the Layer list.- Specified by:
getMapObjectLayers
in interfaceILayerList
- Returns:
- a List of IMapObjectLayers
getSizeInPixels
public java.awt.Dimension getSizeInPixels()Description copied from interface:IMap
Gets the size in pixels.- Specified by:
getSizeInPixels
in interfaceIMap
- Returns:
- the size in pixels
getBounds
public java.awt.geom.Rectangle2D getBounds()getSizeInTiles
public java.awt.Dimension getSizeInTiles()Description copied from interface:IMap
Gets the sizein tiles.- Specified by:
getSizeInTiles
in interfaceIMap
- Returns:
- the sizein tiles
getTileLayers
Description copied from interface:ILayerList
Gets theITileLayer
s contained in a Layer list.- Specified by:
getTileLayers
in interfaceILayerList
- Returns:
- a
List
of allITileLayer
s
getTilesets
Description copied from interface:IMap
Gets the tilesets.- Specified by:
getTilesets
in interfaceIMap
- Returns:
- the tilesets
getTilesetEntry
- Specified by:
getTilesetEntry
in interfaceIMap
getTileSize
public java.awt.Dimension getTileSize()Description copied from interface:IMap
Gets the tile size.- Specified by:
getTileSize
in interfaceIMap
- Returns:
- the tile size
getTileWidth
public int getTileWidth()Description copied from interface:IMap
Gets the horizontal tile size.- Specified by:
getTileWidth
in interfaceIMap
- Returns:
- the horizontal tile size
getTileHeight
public int getTileHeight()Description copied from interface:IMap
Gets the vertical tile size.- Specified by:
getTileHeight
in interfaceIMap
- Returns:
- the vertical tile size
getVersion
public double getVersion()Description copied from interface:IMap
Gets the version.- Specified by:
getVersion
in interfaceIMap
- Returns:
- the version
getTiledVersion
public java.lang.String getTiledVersion()- Specified by:
getTiledVersion
in interfaceIMap
getGroupLayers
Description copied from interface:ILayerList
Gets theIGroupLayer
s contained in a Layer list.- Specified by:
getGroupLayers
in interfaceILayerList
- Returns:
- a
List
of allIGroupLayer
s
getName
public java.lang.String getName()setName
public void setName(java.lang.String name)Description copied from interface:IMap
Sets the name.getWidth
public int getWidth()Description copied from interface:IMap
Gets the map width in tiles.getHeight
public int getHeight()Description copied from interface:IMap
Gets the map height in tiles.getHexSideLength
public int getHexSideLength()Description copied from interface:IMap
Gets the straight edges' length for hexagonal maps.- Specified by:
getHexSideLength
in interfaceIMap
- Returns:
- the hex side length
getStaggerAxis
Description copied from interface:IMap
Gets the staggering axis- Specified by:
getStaggerAxis
in interfaceIMap
- Returns:
- the tile size
getStaggerIndex
Description copied from interface:IMap
Gets the tile size.- Specified by:
getStaggerIndex
in interfaceIMap
- Returns:
- the tile size
setPath
public void setPath(java.net.URL path)finish
- Throws:
TmxException
addLayer
Description copied from interface:ILayerList
Adds anILayer
to the Layer list.- Specified by:
addLayer
in interfaceILayerList
- Parameters:
layer
- the layer to be added
addLayer
Description copied from interface:ILayerList
Adds anILayer
to the Layer list at the given index.- Specified by:
addLayer
in interfaceILayerList
- Parameters:
index
- the indexlayer
- the layer to be added
removeLayer
Description copied from interface:ILayerList
Removes anILayer
from the Layer list.- Specified by:
removeLayer
in interfaceILayerList
- Parameters:
layer
- the layer to be removed
removeLayer
public void removeLayer(int index)Description copied from interface:ILayerList
Removes a layer from the Layer list.- Specified by:
removeLayer
in interfaceILayerList
- Parameters:
index
- the index of the layer to be removed
setHeight
public void setHeight(int height)setOrientation
setRenderOrder
setTiledVersion
public void setTiledVersion(java.lang.String tiledversion)setTileHeight
public void setTileHeight(int tileheight)setTileWidth
public void setTileWidth(int tilewidth)setHexSideLength
public void setHexSideLength(int hexSideLength)setStaggerAxis
setStaggerIndex
setVersion
public void setVersion(double version)setWidth
public void setWidth(int width)toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
equals
public boolean equals(java.lang.Object anObject)- Overrides:
equals
in classjava.lang.Object
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
getRenderLayers
Description copied from interface:ILayerList
Gets all render layers in the Layer list.- Specified by:
getRenderLayers
in interfaceILayerList
- Returns:
- a List of ILayers
getExternalTilesets
getBackgroundColor
public java.awt.Color getBackgroundColor()- Specified by:
getBackgroundColor
in interfaceIMap
isInfinite
public boolean isInfinite()- Specified by:
isInfinite
in interfaceIMap
getChunkOffsetX
protected int getChunkOffsetX()getChunkOffsetY
protected int getChunkOffsetY()