30#include <tmxlite/Config.hpp>
31#include <tmxlite/Types.hpp>
68 static Property fromBoolean(
bool value);
69 static Property fromFloat(
float value);
71 static Property fromString(
const std::string& value);
73 static Property fromFile(
const std::string& value);
74 static Property fromObject(
int value);
80 void parse(
const pugi::xml_node&,
bool isObjectTypes =
false);
93 const std::string&
getName()
const {
return m_name; }
98 bool getBoolValue()
const { assert(m_type == Type::Boolean);
return m_boolValue; }
103 float getFloatValue()
const { assert(m_type == Type::Float);
return m_floatValue; }
108 int getIntValue()
const { assert(m_type == Type::Int || m_type == Type::Object);
return m_intValue; }
113 const std::string&
getStringValue()
const { assert(m_type == Type::String);
return m_stringValue; }
123 const std::string&
getFileValue()
const { assert(m_type == Type::File);
return m_stringValue; }
128 int getObjectValue()
const { assert(m_type == Type::Object);
return m_intValue; }
138 std::string m_stringValue;
140 Colour m_colourValue;
Objects are stored in ObjectGroup layers. Objects may be rectangular, elliptical, polygonal or a poly...
Definition Object.hpp:84
Represents a custom property. Tiles, objects and layers of a tmx map may have custom properties assig...
Definition Property.hpp:51
float getFloatValue() const
Returns the property's value as a float.
Definition Property.hpp:103
void parse(const pugi::xml_node &, bool isObjectTypes=false)
Attempts to parse the given node as a property.
bool getBoolValue() const
Returns the property's value as a boolean.
Definition Property.hpp:98
const std::string & getStringValue() const
Returns the property's value as a string.
Definition Property.hpp:113
const Colour & getColourValue() const
Returns the property's value as a Colour struct.
Definition Property.hpp:118
int getObjectValue() const
Returns the property's value as an integer object handle.
Definition Property.hpp:128
const std::string & getFileValue() const
Returns the file path property as a string, relative to the map file.
Definition Property.hpp:123
Type getType() const
Returns the type of data stored in the property. This should generally be called first before trying ...
Definition Property.hpp:88
int getIntValue() const
Returns the property's value as an integer.
Definition Property.hpp:108
const std::string & getName() const
Returns the name of this property.
Definition Property.hpp:93
Contains the red, green, blue and alpha values of a colour in the range 0 - 255.
Definition Types.hpp:111