Porytiles
Loading...
Searching...
No Matches
terrain_type_map_provider.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <string>
5
7
8namespace porytiles {
9
20 public:
21 virtual ~TerrainTypeMapProvider() = default;
22
33 [[nodiscard]] virtual ChainableResult<std::uint8_t> lookup(const std::string &terrain_name) const = 0;
34
45 [[nodiscard]] virtual ChainableResult<std::string> lookup(std::uint8_t terrain_value) const = 0;
46};
47
48} // namespace porytiles
A result type that maintains a chainable sequence of errors for debugging and error reporting.
Abstract interface for providing two-way metatile terrain type mappings.
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 ~TerrainTypeMapProvider()=default
virtual ChainableResult< std::string > lookup(std::uint8_t terrain_value) const =0
Looks up the terrain type constant name for a numeric value.