Gamedev Framework (gf)  0.6.0
A C++11 framework for 2D games
Public Member Functions | List of all members
gf::TmxProperties Class Reference

The properties for TMX entities. More...

#include <gf/Tmx.h>

Public Member Functions

 TmxProperties ()=default
 Default constructor. More...
 
 TmxProperties (TmxProperties &&)=default
 Default move constructor. More...
 
TmxPropertiesoperator= (TmxProperties &&)=default
 Default move assignment. More...
 
void addStringProperty (std::string name, std::string value)
 Add a string property. More...
 
void addIntProperty (std::string name, int value)
 Add an integer property. More...
 
void addFloatProperty (std::string name, double value)
 Add a float property. More...
 
void addBoolProperty (std::string name, bool value)
 Add a boolean property. More...
 
void addColorProperty (std::string name, Color4u value)
 Add a color property. More...
 
void addFileProperty (std::string name, Path value)
 Add a file property. More...
 
std::string getStringProperty (const std::string &name, const std::string &def) const
 Get a string property. More...
 
int getIntProperty (const std::string &name, int def) const
 Get an integer property. More...
 
double getFloatProperty (const std::string &name, double def) const
 Get a float property. More...
 
bool getBoolProperty (const std::string &name, bool def) const
 Get a boolean property. More...
 
Color4u getColorProperty (const std::string &name, const Color4u &def) const
 Get a color property. More...
 
Path getFileProperty (const std::string &name, const Path &def) const
 Get a file property. More...
 

Detailed Description

The properties for TMX entities.

Constructor & Destructor Documentation

◆ TmxProperties() [1/2]

gf::TmxProperties::TmxProperties ( )
default

Default constructor.

◆ TmxProperties() [2/2]

gf::TmxProperties::TmxProperties ( TmxProperties &&  )
default

Default move constructor.

Member Function Documentation

◆ addBoolProperty()

void gf::TmxProperties::addBoolProperty ( std::string  name,
bool  value 
)

Add a boolean property.

Parameters
nameThe name of the property
valueThe value of the property

◆ addColorProperty()

void gf::TmxProperties::addColorProperty ( std::string  name,
Color4u  value 
)

Add a color property.

Parameters
nameThe name of the property
valueThe value of the property

◆ addFileProperty()

void gf::TmxProperties::addFileProperty ( std::string  name,
Path  value 
)

Add a file property.

Parameters
nameThe name of the property
valueThe value of the property

◆ addFloatProperty()

void gf::TmxProperties::addFloatProperty ( std::string  name,
double  value 
)

Add a float property.

Parameters
nameThe name of the property
valueThe value of the property

◆ addIntProperty()

void gf::TmxProperties::addIntProperty ( std::string  name,
int  value 
)

Add an integer property.

Parameters
nameThe name of the property
valueThe value of the property

◆ addStringProperty()

void gf::TmxProperties::addStringProperty ( std::string  name,
std::string  value 
)

Add a string property.

Parameters
nameThe name of the property
valueThe value of the property

◆ getBoolProperty()

bool gf::TmxProperties::getBoolProperty ( const std::string &  name,
bool  def 
) const

Get a boolean property.

Parameters
nameThe name of the property
defThe default value if the property does not exist
Returns
The value of the given property

◆ getColorProperty()

Color4u gf::TmxProperties::getColorProperty ( const std::string &  name,
const Color4u def 
) const

Get a color property.

Parameters
nameThe name of the property
defThe default value if the property does not exist
Returns
The value of the given property

◆ getFileProperty()

Path gf::TmxProperties::getFileProperty ( const std::string &  name,
const Path def 
) const

Get a file property.

Parameters
nameThe name of the property
defThe default value if the property does not exist
Returns
The value of the given property

◆ getFloatProperty()

double gf::TmxProperties::getFloatProperty ( const std::string &  name,
double  def 
) const

Get a float property.

Parameters
nameThe name of the property
defThe default value if the property does not exist
Returns
The value of the given property

◆ getIntProperty()

int gf::TmxProperties::getIntProperty ( const std::string &  name,
int  def 
) const

Get an integer property.

Parameters
nameThe name of the property
defThe default value if the property does not exist
Returns
The value of the given property

◆ getStringProperty()

std::string gf::TmxProperties::getStringProperty ( const std::string &  name,
const std::string &  def 
) const

Get a string property.

Parameters
nameThe name of the property
defThe default value if the property does not exist
Returns
The value of the given property

◆ operator=()

TmxProperties& gf::TmxProperties::operator= ( TmxProperties &&  )
default

Default move assignment.