Class Tile
java.lang.Object
de.gurkenlabs.litiengine.environment.tilemap.xml.CustomPropertyProvider
de.gurkenlabs.litiengine.environment.tilemap.xml.Tile
- All Implemented Interfaces:
ICustomPropertyProvider,ITile
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Tileprotected static final intprotected static final intprotected static final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTests for equality between two tiles.intGets the grid id.getImage()Returns aMapview of the custom properties for thisICustomPropertyProvider.Gets the tile coordinate.booleanhasCustomProperty(String name) Checks if a custom property with the given name is present.inthashCode()Computes a hash code for this tile.booleanbooleanbooleanbooleanvoidsetProperties(Map<String, ICustomProperty> props) Sets all the custom properties on this object to the provided values.toString()Methods inherited from class de.gurkenlabs.litiengine.environment.tilemap.xml.CustomPropertyProvider
getBoolValue, getBoolValue, getByteValue, getByteValue, getCharValue, getCharValue, getColorValue, getColorValue, getCommaSeparatedStringValues, getDoubleValue, getDoubleValue, getEnumValue, getEnumValue, getFileValue, getFileValue, getFloatValue, getFloatValue, getIntValue, getIntValue, getLongValue, getLongValue, getMapObjectId, getProperty, getShortValue, getShortValue, getStringValue, getStringValue, removeProperty, setValue, setValue, 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, getCharValue, getCharValue, getColorValue, getColorValue, getCommaSeparatedStringValues, getDoubleValue, getDoubleValue, getEnumValue, getEnumValue, getFileValue, getFileValue, getFloatValue, getFloatValue, getIntValue, getIntValue, getLongValue, getLongValue, getMapObjectId, getProperty, getShortValue, getShortValue, getStringValue, getStringValue, removeProperty, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue
-
Field Details
-
NONE
public static final int NONE- See Also:
-
EMPTY
-
FLIPPED_HORIZONTALLY_FLAG
protected static final int FLIPPED_HORIZONTALLY_FLAG- See Also:
-
FLIPPED_VERTICALLY_FLAG
protected static final int FLIPPED_VERTICALLY_FLAG- See Also:
-
FLIPPED_DIAGONALLY_FLAG
protected static final int FLIPPED_DIAGONALLY_FLAG- See Also:
-
-
Constructor Details
-
Tile
public Tile()Instantiates a newTileinstance. -
Tile
Instantiates a newTileinstance with the same attributes as a givenTile.- Parameters:
original- The original tile from which the values will be copied to this new instance.
-
Tile
public Tile(int gidBitmask) Instantiates a newTileinstance.- Parameters:
gidBitmask- The grid ID bitmask used to identify flags of this instance.- See Also:
-
-
Method Details
-
hasCustomProperty
Description copied from interface:ICustomPropertyProviderChecks if a custom property with the given name is present.- Specified by:
hasCustomPropertyin interfaceICustomPropertyProvider- Overrides:
hasCustomPropertyin classCustomPropertyProvider- Parameters:
name- the name of the custom property- Returns:
- true if a custom property with the given name is present. False otherwise.
-
getProperties
Description copied from interface:ICustomPropertyProviderReturns aMapview of the custom properties for thisICustomPropertyProvider.- Specified by:
getPropertiesin interfaceICustomPropertyProvider- Overrides:
getPropertiesin classCustomPropertyProvider- Returns:
- a
Mapview of the custom properties for thisICustomPropertyProvider
-
setProperties
Description copied from interface:ICustomPropertyProviderSets all the custom properties on this object to the provided values. Properties are added when they only exist in the provided properties, and deleted when they only exist in the current properties.- Specified by:
setPropertiesin interfaceICustomPropertyProvider- Overrides:
setPropertiesin classCustomPropertyProvider- Parameters:
props- the new list of properties
-
isFlippedDiagonally
public boolean isFlippedDiagonally()- Specified by:
isFlippedDiagonallyin interfaceITile
-
isFlippedHorizontally
public boolean isFlippedHorizontally()- Specified by:
isFlippedHorizontallyin interfaceITile
-
isFlippedVertically
public boolean isFlippedVertically()- Specified by:
isFlippedVerticallyin interfaceITile
-
isFlipped
-
getImage
-
getGridId
-
getTileCoordinate
Description copied from interface:ITileGets the tile coordinate.- Specified by:
getTileCoordinatein interfaceITile- Returns:
- the tile coordinate
-
getTilesetEntry
- Specified by:
getTilesetEntryin interfaceITile
-
equals
Description copied from interface:ITileTests for equality between two tiles. Two tiles are equal if they have the same grid ID, flipped flags, and tileset entry. -
hashCode
public int hashCode()Description copied from interface:ITileComputes a hash code for this tile. A tile's hash code is equal to its stored grid ID, i.e. the gid bitmask, xor the tileset entry's hash code. -
toString
-