72 void Parse(
const tinyxml2::XMLElement *propertyElem);
75 PropertyType
GetType()
const {
return type; }
78 bool IsOfType(PropertyType propertyType)
const {
return GetType() == propertyType; }
81 const std::string &
GetValue()
const {
return value; }
107 return value.compare(
"true") == 0;
115 return std::stoi(value);
123 return std::stof(value);
void Parse(const tinyxml2::XMLElement *propertyElem)
Parse the property element.
Definition: TmxProperty.cpp:39
PropertyType GetType() const
Get the type of the property (default: TMX_PROPERTY_STRING)
Definition: TmxProperty.h:75
float GetFloatValue(float defaultValue=0.0f) const
Convert the value to a float and return it (or the default value if not a float). ...
Definition: TmxProperty.h:118
int GetIntValue(int defaultValue=0) const
Convert the value to an integer and return it (or the default value if not an integer).
Definition: TmxProperty.h:110
bool IsOfType(PropertyType propertyType) const
Check if the property is of a certain type.
Definition: TmxProperty.h:78
Tmx::Color GetColorValue(Tmx::Color defaultValue=Tmx::Color()) const
Convert the value to a color and return it (or the default value if not a color). ...
Definition: TmxProperty.h:126
A class used for storing information about a color.
Definition: TmxColor.h:38
Used to store a (typed) property.
Definition: TmxProperty.h:66
bool IsValueEmpty() const
Return whether the value is empty or was not specified.
Definition: TmxProperty.h:84
bool GetBoolValue(bool defaultValue=false) const
Convert the value to a boolean and return it (or the default value if not a boolean.)
Definition: TmxProperty.h:102
const std::string & GetValue() const
Return the value of the property.
Definition: TmxProperty.h:81