tmxlite
lightweight Tiled tmx map parser for C++
Public Types | Public Member Functions | List of all members
tmx::Property Class Referencefinal

Represents a custom property. Tiles, objects and layers of a tmx map may have custom properties assigned to them. This class represents a single property and provides access to its value, the type of which can be determined with getType() More...

#include <Property.hpp>

Public Types

enum  Type {
  Boolean, Float, Int, String,
  Colour, File, Undef
}
 

Public Member Functions

void parse (const pugi::xml_node &)
 Attempts to parse the given node as a property.
 
Type getType () const
 Returns the type of data stored in the property. This should generally be called first before trying to read the proprty value, as reading the incorrect type will lead to undefined behaviour.
 
const std::string & getName () const
 Returns the name of this property.
 
bool getBoolValue () const
 Returns the property's value as a boolean.
 
float getFloatValue () const
 Returns the property's value as a float.
 
int getIntValue () const
 Returns the property's value as an integer.
 
const std::string & getStringValue () const
 Returns the property's value as a string.
 
const ColourgetColourValue () const
 Returns the property's value as a Colour struct.
 
const std::string & getFileValue () const
 Returns the file path property as a string, relative to the map file.
 

Detailed Description

Represents a custom property. Tiles, objects and layers of a tmx map may have custom properties assigned to them. This class represents a single property and provides access to its value, the type of which can be determined with getType()


The documentation for this class was generated from the following file: