28 #ifndef TMXLITE_PROPERTY_HPP_ 29 #define TMXLITE_PROPERTY_HPP_ 31 #include <tmxlite/Config.hpp> 32 #include <tmxlite/Types.hpp> 72 void parse(
const pugi::xml_node&);
83 const std::string&
getName()
const {
return m_name; }
87 bool getBoolValue()
const { assert(m_type == Type::Boolean);
return m_boolValue; }
91 float getFloatValue()
const { assert(m_type == Type::Float);
return m_floatValue; }
95 int getIntValue()
const { assert(m_type == Type::Int);
return m_intValue; }
99 const std::string&
getStringValue()
const { assert(m_type == Type::String);
return m_stringValue; }
107 const std::string&
getFileValue()
const { assert(m_type == Type::File);
return m_stringValue; }
117 std::string m_stringValue;
125 #endif //TMXLITE_PROPERTY_HPP_
const std::string & getStringValue() const
Returns the property's value as a string.
Definition: Property.hpp:99
const Colour & getColourValue() const
Returns the property's value as a Colour struct.
Definition: Property.hpp:103
int getIntValue() const
Returns the property's value as an integer.
Definition: Property.hpp:95
Contains the red, green, blue and alpha values of a colour in the range 0 - 255.
Definition: Types.hpp:109
float getFloatValue() const
Returns the property's value as a float.
Definition: Property.hpp:91
Type getType() const
Returns the type of data stored in the property. This should generally be called first before trying ...
Definition: Property.hpp:79
Represents a custom property. Tiles, objects and layers of a tmx map may have custom properties assig...
Definition: Property.hpp:51
const std::string & getName() const
Returns the name of this property.
Definition: Property.hpp:83
const std::string & getFileValue() const
Returns the file path property as a string, relative to the map file.
Definition: Property.hpp:107
bool getBoolValue() const
Returns the property's value as a boolean.
Definition: Property.hpp:87