Class CustomPropertyProvider
java.lang.Object
de.gurkenlabs.litiengine.environment.tilemap.xml.CustomPropertyProvider
- All Implemented Interfaces:
ICustomPropertyProvider
- Direct Known Subclasses:
GameInfo,Layer,MapImage,MapObject,Material,Terrain,Tile,Tileset,TilesetEntry,TmxMap
-
Constructor Summary
ConstructorsConstructorDescriptionCustomPropertyProvider(ICustomPropertyProvider propertyProviderToBeCopied) Copy Constructor for copying instances of CustomPropertyProviders. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetBoolValue(String propertyName) Gets the boolean value of the custom property with the provided name.booleangetBoolValue(String propertyName, boolean defaultValue) Gets the boolean value of the custom property with the provided name.bytegetByteValue(String propertyName) Gets the byte value of the custom property with the provided name.bytegetByteValue(String propertyName, byte defaultValue) Gets the byte value of the custom property with the provided name.getColorValue(String propertyName) Gets the color value of the custom property with the provided name.getColorValue(String propertyName, Color defaultValue) Gets the color value of the custom property with the provided name.getCommaSeparatedStringValues(String propertyName, String defaultValue) Gets a list of strings stored in a single comma-separated property.doublegetDoubleValue(String propertyName) Gets the double value of the custom property with the provided name.doublegetDoubleValue(String propertyName, double defaultValue) Gets the double value of the custom property with the provided name.<T extends Enum<T>>
TgetEnumValue(String propertyName, Class<T> enumType) Gets the enum value of the custom property with the provided name.<T extends Enum<T>>
TgetEnumValue(String propertyName, Class<T> enumType, T defaultValue) Gets the enum value of the custom property with the provided name.getFileValue(String propertyName) Gets the file value of the custom property with the provided name.getFileValue(String propertyName, URL defaultValue) Gets the file value of the custom property with the provided name.floatgetFloatValue(String propertyName) Gets the float value of the custom property with the provided name.floatgetFloatValue(String propertyName, float defaultValue) Gets the float value of the custom property with the provided name.intgetIntValue(String propertyName) Gets the int value of the custom property with the provided name.intgetIntValue(String propertyName, int defaultValue) Gets the int value of the custom property with the provided name.longgetLongValue(String propertyName, long defaultValue) Gets the long value of the custom property with the provided name.Returns aMapview of the custom properties for thisICustomPropertyProvider.getProperty(String propertyName) shortgetShortValue(String propertyName) Gets the short value of the custom property with the provided name.shortgetShortValue(String propertyName, short defaultValue) Gets the short value of the custom property with the provided name.getStringValue(String propertyName) Gets the string value of the custom property with the provided name.getStringValue(String propertyName, String defaultValue) Gets the string value of the custom property with the provided name.getTypeOfProperty(String propertyName) booleanhasCustomProperty(String propertyName) Checks if a custom property with the given name is present.voidremoveProperty(String propertyName) voidsetProperties(Map<String, ICustomProperty> props) Sets all of the custom properties on this object to the provided values.voidsetTypeOfProperty(String propertyName, String type) voidSets the value for the custom property with the given name to the given boolean.voidSets the value for the custom property with the given name to the given byte.voidSets the value for the custom property with the given name to the given double.voidSets the value for the custom property with the given name to the given float.voidSets the value for the custom property with the given name to the given int.voidSets the value for the custom property with the given name to the given long.voidSets the value for the custom property with the given name to the given short.voidsetValue(String propertyName, ICustomProperty value) voidSets the value for the custom property with the given name to the given color.voidSets the value for the custom property with the given name to the given enum.voidSets the value for the custom property with the given name to the given string.voidSets the value for the custom property with the given name to the given file.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.gurkenlabs.litiengine.environment.tilemap.ICustomPropertyProvider
getLongValue
-
Constructor Details
-
CustomPropertyProvider
public CustomPropertyProvider() -
CustomPropertyProvider
Copy Constructor for copying instances of CustomPropertyProviders.- Parameters:
propertyProviderToBeCopied- the PropertyProvider we want to copy
-
-
Method Details
-
getProperties
Description copied from interface:ICustomPropertyProviderReturns aMapview of the custom properties for thisICustomPropertyProvider.- Specified by:
getPropertiesin interfaceICustomPropertyProvider- Returns:
- a
Mapview of the custom properties for thisICustomPropertyProvider
-
hasCustomProperty
Description copied from interface:ICustomPropertyProviderChecks if a custom property with the given name is present.- Specified by:
hasCustomPropertyin interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom property- Returns:
- true if a custom property with the given name is present. False otherwise.
-
getTypeOfProperty
- Specified by:
getTypeOfPropertyin interfaceICustomPropertyProvider
-
setTypeOfProperty
- Specified by:
setTypeOfPropertyin interfaceICustomPropertyProvider
-
getProperty
- Specified by:
getPropertyin interfaceICustomPropertyProvider
-
setValue
- Specified by:
setValuein interfaceICustomPropertyProvider
-
getStringValue
Description copied from interface:ICustomPropertyProviderGets the string value of the custom property with the provided name.- Specified by:
getStringValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom property- Returns:
- the string value of the custom property
-
getStringValue
Description copied from interface:ICustomPropertyProviderGets the string value of the custom property with the provided name. If the value is null, the provided default value is used as a fallback.- Specified by:
getStringValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertydefaultValue- the fallback value in case the property value is null.- Returns:
- the string value of the custom property, if present. Otherwise, the provided default value is returned.
-
getIntValue
Description copied from interface:ICustomPropertyProviderGets the int value of the custom property with the provided name.- Specified by:
getIntValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom property- Returns:
- the int value of the custom property
-
getIntValue
Description copied from interface:ICustomPropertyProviderGets the int value of the custom property with the provided name. If the value is null, the provided default value is used as a fallback.- Specified by:
getIntValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertydefaultValue- the fallback value in case the property value is null.- Returns:
- the int value of the custom property, if present. Otherwise, the provided default value is returned.
-
getLongValue
Description copied from interface:ICustomPropertyProviderGets the long value of the custom property with the provided name. If the value is null, the provided default value is used as a fallback.- Specified by:
getLongValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertydefaultValue- the fallback value in case the property value is null.- Returns:
- the long value of the custom property, if present. Otherwise, the provided default value is returned.
-
getShortValue
Description copied from interface:ICustomPropertyProviderGets the short value of the custom property with the provided name.- Specified by:
getShortValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom property- Returns:
- the short value of the custom property
-
getShortValue
Description copied from interface:ICustomPropertyProviderGets the short value of the custom property with the provided name. If the value is null, the provided default value is used as a fallback.- Specified by:
getShortValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertydefaultValue- the fallback value in case the property value is null.- Returns:
- the short value of the custom property, if present. Otherwise, the provided default value is returned.
-
getByteValue
Description copied from interface:ICustomPropertyProviderGets the byte value of the custom property with the provided name.- Specified by:
getByteValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom property- Returns:
- the byte value of the custom property
-
getByteValue
Description copied from interface:ICustomPropertyProviderGets the byte value of the custom property with the provided name. If the value is null, the provided default value is used as a fallback.- Specified by:
getByteValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertydefaultValue- the fallback value in case the property value is null.- Returns:
- the byte value of the custom property, if present. Otherwise, the provided default value is returned.
-
getBoolValue
Description copied from interface:ICustomPropertyProviderGets the boolean value of the custom property with the provided name.- Specified by:
getBoolValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom property- Returns:
- the boolean value of the custom property
-
getBoolValue
Description copied from interface:ICustomPropertyProviderGets the boolean value of the custom property with the provided name. If the value is null, the provided default value is used as a fallback.- Specified by:
getBoolValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertydefaultValue- the fallback value in case the property value is null.- Returns:
- the boolean value of the custom property, if present. Otherwise, the provided default value is returned.
-
getFloatValue
Description copied from interface:ICustomPropertyProviderGets the float value of the custom property with the provided name.- Specified by:
getFloatValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom property- Returns:
- the float value of the custom property
-
getFloatValue
Description copied from interface:ICustomPropertyProviderGets the float value of the custom property with the provided name. If the value is null, the provided default value is used as a fallback.- Specified by:
getFloatValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertydefaultValue- the fallback value in case the property value is null.- Returns:
- the float value of the custom property, if present. Otherwise, the provided default value is returned.
-
getDoubleValue
Description copied from interface:ICustomPropertyProviderGets the double value of the custom property with the provided name.- Specified by:
getDoubleValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom property- Returns:
- the double value of the custom property
-
getDoubleValue
Description copied from interface:ICustomPropertyProviderGets the double value of the custom property with the provided name. If the value is null, the provided default value is used as a fallback.- Specified by:
getDoubleValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertydefaultValue- the fallback value in case the property value is null.- Returns:
- the double value of the custom property, if present. Otherwise, the provided default value is returned.
-
getColorValue
Description copied from interface:ICustomPropertyProviderGets the color value of the custom property with the provided name.- Specified by:
getColorValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom property- Returns:
- the color value of the custom property
-
getColorValue
Description copied from interface:ICustomPropertyProviderGets the color value of the custom property with the provided name. If the value is null, the provided default value is used as a fallback.- Specified by:
getColorValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertydefaultValue- the fallback value in case the property value is null.- Returns:
- the color value of the custom property, if present. Otherwise, the provided default value is returned.
-
getEnumValue
Description copied from interface:ICustomPropertyProviderGets the enum value of the custom property with the provided name.- Specified by:
getEnumValuein interfaceICustomPropertyProvider- Type Parameters:
T- the enum type to use- Parameters:
propertyName- the name of the custom propertyenumType- aClassobject for<T>- Returns:
- the enum value of the custom property
-
getEnumValue
Description copied from interface:ICustomPropertyProviderGets the enum value of the custom property with the provided name. If the value is null, the provided default value is used as a fallback.- Specified by:
getEnumValuein interfaceICustomPropertyProvider- Type Parameters:
T- the enum type to use- Parameters:
propertyName- the name of the custom propertyenumType- aClassobject for<T>defaultValue- the fallback value in case the property value is null.- Returns:
- the enum value of the custom property, if present. Otherwise, the provided default value is returned.
-
getFileValue
Description copied from interface:ICustomPropertyProviderGets the file value of the custom property with the provided name. If the property is not a file,nullis returned instead.- Specified by:
getFileValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom property- Returns:
- the file value of the custom property, if present.
-
getFileValue
Description copied from interface:ICustomPropertyProviderGets the file value of the custom property with the provided name. If the value is null or the property is not a file, the provided default value is used as a fallback.- Specified by:
getFileValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertydefaultValue- the fallback value in case the property value is null.- Returns:
- the file value of the custom property, if present. Otherwise, the provided default value is returned.
-
setValue
Description copied from interface:ICustomPropertyProviderSets the value for the custom property with the given name to the given file.- Specified by:
setValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertyvalue- the new value
-
setValue
Description copied from interface:ICustomPropertyProviderSets the value for the custom property with the given name to the given string.- Specified by:
setValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertyvalue- the new value
-
setValue
Description copied from interface:ICustomPropertyProviderSets the value for the custom property with the given name to the given boolean.- Specified by:
setValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertyvalue- the new value
-
setValue
Description copied from interface:ICustomPropertyProviderSets the value for the custom property with the given name to the given byte.- Specified by:
setValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertyvalue- the new value
-
setValue
Description copied from interface:ICustomPropertyProviderSets the value for the custom property with the given name to the given short.- Specified by:
setValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertyvalue- the new value
-
setValue
Description copied from interface:ICustomPropertyProviderSets the value for the custom property with the given name to the given int.- Specified by:
setValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertyvalue- the new value
-
setValue
Description copied from interface:ICustomPropertyProviderSets the value for the custom property with the given name to the given long.- Specified by:
setValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertyvalue- the new value
-
setValue
Description copied from interface:ICustomPropertyProviderSets the value for the custom property with the given name to the given float.- Specified by:
setValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertyvalue- the new value
-
setValue
Description copied from interface:ICustomPropertyProviderSets the value for the custom property with the given name to the given double.- Specified by:
setValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertyvalue- the new value
-
setValue
Description copied from interface:ICustomPropertyProviderSets the value for the custom property with the given name to the given color.- Specified by:
setValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertyvalue- the new value
-
setValue
Description copied from interface:ICustomPropertyProviderSets the value for the custom property with the given name to the given enum.- Specified by:
setValuein interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertyvalue- the new value
-
setProperties
Description copied from interface:ICustomPropertyProviderSets all of 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- Parameters:
props- the new list of properties
-
removeProperty
- Specified by:
removePropertyin interfaceICustomPropertyProvider
-
getCommaSeparatedStringValues
Description copied from interface:ICustomPropertyProviderGets a list of strings stored in a single comma-separated property.- Specified by:
getCommaSeparatedStringValuesin interfaceICustomPropertyProvider- Parameters:
propertyName- the name of the custom propertydefaultValue- the fallback value in case the property value is null.- Returns:
- the list of comma-separated strings in the custom property, if present. Otherwise, the provided default value is returned.
-