Porytiles
Loading...
Searching...
No Matches
unwrap_config.hpp
Go to the documentation of this file.
1#pragma once
2
3namespace porytiles2 {
4
19#define PT_UNWRAP_SCOPED_CONFIG(ptr, config, tileset, return_type) \
20 auto config##_result = ptr->config(tileset); \
21 if (!config##_result.has_value()) { \
22 return ChainableResult<return_type>{ \
23 FormattableError{ \
24 "failed to get config value '{}:{}'", \
25 FormatParam{tileset, Style::bold}, \
26 FormatParam{#config, Style::bold}}, \
27 config##_result}; \
28 } \
29 auto config = std::move(config##_result).value();
30
31} // namespace porytiles2