|
CardGame
Rogue-like card videogame
|
Lightweight text lookup service backed by a JSON file. More...
#include <text.h>
Public Member Functions | |
| Text () | |
| Loads text data from the JSON source. | |
| const std::string & | getText (const char *key) const |
| Returns the text associated with the given key. | |
Lightweight text lookup service backed by a JSON file.
Text loads a JSON document at construction time and provides read-only access to string values by key. It is intended for externalized game text such as UI labels, messages, or descriptions.
The underlying data is immutable after construction.
| Text::Text | ( | ) |
Loads text data from the JSON source.
The JSON file is parsed during construction and stored internally.
| const std::string & Text::getText | ( | const char * | key | ) | const |
Returns the text associated with the given key.
| key | Null-terminated string key used to look up the text. |
| If | the key is not present in the underlying JSON data. |