|
| template<typename T> |
| void | setEntry (const std::string &key, const T &value) |
| | Set a key-value pair of any type in the data map.
|
| |
| template<typename T> |
| std::optional< T > | getEntry (std::string key) const |
| | Get a value of type T from the data map.
|
| |
|
virtual void | init () |
| |
| virtual void | update (uint_fast16_t diffTime) |
| |
◆ getEntry()
template<typename T>
| std::optional< T > DataComponent::getEntry |
( |
std::string | key | ) |
const |
|
inline |
Get a value of type T from the data map.
e.g. getEntry<int>("speed"); in this case the key is "speed" and the value is returned as an integer
- Parameters
-
| key | The name to retrieve the value from |
- Returns
- An optional of type T containing the value if it exists and matches in typeid, otherwise std::nullopt
◆ setEntry()
template<typename T>
| void DataComponent::setEntry |
( |
const std::string & | key, |
|
|
const T & | value ) |
|
inline |
Set a key-value pair of any type in the data map.
e.g. setEntry("speed", 180); in this case the key is "speed" and the value is set to an integer of 180
- Parameters
-
| key | The name to store the value under |
| value | The value to store of type T |
The documentation for this class was generated from the following file: