|
Porytiles
|
Abstract interface for providing two-way metatile terrain type mappings. More...
#include <terrain_type_map_provider.hpp>
Public Member Functions | |
| virtual | ~TerrainTypeMapProvider ()=default |
| virtual ChainableResult< std::uint8_t > | lookup (const std::string &terrain_name) const =0 |
| Looks up the numeric value for a terrain type constant name. | |
| virtual ChainableResult< std::string > | lookup (std::uint8_t terrain_value) const =0 |
| Looks up the terrain type constant name for a numeric value. | |
Abstract interface for providing two-way metatile terrain type mappings.
The TerrainTypeMapProvider maps terrain type constant names (e.g., "TILE_TERRAIN_GRASS", "TILE_TERRAIN_WATER") to their corresponding uint8_t values and vice versa. Implementations may load these mappings from various sources such as header files or configuration. Loading and caching strategies are implementation details left to concrete implementations.
Definition at line 19 of file terrain_type_map_provider.hpp.
|
virtualdefault |
|
pure virtual |
Looks up the numeric value for a terrain type constant name.
This function searches for the given terrain type constant name in the provider's mapping and returns its corresponding numeric value if found.
| terrain_name | The terrain type constant name (e.g., "TILE_TERRAIN_GRASS") |
Implemented in porytiles::HeaderTerrainTypeMapProvider.
|
pure virtual |
Looks up the terrain type constant name for a numeric value.
This function performs a reverse lookup, searching for the terrain type constant name that corresponds to the given numeric value.
| terrain_value | The numeric terrain type value |
Implemented in porytiles::HeaderTerrainTypeMapProvider.