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 IMapField Summary
Fields Modifier and Type Field Description static java.lang.StringFILE_EXTENSIONstatic intMAX_MAJORstatic intMAX_MINORConstructor Summary
Constructors Constructor Description TmxMap()TmxMap(IMapOrientation orientation)Method Summary
Modifier and Type Method Description voidaddLayer(int index, ILayer layer)Adds anILayerto the Layer list at the given index.voidaddLayer(ILayer layer)Adds anILayerto the Layer list.booleanequals(java.lang.Object anObject)voidfinish(java.net.URL location)java.awt.ColorgetBackgroundColor()java.awt.geom.Rectangle2DgetBounds()protected intgetChunkOffsetX()protected intgetChunkOffsetY()java.util.List<Tileset>getExternalTilesets()java.util.List<IGroupLayer>getGroupLayers()Gets theIGroupLayers contained in a Layer list.intgetHeight()Gets the map height in tiles.intgetHexSideLength()Gets the straight edges' length for hexagonal maps.java.util.List<IImageLayer>getImageLayers()Gets theIImageLayers contained in a Layer list.java.util.List<IMapObjectLayer>getMapObjectLayers()Gets all MapObjectLayers in the Layer list.java.lang.StringgetName()intgetNextLayerId()intgetNextObjectId()Gets the next object id.IMapOrientationgetOrientation()Gets the orientation.java.net.URLgetPath()java.util.List<ILayer>getRenderLayers()Gets all render layers in the Layer list.RenderOrdergetRenderOrder()Gets the renderorder.java.awt.DimensiongetSizeInPixels()Gets the size in pixels.java.awt.DimensiongetSizeInTiles()Gets the sizein tiles.StaggerAxisgetStaggerAxis()Gets the staggering axisStaggerIndexgetStaggerIndex()Gets the tile size.java.lang.StringgetTiledVersion()intgetTileHeight()Gets the vertical tile size.java.util.List<ITileLayer>getTileLayers()Gets theITileLayers contained in a Layer list.ITilesetEntrygetTilesetEntry(int gid)java.util.List<ITileset>getTilesets()Gets the tilesets.java.awt.DimensiongetTileSize()Gets the tile size.intgetTileWidth()Gets the horizontal tile size.doublegetVersion()Gets the version.intgetWidth()Gets the map width in tiles.inthashCode()booleanisInfinite()voidremoveLayer(int index)Removes a layer from the Layer list.voidremoveLayer(ILayer layer)Removes anILayerfrom the Layer list.voidsetHeight(int height)voidsetHexSideLength(int hexSideLength)voidsetName(java.lang.String name)Sets the name.voidsetOrientation(IMapOrientation orientation)voidsetPath(java.net.URL path)voidsetRenderOrder(RenderOrder renderorder)voidsetStaggerAxis(StaggerAxis staggerAxis)voidsetStaggerIndex(StaggerIndex staggerIndex)voidsetTiledVersion(java.lang.String tiledversion)voidsetTileHeight(int tileheight)voidsetTileWidth(int tilewidth)voidsetVersion(double version)voidsetWidth(int width)java.lang.StringtoString()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, setValueMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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, setValueMethods 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:ILayerListGets theIImageLayers contained in a Layer list.- Specified by:
getImageLayersin interfaceILayerList- Returns:
- a
Listof allIImageLayers
getNextObjectId
public int getNextObjectId()Gets the next object id.- Specified by:
getNextObjectIdin interfaceIMap- Returns:
- the next object id
getNextLayerId
public int getNextLayerId()- Specified by:
getNextLayerIdin interfaceIMap
getOrientation
Description copied from interface:IMapGets the orientation.- Specified by:
getOrientationin interfaceIMap- Returns:
- the orientation
getPath
public java.net.URL getPath()getRenderOrder
Description copied from interface:IMapGets the renderorder.- Specified by:
getRenderOrderin interfaceIMap- Returns:
- the renderorder
getMapObjectLayers
Description copied from interface:ILayerListGets all MapObjectLayers in the Layer list.- Specified by:
getMapObjectLayersin interfaceILayerList- Returns:
- a List of IMapObjectLayers
getSizeInPixels
public java.awt.Dimension getSizeInPixels()Description copied from interface:IMapGets the size in pixels.- Specified by:
getSizeInPixelsin interfaceIMap- Returns:
- the size in pixels
getBounds
public java.awt.geom.Rectangle2D getBounds()getSizeInTiles
public java.awt.Dimension getSizeInTiles()Description copied from interface:IMapGets the sizein tiles.- Specified by:
getSizeInTilesin interfaceIMap- Returns:
- the sizein tiles
getTileLayers
Description copied from interface:ILayerListGets theITileLayers contained in a Layer list.- Specified by:
getTileLayersin interfaceILayerList- Returns:
- a
Listof allITileLayers
getTilesets
Description copied from interface:IMapGets the tilesets.- Specified by:
getTilesetsin interfaceIMap- Returns:
- the tilesets
getTilesetEntry
- Specified by:
getTilesetEntryin interfaceIMap
getTileSize
public java.awt.Dimension getTileSize()Description copied from interface:IMapGets the tile size.- Specified by:
getTileSizein interfaceIMap- Returns:
- the tile size
getTileWidth
public int getTileWidth()Description copied from interface:IMapGets the horizontal tile size.- Specified by:
getTileWidthin interfaceIMap- Returns:
- the horizontal tile size
getTileHeight
public int getTileHeight()Description copied from interface:IMapGets the vertical tile size.- Specified by:
getTileHeightin interfaceIMap- Returns:
- the vertical tile size
getVersion
public double getVersion()Description copied from interface:IMapGets the version.- Specified by:
getVersionin interfaceIMap- Returns:
- the version
getTiledVersion
public java.lang.String getTiledVersion()- Specified by:
getTiledVersionin interfaceIMap
getGroupLayers
Description copied from interface:ILayerListGets theIGroupLayers contained in a Layer list.- Specified by:
getGroupLayersin interfaceILayerList- Returns:
- a
Listof allIGroupLayers
getName
public java.lang.String getName()setName
public void setName(java.lang.String name)Description copied from interface:IMapSets the name.getWidth
public int getWidth()Description copied from interface:IMapGets the map width in tiles.getHeight
public int getHeight()Description copied from interface:IMapGets the map height in tiles.getHexSideLength
public int getHexSideLength()Description copied from interface:IMapGets the straight edges' length for hexagonal maps.- Specified by:
getHexSideLengthin interfaceIMap- Returns:
- the hex side length
getStaggerAxis
Description copied from interface:IMapGets the staggering axis- Specified by:
getStaggerAxisin interfaceIMap- Returns:
- the tile size
getStaggerIndex
Description copied from interface:IMapGets the tile size.- Specified by:
getStaggerIndexin interfaceIMap- Returns:
- the tile size
setPath
public void setPath(java.net.URL path)finish
- Throws:
TmxException
addLayer
Description copied from interface:ILayerListAdds anILayerto the Layer list.- Specified by:
addLayerin interfaceILayerList- Parameters:
layer- the layer to be added
addLayer
Description copied from interface:ILayerListAdds anILayerto the Layer list at the given index.- Specified by:
addLayerin interfaceILayerList- Parameters:
index- the indexlayer- the layer to be added
removeLayer
Description copied from interface:ILayerListRemoves anILayerfrom the Layer list.- Specified by:
removeLayerin interfaceILayerList- Parameters:
layer- the layer to be removed
removeLayer
public void removeLayer(int index)Description copied from interface:ILayerListRemoves a layer from the Layer list.- Specified by:
removeLayerin 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:
toStringin classjava.lang.Object
equals
public boolean equals(java.lang.Object anObject)- Overrides:
equalsin classjava.lang.Object
hashCode
public int hashCode()- Overrides:
hashCodein classjava.lang.Object
getRenderLayers
Description copied from interface:ILayerListGets all render layers in the Layer list.- Specified by:
getRenderLayersin interfaceILayerList- Returns:
- a List of ILayers
getExternalTilesets
getBackgroundColor
public java.awt.Color getBackgroundColor()- Specified by:
getBackgroundColorin interfaceIMap
isInfinite
public boolean isInfinite()- Specified by:
isInfinitein interfaceIMap
getChunkOffsetX
protected int getChunkOffsetX()getChunkOffsetY
protected int getChunkOffsetY()
