A base class for classes that have properties.
More...
#include <tmx/Component.h>
|
bool | hasProperty (const std::string &key) const noexcept |
| Tell if the object has a given property. More...
|
|
const std::string & | getProperty (const std::string &key, const std::string &def) const noexcept |
| Get a property value. More...
|
|
bool | addProperty (const std::string &key, const std::string &value) |
| Add a property. More...
|
|
A base class for classes that have properties.
bool tmx::Component::addProperty |
( |
const std::string & |
key, |
|
|
const std::string & |
value |
|
) |
| |
Add a property.
- Parameters
-
key | the property key |
value | the property value |
const std::string& tmx::Component::getProperty |
( |
const std::string & |
key, |
|
|
const std::string & |
def |
|
) |
| const |
|
noexcept |
Get a property value.
- Parameters
-
key | the property key |
def | a default value if the property does not exist |
- Returns
- the value of the given property
bool tmx::Component::hasProperty |
( |
const std::string & |
key | ) |
const |
|
noexcept |
Tell if the object has a given property.
- Parameters
-
- Returns
- true if the object has the given property