Gamedev Framework (gf) 1.2.0
A C++17 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

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...
 
void addObjectProperty (std::string name, Id value)
 Add an object property. More...
 
void addClassProperty (std::string name, TmxProperties value)
 Add a class 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...
 
Id getObjectProperty (const std::string &name, Id def) const
 Get an object property. More...
 
TmxProperties getClassProperty (const std::string &name, const TmxProperties &def) const
 Get a class property. More...
 

Detailed Description

The properties for TMX entities.

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

◆ addClassProperty()

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

Add a class 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

◆ addObjectProperty()

void gf::TmxProperties::addObjectProperty ( std::string  name,
Id  value 
)

Add an object 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

◆ getClassProperty()

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

Get a class 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

◆ getObjectProperty()

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

Get an object 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