Porytiles
Loading...
Searching...
No Matches
lazy_layered_config.cpp
Go to the documentation of this file.
2
3#include <any>
4#include <format>
5#include <functional>
6#include <ostream>
7#include <ranges>
8#include <stdexcept>
9#include <string>
10
17
18namespace porytiles {
19
20/*
21 * NOTE: DO NOT EDIT THIS FILE DIRECTLY. It is AUTO-GENERATED from config_schema.yaml.
22 * To add new config values or make other changes, edit config_schema.yaml and regenerate via:
23 *
24 * uv run scripts/generate_config.py
25 */
26
27namespace {
28
29template <typename T>
30void dump_single_config_value(
31 std::ostream &out, const TextFormatter &format, const std::string &canonical_name,
32 const std::vector<ProvenanceChainLink<T>> &chain)
33{
34 // Section header: bold config name with faint separator
35 out << format.style(canonical_name, Style::bold) << "\n";
36 out << format.style(std::string(canonical_name.size(), '-'), Style::faint) << "\n";
37
38 // Find the winning link (first valid or invalid) for resolved value display
39 const ProvenanceChainLink<T> *winning_link = nullptr;
40 for (const auto &link : chain) {
41 if (link.layer_value.state == ValidationState::valid ||
42 link.layer_value.state == ValidationState::invalid) {
43 winning_link = &link;
44 break;
45 }
46 }
47
48 // Display resolved value using format_config_note, or an error/missing message
49 if (winning_link != nullptr && winning_link->layer_value.state == ValidationState::valid) {
50 ConfigValue<T> config_value{
51 winning_link->layer_value.value.value(),
52 canonical_name,
53 winning_link->layer_value.source_key,
54 winning_link->layer_value.source_info,
55 winning_link->layer_value.source_details};
56 auto note_lines = format_config_note(format, config_value);
57 for (const auto &line : note_lines) {
58 out << " " << line << "\n";
59 }
60 }
61 else if (winning_link != nullptr && winning_link->layer_value.state == ValidationState::invalid) {
62 out << " " << format.style("INVALID: " + winning_link->layer_value.error_message, Style::red) << "\n";
63 }
64 else {
65 out << " " << format.style("(no value found)", Style::faint) << "\n";
66 }
67
68 // Provider chain
69 out << "\n " << format.style("Provider Chain:", Style::faint) << "\n";
70 for (const auto &link : chain) {
71 switch (link.layer_value.state) {
73 if (&link == winning_link) {
74 out << " " << format.style("✓", Style::green) << " " << link.provider_name;
75 out << " = " << format.style(std::format("{}", link.layer_value.value.value()), Style::green);
76 }
77 else {
78 out << " " << format.style("○", Style::faint) << " "
79 << format.style(link.provider_name + " = " + std::format("{}", link.layer_value.value.value()),
81 }
82 break;
84 out << " " << format.style("✗", Style::red) << " " << link.provider_name;
85 out << " " << format.style("INVALID", Style::red);
86 break;
88 out << " " << format.style("○", Style::faint) << " "
89 << format.style(link.provider_name + " (not provided)", Style::faint);
90 break;
91 }
92 out << "\n";
93 }
94 out << "\n";
95}
96
97} // anonymous namespace
98
99void LazyLayeredConfig::add_provider(std::unique_ptr<ConfigProvider> provider)
100{
101 providers_.insert(providers_.begin(), std::move(provider));
102 cache_.clear();
103 cache_value_strings_.clear();
104 source_key_.clear();
105 source_.clear();
106 source_details_.clear();
107}
108
109void LazyLayeredConfig::dump_config(std::ostream &out, ConfigScopeType type, const std::string &scope) const
110{
111 const std::string header_str = "Configuration dump for {} '{}'";
112 auto type_str = to_string(type);
113 std::string header = std::vformat(header_str, std::make_format_args(type_str, scope));
114 out << format_->format(
115 header_str,
117 FormatParam{scope, Style::bold | Style::cyan}) << "\n";
118 out << format_->style(std::string(header.size(), '='), Style::faint) << "\n\n";
119 dump_single_config_value(out, *format_, "Number Of Tiles In Primary", num_tiles_in_primary_provenance_chain(type, scope));
120 dump_single_config_value(out, *format_, "Number Of Tiles Total", num_tiles_total_provenance_chain(type, scope));
121 dump_single_config_value(out, *format_, "Number Of Metatiles In Primary", num_metatiles_in_primary_provenance_chain(type, scope));
122 dump_single_config_value(out, *format_, "Number Of Metatiles Total", num_metatiles_total_provenance_chain(type, scope));
123 dump_single_config_value(out, *format_, "Number Of Palettes In Primary", num_pals_in_primary_provenance_chain(type, scope));
124 dump_single_config_value(out, *format_, "Number Of Palettes Total", num_pals_total_provenance_chain(type, scope));
125 dump_single_config_value(out, *format_, "Max Map Data Size", max_map_data_size_provenance_chain(type, scope));
126 dump_single_config_value(out, *format_, "Number Of Tiles Per Metatile", num_tiles_per_metatile_provenance_chain(type, scope));
127 dump_single_config_value(out, *format_, "Extrinsic Transparency", extrinsic_transparency_provenance_chain(type, scope));
128 dump_single_config_value(out, *format_, "Tiles Edit Mode", tiles_edit_mode_provenance_chain(type, scope));
129 dump_single_config_value(out, *format_, "Palettes Edit Mode", pals_edit_mode_provenance_chain(type, scope));
130 dump_single_config_value(out, *format_, "Palette Hints Enabled", pal_hints_enabled_provenance_chain(type, scope));
131 dump_single_config_value(out, *format_, "Palette Hints", pal_hints_provenance_chain(type, scope));
132 dump_single_config_value(out, *format_, "Packing Strategy", packing_strategy_provenance_chain(type, scope));
133 dump_single_config_value(out, *format_, "Packing Strategy Params", packing_strategy_params_provenance_chain(type, scope));
134 dump_single_config_value(out, *format_, "Tile Sharing Packing", tile_sharing_packing_provenance_chain(type, scope));
135 dump_single_config_value(out, *format_, "Tile Sharing Alignment", tile_sharing_alignment_provenance_chain(type, scope));
136 dump_single_config_value(out, *format_, "Tiles Palette Mode", tiles_pal_mode_provenance_chain(type, scope));
137 dump_single_config_value(out, *format_, "Global Animation Palette Resolution Strategy", global_anim_pal_resolution_strategy_provenance_chain(type, scope));
138 dump_single_config_value(out, *format_, "Global Animation Key Frame Resolution Strategy", global_anim_key_frame_resolution_strategy_provenance_chain(type, scope));
139 dump_single_config_value(out, *format_, "Global Animation Multi-Pal Subtile Resolution Strategy", global_anim_multi_pal_subtile_resolution_strategy_provenance_chain(type, scope));
140 dump_single_config_value(out, *format_, "Global Frame Linking", global_frame_linking_provenance_chain(type, scope));
141 dump_single_config_value(out, *format_, "Per-Animation Overrides", per_anim_overrides_provenance_chain(type, scope));
142 dump_single_config_value(out, *format_, "Cross-Tileset Animation Linking", cross_tileset_anim_linking_provenance_chain(type, scope));
143 dump_single_config_value(out, *format_, "Verify Checksums", verify_checksums_provenance_chain(type, scope));
144 dump_single_config_value(out, *format_, "Primary Pairing Mode", primary_pairing_mode_provenance_chain(type, scope));
145 dump_single_config_value(out, *format_, "Primary Pairing Partners", primary_pairing_partners_provenance_chain(type, scope));
146 dump_single_config_value(out, *format_, "Diagnostic Warnings Exclude", diagnostic_warnings_exclude_provenance_chain(type, scope));
147 dump_single_config_value(out, *format_, "Diagnostic Warnings Include", diagnostic_warnings_include_provenance_chain(type, scope));
148 dump_single_config_value(out, *format_, "Diagnostic Remarks Exclude", diagnostic_remarks_exclude_provenance_chain(type, scope));
149 dump_single_config_value(out, *format_, "Diagnostic Remarks Include", diagnostic_remarks_include_provenance_chain(type, scope));
150 dump_single_config_value(out, *format_, "Tileset Paths Primary Source", tileset_paths_primary_src_provenance_chain(type, scope));
151 dump_single_config_value(out, *format_, "Tileset Paths Primary Bin", tileset_paths_primary_bin_provenance_chain(type, scope));
152 dump_single_config_value(out, *format_, "Tileset Paths Secondary Source", tileset_paths_secondary_src_provenance_chain(type, scope));
153 dump_single_config_value(out, *format_, "Tileset Paths Secondary Bin", tileset_paths_secondary_bin_provenance_chain(type, scope));
154 dump_single_config_value(out, *format_, "Metatile Attribute Size", metatile_attr_size_provenance_chain(type, scope));
155 dump_single_config_value(out, *format_, "Tileset Animations Wire Anim Code", tileset_animations_wire_anim_code_provenance_chain(type, scope));
156}
157
158template <typename T>
159ChainableResult<ConfigValue<T>> LazyLayeredConfig::resolve_config_value(
160 const std::string &cache_key, const std::string &canonical_name, std::function<LayerValue<T>(const ConfigProvider &)> provider_call) const
161{
162 // Check if already cached
163 if (cache_.contains(cache_key)) {
164 T cached_value{};
165 try {
166 cached_value = std::any_cast<T>(cache_.at(cache_key));
167 }
168 catch (const std::bad_any_cast &) {
169 panic(format_->format("bad_any_cast for cache key '{}': cached type does not match requested type", cache_key));
170 }
171 std::string cached_source_key = source_key_.at(cache_key);
172 std::string source = source_.at(cache_key);
173 std::vector<std::string> source_details = source_details_.at(cache_key);
174 return ConfigValue<T>{cached_value, canonical_name, cached_source_key, source, source_details};
175 }
176
177 // Search through providers in priority order
178 for (const auto &provider : providers_) {
179 LayerValue<T> layer_value = provider_call(*provider);
180
181 // Check if provider found an invalid value - stop immediately and return error
182 if (layer_value.state == ValidationState::invalid) {
183 const auto source_info = format_->format("{}", layer_value.source_info);
184 std::vector<std::string> error_lines;
185 error_lines.push_back(format_->format(
186 "Invalid value for '{}' from config source '{}':",
187 FormatParam{canonical_name, Style::bold},
188 FormatParam{source_info, Style::bold}));
189 error_lines.emplace_back();
190 error_lines.push_back(format_->format("{}", layer_value.error_message));
191
192 if (!layer_value.source_details.empty()) {
193 error_lines.emplace_back(""); // Blank line separator
194 for (const auto &detail : layer_value.source_details) {
195 error_lines.push_back(detail);
196 }
197 }
198
199 return FormattableError{error_lines};
200 }
201
202 // Check if provider has a valid value
203 if (layer_value.state == ValidationState::valid) {
204 T resolved_value = layer_value.value.value();
205 cache_[cache_key] = resolved_value;
206 cache_value_strings_[cache_key] = std::format("{}", resolved_value);
207 source_key_[cache_key] = layer_value.source_key;
208 std::string source = format_->format("{}", layer_value.source_info);
209 source_[cache_key] = source;
210 source_details_[cache_key] = layer_value.source_details;
211 return ConfigValue<T>{resolved_value, canonical_name, layer_value.source_key, source, layer_value.source_details};
212 }
213
214 // Otherwise, state is not_provided - continue to next provider
215 if (layer_value.state == ValidationState::not_provided) {
216 continue;
217 }
218
219 panic("hit unexpected ValidationState");
220 }
221
222 // No value found in any layer - this is a programmer error
223 panic(format_->format("no value found for '{}' in any config layer", cache_key));
224}
225
226template <typename T>
227std::vector<ProvenanceChainLink<T>> LazyLayeredConfig::collect_provenance_chain(
228 std::function<LayerValue<T>(const ConfigProvider &)> provider_call) const
229{
230 std::vector<ProvenanceChainLink<T>> chain;
231 chain.reserve(providers_.size());
232
233 for (const auto &provider : providers_) {
234 LayerValue<T> layer_value = provider_call(*provider);
235 chain.push_back(ProvenanceChainLink<T>{provider->name(), std::move(layer_value)});
236 }
237
238 return chain;
239}
240
242{
243 const auto name = extract_function_name();
244 // Strip the _raw suffix from the function name for cache key
245 const auto base_name = name.substr(0, name.size() - 4);
246 const auto key = to_string(type) + ":" + scope + ":" + base_name;
247 return resolve_config_value<std::size_t>(
248 key, "Number Of Tiles In Primary", [&type, &scope](const ConfigProvider &provider) { return provider.num_tiles_in_primary(type, scope); });
249}
250
252{
253 const auto name = extract_function_name();
254 // Strip the _raw suffix from the function name for cache key
255 const auto base_name = name.substr(0, name.size() - 4);
256 const auto key = to_string(type) + ":" + scope + ":" + base_name;
257 return resolve_config_value<std::size_t>(
258 key, "Number Of Tiles Total", [&type, &scope](const ConfigProvider &provider) { return provider.num_tiles_total(type, scope); });
259}
260
262{
263 const auto name = extract_function_name();
264 // Strip the _raw suffix from the function name for cache key
265 const auto base_name = name.substr(0, name.size() - 4);
266 const auto key = to_string(type) + ":" + scope + ":" + base_name;
267 return resolve_config_value<std::size_t>(
268 key, "Number Of Metatiles In Primary", [&type, &scope](const ConfigProvider &provider) { return provider.num_metatiles_in_primary(type, scope); });
269}
270
272{
273 const auto name = extract_function_name();
274 // Strip the _raw suffix from the function name for cache key
275 const auto base_name = name.substr(0, name.size() - 4);
276 const auto key = to_string(type) + ":" + scope + ":" + base_name;
277 return resolve_config_value<std::size_t>(
278 key, "Number Of Metatiles Total", [&type, &scope](const ConfigProvider &provider) { return provider.num_metatiles_total(type, scope); });
279}
280
282{
283 const auto name = extract_function_name();
284 // Strip the _raw suffix from the function name for cache key
285 const auto base_name = name.substr(0, name.size() - 4);
286 const auto key = to_string(type) + ":" + scope + ":" + base_name;
287 return resolve_config_value<std::size_t>(
288 key, "Number Of Palettes In Primary", [&type, &scope](const ConfigProvider &provider) { return provider.num_pals_in_primary(type, scope); });
289}
290
292{
293 const auto name = extract_function_name();
294 // Strip the _raw suffix from the function name for cache key
295 const auto base_name = name.substr(0, name.size() - 4);
296 const auto key = to_string(type) + ":" + scope + ":" + base_name;
297 return resolve_config_value<std::size_t>(
298 key, "Number Of Palettes Total", [&type, &scope](const ConfigProvider &provider) { return provider.num_pals_total(type, scope); });
299}
300
302{
303 const auto name = extract_function_name();
304 // Strip the _raw suffix from the function name for cache key
305 const auto base_name = name.substr(0, name.size() - 4);
306 const auto key = to_string(type) + ":" + scope + ":" + base_name;
307 return resolve_config_value<std::size_t>(
308 key, "Max Map Data Size", [&type, &scope](const ConfigProvider &provider) { return provider.max_map_data_size(type, scope); });
309}
310
312{
313 const auto name = extract_function_name();
314 // Strip the _raw suffix from the function name for cache key
315 const auto base_name = name.substr(0, name.size() - 4);
316 const auto key = to_string(type) + ":" + scope + ":" + base_name;
317 return resolve_config_value<std::size_t>(
318 key, "Number Of Tiles Per Metatile", [&type, &scope](const ConfigProvider &provider) { return provider.num_tiles_per_metatile(type, scope); });
319}
320
322{
323 const auto name = extract_function_name();
324 // Strip the _raw suffix from the function name for cache key
325 const auto base_name = name.substr(0, name.size() - 4);
326 const auto key = to_string(type) + ":" + scope + ":" + base_name;
327 return resolve_config_value<Rgba32>(
328 key, "Extrinsic Transparency", [&type, &scope](const ConfigProvider &provider) { return provider.extrinsic_transparency(type, scope); });
329}
330
332{
333 const auto name = extract_function_name();
334 // Strip the _raw suffix from the function name for cache key
335 const auto base_name = name.substr(0, name.size() - 4);
336 const auto key = to_string(type) + ":" + scope + ":" + base_name;
337 return resolve_config_value<ArtifactEditMode>(
338 key, "Tiles Edit Mode", [&type, &scope](const ConfigProvider &provider) { return provider.tiles_edit_mode(type, scope); });
339}
340
342{
343 const auto name = extract_function_name();
344 // Strip the _raw suffix from the function name for cache key
345 const auto base_name = name.substr(0, name.size() - 4);
346 const auto key = to_string(type) + ":" + scope + ":" + base_name;
347 return resolve_config_value<ArtifactEditMode>(
348 key, "Palettes Edit Mode", [&type, &scope](const ConfigProvider &provider) { return provider.pals_edit_mode(type, scope); });
349}
350
352{
353 const auto name = extract_function_name();
354 // Strip the _raw suffix from the function name for cache key
355 const auto base_name = name.substr(0, name.size() - 4);
356 const auto key = to_string(type) + ":" + scope + ":" + base_name;
357 return resolve_config_value<bool>(
358 key, "Palette Hints Enabled", [&type, &scope](const ConfigProvider &provider) { return provider.pal_hints_enabled(type, scope); });
359}
360
362{
363 const auto name = extract_function_name();
364 // Strip the _raw suffix from the function name for cache key
365 const auto base_name = name.substr(0, name.size() - 4);
366 const auto key = to_string(type) + ":" + scope + ":" + base_name;
367 return resolve_config_value<std::vector<PaletteHint>>(
368 key, "Palette Hints", [&type, &scope](const ConfigProvider &provider) { return provider.pal_hints(type, scope); });
369}
370
372{
373 const auto name = extract_function_name();
374 // Strip the _raw suffix from the function name for cache key
375 const auto base_name = name.substr(0, name.size() - 4);
376 const auto key = to_string(type) + ":" + scope + ":" + base_name;
377 return resolve_config_value<PackingStrategyType>(
378 key, "Packing Strategy", [&type, &scope](const ConfigProvider &provider) { return provider.packing_strategy(type, scope); });
379}
380
382{
383 const auto name = extract_function_name();
384 // Strip the _raw suffix from the function name for cache key
385 const auto base_name = name.substr(0, name.size() - 4);
386 const auto key = to_string(type) + ":" + scope + ":" + base_name;
387 return resolve_config_value<PackingStrategyParams>(
388 key, "Packing Strategy Params", [&type, &scope](const ConfigProvider &provider) { return provider.packing_strategy_params(type, scope); });
389}
390
392{
393 const auto name = extract_function_name();
394 // Strip the _raw suffix from the function name for cache key
395 const auto base_name = name.substr(0, name.size() - 4);
396 const auto key = to_string(type) + ":" + scope + ":" + base_name;
397 return resolve_config_value<TileSharingPacking>(
398 key, "Tile Sharing Packing", [&type, &scope](const ConfigProvider &provider) { return provider.tile_sharing_packing(type, scope); });
399}
400
402{
403 const auto name = extract_function_name();
404 // Strip the _raw suffix from the function name for cache key
405 const auto base_name = name.substr(0, name.size() - 4);
406 const auto key = to_string(type) + ":" + scope + ":" + base_name;
407 return resolve_config_value<TileSharingAlignment>(
408 key, "Tile Sharing Alignment", [&type, &scope](const ConfigProvider &provider) { return provider.tile_sharing_alignment(type, scope); });
409}
410
412{
413 const auto name = extract_function_name();
414 // Strip the _raw suffix from the function name for cache key
415 const auto base_name = name.substr(0, name.size() - 4);
416 const auto key = to_string(type) + ":" + scope + ":" + base_name;
417 return resolve_config_value<TilesPalMode>(
418 key, "Tiles Palette Mode", [&type, &scope](const ConfigProvider &provider) { return provider.tiles_pal_mode(type, scope); });
419}
420
422{
423 const auto name = extract_function_name();
424 // Strip the _raw suffix from the function name for cache key
425 const auto base_name = name.substr(0, name.size() - 4);
426 const auto key = to_string(type) + ":" + scope + ":" + base_name;
427 return resolve_config_value<AnimPalResolutionStrategy>(
428 key, "Global Animation Palette Resolution Strategy", [&type, &scope](const ConfigProvider &provider) { return provider.global_anim_pal_resolution_strategy(type, scope); });
429}
430
432{
433 const auto name = extract_function_name();
434 // Strip the _raw suffix from the function name for cache key
435 const auto base_name = name.substr(0, name.size() - 4);
436 const auto key = to_string(type) + ":" + scope + ":" + base_name;
437 return resolve_config_value<AnimKeyFrameResolutionStrategy>(
438 key, "Global Animation Key Frame Resolution Strategy", [&type, &scope](const ConfigProvider &provider) { return provider.global_anim_key_frame_resolution_strategy(type, scope); });
439}
440
442{
443 const auto name = extract_function_name();
444 // Strip the _raw suffix from the function name for cache key
445 const auto base_name = name.substr(0, name.size() - 4);
446 const auto key = to_string(type) + ":" + scope + ":" + base_name;
447 return resolve_config_value<AnimMultiPalSubtileResolutionStrategy>(
448 key, "Global Animation Multi-Pal Subtile Resolution Strategy", [&type, &scope](const ConfigProvider &provider) { return provider.global_anim_multi_pal_subtile_resolution_strategy(type, scope); });
449}
450
452{
453 const auto name = extract_function_name();
454 // Strip the _raw suffix from the function name for cache key
455 const auto base_name = name.substr(0, name.size() - 4);
456 const auto key = to_string(type) + ":" + scope + ":" + base_name;
457 return resolve_config_value<FrameLinking>(
458 key, "Global Frame Linking", [&type, &scope](const ConfigProvider &provider) { return provider.global_frame_linking(type, scope); });
459}
460
462{
463 const auto name = extract_function_name();
464 // Strip the _raw suffix from the function name for cache key
465 const auto base_name = name.substr(0, name.size() - 4);
466 const auto key = to_string(type) + ":" + scope + ":" + base_name;
467 return resolve_config_value<PerAnimOverrides>(
468 key, "Per-Animation Overrides", [&type, &scope](const ConfigProvider &provider) { return provider.per_anim_overrides(type, scope); });
469}
470
472{
473 const auto name = extract_function_name();
474 // Strip the _raw suffix from the function name for cache key
475 const auto base_name = name.substr(0, name.size() - 4);
476 const auto key = to_string(type) + ":" + scope + ":" + base_name;
477 return resolve_config_value<bool>(
478 key, "Cross-Tileset Animation Linking", [&type, &scope](const ConfigProvider &provider) { return provider.cross_tileset_anim_linking(type, scope); });
479}
480
482{
483 const auto name = extract_function_name();
484 // Strip the _raw suffix from the function name for cache key
485 const auto base_name = name.substr(0, name.size() - 4);
486 const auto key = to_string(type) + ":" + scope + ":" + base_name;
487 return resolve_config_value<bool>(
488 key, "Verify Checksums", [&type, &scope](const ConfigProvider &provider) { return provider.verify_checksums(type, scope); });
489}
490
492{
493 const auto name = extract_function_name();
494 // Strip the _raw suffix from the function name for cache key
495 const auto base_name = name.substr(0, name.size() - 4);
496 const auto key = to_string(type) + ":" + scope + ":" + base_name;
497 return resolve_config_value<PrimaryPairingMode>(
498 key, "Primary Pairing Mode", [&type, &scope](const ConfigProvider &provider) { return provider.primary_pairing_mode(type, scope); });
499}
500
502{
503 const auto name = extract_function_name();
504 // Strip the _raw suffix from the function name for cache key
505 const auto base_name = name.substr(0, name.size() - 4);
506 const auto key = to_string(type) + ":" + scope + ":" + base_name;
507 return resolve_config_value<std::vector<std::string>>(
508 key, "Primary Pairing Partners", [&type, &scope](const ConfigProvider &provider) { return provider.primary_pairing_partners(type, scope); });
509}
510
512{
513 const auto name = extract_function_name();
514 // Strip the _raw suffix from the function name for cache key
515 const auto base_name = name.substr(0, name.size() - 4);
516 const auto key = to_string(type) + ":" + scope + ":" + base_name;
517 return resolve_config_value<std::vector<std::string>>(
518 key, "Diagnostic Warnings Exclude", [&type, &scope](const ConfigProvider &provider) { return provider.diagnostic_warnings_exclude(type, scope); });
519}
520
522{
523 const auto name = extract_function_name();
524 // Strip the _raw suffix from the function name for cache key
525 const auto base_name = name.substr(0, name.size() - 4);
526 const auto key = to_string(type) + ":" + scope + ":" + base_name;
527 return resolve_config_value<std::vector<std::string>>(
528 key, "Diagnostic Warnings Include", [&type, &scope](const ConfigProvider &provider) { return provider.diagnostic_warnings_include(type, scope); });
529}
530
532{
533 const auto name = extract_function_name();
534 // Strip the _raw suffix from the function name for cache key
535 const auto base_name = name.substr(0, name.size() - 4);
536 const auto key = to_string(type) + ":" + scope + ":" + base_name;
537 return resolve_config_value<std::vector<std::string>>(
538 key, "Diagnostic Remarks Exclude", [&type, &scope](const ConfigProvider &provider) { return provider.diagnostic_remarks_exclude(type, scope); });
539}
540
542{
543 const auto name = extract_function_name();
544 // Strip the _raw suffix from the function name for cache key
545 const auto base_name = name.substr(0, name.size() - 4);
546 const auto key = to_string(type) + ":" + scope + ":" + base_name;
547 return resolve_config_value<std::vector<std::string>>(
548 key, "Diagnostic Remarks Include", [&type, &scope](const ConfigProvider &provider) { return provider.diagnostic_remarks_include(type, scope); });
549}
550
552{
553 const auto name = extract_function_name();
554 // Strip the _raw suffix from the function name for cache key
555 const auto base_name = name.substr(0, name.size() - 4);
556 const auto key = to_string(type) + ":" + scope + ":" + base_name;
557 return resolve_config_value<std::string>(
558 key, "Tileset Paths Primary Source", [&type, &scope](const ConfigProvider &provider) { return provider.tileset_paths_primary_src(type, scope); });
559}
560
562{
563 const auto name = extract_function_name();
564 // Strip the _raw suffix from the function name for cache key
565 const auto base_name = name.substr(0, name.size() - 4);
566 const auto key = to_string(type) + ":" + scope + ":" + base_name;
567 return resolve_config_value<std::string>(
568 key, "Tileset Paths Primary Bin", [&type, &scope](const ConfigProvider &provider) { return provider.tileset_paths_primary_bin(type, scope); });
569}
570
572{
573 const auto name = extract_function_name();
574 // Strip the _raw suffix from the function name for cache key
575 const auto base_name = name.substr(0, name.size() - 4);
576 const auto key = to_string(type) + ":" + scope + ":" + base_name;
577 return resolve_config_value<std::string>(
578 key, "Tileset Paths Secondary Source", [&type, &scope](const ConfigProvider &provider) { return provider.tileset_paths_secondary_src(type, scope); });
579}
580
582{
583 const auto name = extract_function_name();
584 // Strip the _raw suffix from the function name for cache key
585 const auto base_name = name.substr(0, name.size() - 4);
586 const auto key = to_string(type) + ":" + scope + ":" + base_name;
587 return resolve_config_value<std::string>(
588 key, "Tileset Paths Secondary Bin", [&type, &scope](const ConfigProvider &provider) { return provider.tileset_paths_secondary_bin(type, scope); });
589}
590
592{
593 const auto name = extract_function_name();
594 // Strip the _raw suffix from the function name for cache key
595 const auto base_name = name.substr(0, name.size() - 4);
596 const auto key = to_string(type) + ":" + scope + ":" + base_name;
597 return resolve_config_value<std::size_t>(
598 key, "Metatile Attribute Size", [&type, &scope](const ConfigProvider &provider) { return provider.metatile_attr_size(type, scope); });
599}
600
602{
603 const auto name = extract_function_name();
604 // Strip the _raw suffix from the function name for cache key
605 const auto base_name = name.substr(0, name.size() - 4);
606 const auto key = to_string(type) + ":" + scope + ":" + base_name;
607 return resolve_config_value<bool>(
608 key, "Tileset Animations Wire Anim Code", [&type, &scope](const ConfigProvider &provider) { return provider.tileset_animations_wire_anim_code(type, scope); });
609}
610
611std::vector<ProvenanceChainLink<std::size_t>>
613{
614 return collect_provenance_chain<std::size_t>(
615 [&type, &scope](const ConfigProvider &provider) { return provider.num_tiles_in_primary(type, scope); });
616}
617
618std::vector<ProvenanceChainLink<std::size_t>>
620{
621 return collect_provenance_chain<std::size_t>(
622 [&type, &scope](const ConfigProvider &provider) { return provider.num_tiles_total(type, scope); });
623}
624
625std::vector<ProvenanceChainLink<std::size_t>>
627{
628 return collect_provenance_chain<std::size_t>(
629 [&type, &scope](const ConfigProvider &provider) { return provider.num_metatiles_in_primary(type, scope); });
630}
631
632std::vector<ProvenanceChainLink<std::size_t>>
634{
635 return collect_provenance_chain<std::size_t>(
636 [&type, &scope](const ConfigProvider &provider) { return provider.num_metatiles_total(type, scope); });
637}
638
639std::vector<ProvenanceChainLink<std::size_t>>
641{
642 return collect_provenance_chain<std::size_t>(
643 [&type, &scope](const ConfigProvider &provider) { return provider.num_pals_in_primary(type, scope); });
644}
645
646std::vector<ProvenanceChainLink<std::size_t>>
648{
649 return collect_provenance_chain<std::size_t>(
650 [&type, &scope](const ConfigProvider &provider) { return provider.num_pals_total(type, scope); });
651}
652
653std::vector<ProvenanceChainLink<std::size_t>>
655{
656 return collect_provenance_chain<std::size_t>(
657 [&type, &scope](const ConfigProvider &provider) { return provider.max_map_data_size(type, scope); });
658}
659
660std::vector<ProvenanceChainLink<std::size_t>>
662{
663 return collect_provenance_chain<std::size_t>(
664 [&type, &scope](const ConfigProvider &provider) { return provider.num_tiles_per_metatile(type, scope); });
665}
666
667std::vector<ProvenanceChainLink<Rgba32>>
669{
670 return collect_provenance_chain<Rgba32>(
671 [&type, &scope](const ConfigProvider &provider) { return provider.extrinsic_transparency(type, scope); });
672}
673
674std::vector<ProvenanceChainLink<ArtifactEditMode>>
676{
677 return collect_provenance_chain<ArtifactEditMode>(
678 [&type, &scope](const ConfigProvider &provider) { return provider.tiles_edit_mode(type, scope); });
679}
680
681std::vector<ProvenanceChainLink<ArtifactEditMode>>
683{
684 return collect_provenance_chain<ArtifactEditMode>(
685 [&type, &scope](const ConfigProvider &provider) { return provider.pals_edit_mode(type, scope); });
686}
687
688std::vector<ProvenanceChainLink<bool>>
690{
691 return collect_provenance_chain<bool>(
692 [&type, &scope](const ConfigProvider &provider) { return provider.pal_hints_enabled(type, scope); });
693}
694
695std::vector<ProvenanceChainLink<std::vector<PaletteHint>>>
697{
698 return collect_provenance_chain<std::vector<PaletteHint>>(
699 [&type, &scope](const ConfigProvider &provider) { return provider.pal_hints(type, scope); });
700}
701
702std::vector<ProvenanceChainLink<PackingStrategyType>>
704{
705 return collect_provenance_chain<PackingStrategyType>(
706 [&type, &scope](const ConfigProvider &provider) { return provider.packing_strategy(type, scope); });
707}
708
709std::vector<ProvenanceChainLink<PackingStrategyParams>>
711{
712 return collect_provenance_chain<PackingStrategyParams>(
713 [&type, &scope](const ConfigProvider &provider) { return provider.packing_strategy_params(type, scope); });
714}
715
716std::vector<ProvenanceChainLink<TileSharingPacking>>
718{
719 return collect_provenance_chain<TileSharingPacking>(
720 [&type, &scope](const ConfigProvider &provider) { return provider.tile_sharing_packing(type, scope); });
721}
722
723std::vector<ProvenanceChainLink<TileSharingAlignment>>
725{
726 return collect_provenance_chain<TileSharingAlignment>(
727 [&type, &scope](const ConfigProvider &provider) { return provider.tile_sharing_alignment(type, scope); });
728}
729
730std::vector<ProvenanceChainLink<TilesPalMode>>
732{
733 return collect_provenance_chain<TilesPalMode>(
734 [&type, &scope](const ConfigProvider &provider) { return provider.tiles_pal_mode(type, scope); });
735}
736
737std::vector<ProvenanceChainLink<AnimPalResolutionStrategy>>
739{
740 return collect_provenance_chain<AnimPalResolutionStrategy>(
741 [&type, &scope](const ConfigProvider &provider) { return provider.global_anim_pal_resolution_strategy(type, scope); });
742}
743
744std::vector<ProvenanceChainLink<AnimKeyFrameResolutionStrategy>>
746{
747 return collect_provenance_chain<AnimKeyFrameResolutionStrategy>(
748 [&type, &scope](const ConfigProvider &provider) { return provider.global_anim_key_frame_resolution_strategy(type, scope); });
749}
750
751std::vector<ProvenanceChainLink<AnimMultiPalSubtileResolutionStrategy>>
753{
754 return collect_provenance_chain<AnimMultiPalSubtileResolutionStrategy>(
755 [&type, &scope](const ConfigProvider &provider) { return provider.global_anim_multi_pal_subtile_resolution_strategy(type, scope); });
756}
757
758std::vector<ProvenanceChainLink<FrameLinking>>
760{
761 return collect_provenance_chain<FrameLinking>(
762 [&type, &scope](const ConfigProvider &provider) { return provider.global_frame_linking(type, scope); });
763}
764
765std::vector<ProvenanceChainLink<PerAnimOverrides>>
767{
768 return collect_provenance_chain<PerAnimOverrides>(
769 [&type, &scope](const ConfigProvider &provider) { return provider.per_anim_overrides(type, scope); });
770}
771
772std::vector<ProvenanceChainLink<bool>>
774{
775 return collect_provenance_chain<bool>(
776 [&type, &scope](const ConfigProvider &provider) { return provider.cross_tileset_anim_linking(type, scope); });
777}
778
779std::vector<ProvenanceChainLink<bool>>
781{
782 return collect_provenance_chain<bool>(
783 [&type, &scope](const ConfigProvider &provider) { return provider.verify_checksums(type, scope); });
784}
785
786std::vector<ProvenanceChainLink<PrimaryPairingMode>>
788{
789 return collect_provenance_chain<PrimaryPairingMode>(
790 [&type, &scope](const ConfigProvider &provider) { return provider.primary_pairing_mode(type, scope); });
791}
792
793std::vector<ProvenanceChainLink<std::vector<std::string>>>
795{
796 return collect_provenance_chain<std::vector<std::string>>(
797 [&type, &scope](const ConfigProvider &provider) { return provider.primary_pairing_partners(type, scope); });
798}
799
800std::vector<ProvenanceChainLink<std::vector<std::string>>>
802{
803 return collect_provenance_chain<std::vector<std::string>>(
804 [&type, &scope](const ConfigProvider &provider) { return provider.diagnostic_warnings_exclude(type, scope); });
805}
806
807std::vector<ProvenanceChainLink<std::vector<std::string>>>
809{
810 return collect_provenance_chain<std::vector<std::string>>(
811 [&type, &scope](const ConfigProvider &provider) { return provider.diagnostic_warnings_include(type, scope); });
812}
813
814std::vector<ProvenanceChainLink<std::vector<std::string>>>
816{
817 return collect_provenance_chain<std::vector<std::string>>(
818 [&type, &scope](const ConfigProvider &provider) { return provider.diagnostic_remarks_exclude(type, scope); });
819}
820
821std::vector<ProvenanceChainLink<std::vector<std::string>>>
823{
824 return collect_provenance_chain<std::vector<std::string>>(
825 [&type, &scope](const ConfigProvider &provider) { return provider.diagnostic_remarks_include(type, scope); });
826}
827
828std::vector<ProvenanceChainLink<std::string>>
830{
831 return collect_provenance_chain<std::string>(
832 [&type, &scope](const ConfigProvider &provider) { return provider.tileset_paths_primary_src(type, scope); });
833}
834
835std::vector<ProvenanceChainLink<std::string>>
837{
838 return collect_provenance_chain<std::string>(
839 [&type, &scope](const ConfigProvider &provider) { return provider.tileset_paths_primary_bin(type, scope); });
840}
841
842std::vector<ProvenanceChainLink<std::string>>
844{
845 return collect_provenance_chain<std::string>(
846 [&type, &scope](const ConfigProvider &provider) { return provider.tileset_paths_secondary_src(type, scope); });
847}
848
849std::vector<ProvenanceChainLink<std::string>>
851{
852 return collect_provenance_chain<std::string>(
853 [&type, &scope](const ConfigProvider &provider) { return provider.tileset_paths_secondary_bin(type, scope); });
854}
855
856std::vector<ProvenanceChainLink<std::size_t>>
858{
859 return collect_provenance_chain<std::size_t>(
860 [&type, &scope](const ConfigProvider &provider) { return provider.metatile_attr_size(type, scope); });
861}
862
863std::vector<ProvenanceChainLink<bool>>
865{
866 return collect_provenance_chain<bool>(
867 [&type, &scope](const ConfigProvider &provider) { return provider.tileset_animations_wire_anim_code(type, scope); });
868}
869
870} // namespace porytiles
A result type that maintains a chainable sequence of errors for debugging and error reporting.
An interface which config implementations can use to load config values.
virtual LayerValue< ArtifactEditMode > pals_edit_mode(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< PerAnimOverrides > per_anim_overrides(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< Rgba32 > extrinsic_transparency(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< TileSharingPacking > tile_sharing_packing(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< PackingStrategyParams > packing_strategy_params(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< AnimPalResolutionStrategy > global_anim_pal_resolution_strategy(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::size_t > metatile_attr_size(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< TilesPalMode > tiles_pal_mode(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< ArtifactEditMode > tiles_edit_mode(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::size_t > max_map_data_size(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< bool > pal_hints_enabled(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< bool > verify_checksums(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< FrameLinking > global_frame_linking(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< TileSharingAlignment > tile_sharing_alignment(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::size_t > num_metatiles_in_primary(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< PrimaryPairingMode > primary_pairing_mode(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::string > tileset_paths_secondary_bin(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< PackingStrategyType > packing_strategy(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< AnimKeyFrameResolutionStrategy > global_anim_key_frame_resolution_strategy(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::size_t > num_tiles_total(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::string > tileset_paths_primary_src(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::string > tileset_paths_secondary_src(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::size_t > num_pals_total(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::string > tileset_paths_primary_bin(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::size_t > num_pals_in_primary(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< bool > cross_tileset_anim_linking(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::size_t > num_metatiles_total(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::size_t > num_tiles_per_metatile(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< std::size_t > num_tiles_in_primary(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< AnimMultiPalSubtileResolutionStrategy > global_anim_multi_pal_subtile_resolution_strategy(ConfigScopeType type, const std::string &scope) const
virtual LayerValue< bool > tileset_animations_wire_anim_code(ConfigScopeType type, const std::string &scope) const
A text parameter with associated styling for formatted output.
ChainableResult< ConfigValue< std::vector< std::string > > > diagnostic_warnings_exclude_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::string > > tileset_paths_primary_src_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tileset_paths_primary_src.
std::vector< ProvenanceChainLink< bool > > pal_hints_enabled_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for pal_hints_enabled.
std::vector< ProvenanceChainLink< bool > > tileset_animations_wire_anim_code_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tileset_animations_wire_anim_code.
ChainableResult< ConfigValue< ArtifactEditMode > > pals_edit_mode_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::string > > tileset_paths_primary_bin_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< bool > > verify_checksums_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for verify_checksums.
std::vector< ProvenanceChainLink< FrameLinking > > global_frame_linking_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for global_frame_linking.
std::vector< ProvenanceChainLink< std::vector< std::string > > > diagnostic_remarks_exclude_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for diagnostic_remarks_exclude.
ChainableResult< ConfigValue< std::size_t > > num_metatiles_total_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::vector< std::string > > > primary_pairing_partners_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for primary_pairing_partners.
std::vector< ProvenanceChainLink< std::size_t > > max_map_data_size_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for max_map_data_size.
ChainableResult< ConfigValue< AnimMultiPalSubtileResolutionStrategy > > global_anim_multi_pal_subtile_resolution_strategy_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< FrameLinking > > global_frame_linking_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::size_t > > num_tiles_total_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::size_t > > num_pals_in_primary_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::vector< PaletteHint > > > pal_hints_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::size_t > > num_pals_total_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::string > > tileset_paths_secondary_bin_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< TileSharingPacking > > tile_sharing_packing_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tile_sharing_packing.
ChainableResult< ConfigValue< PerAnimOverrides > > per_anim_overrides_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< PackingStrategyParams > > packing_strategy_params_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< Rgba32 > > extrinsic_transparency_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::vector< std::string > > > diagnostic_remarks_include_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::vector< std::string > > > diagnostic_warnings_exclude_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for diagnostic_warnings_exclude.
ChainableResult< ConfigValue< bool > > cross_tileset_anim_linking_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< Rgba32 > > extrinsic_transparency_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for extrinsic_transparency.
std::vector< ProvenanceChainLink< std::size_t > > num_metatiles_in_primary_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_metatiles_in_primary.
ChainableResult< ConfigValue< std::size_t > > num_metatiles_in_primary_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< AnimMultiPalSubtileResolutionStrategy > > global_anim_multi_pal_subtile_resolution_strategy_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for global_anim_multi_pal_subtile_resolution_strategy.
std::vector< ProvenanceChainLink< std::size_t > > num_tiles_in_primary_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_tiles_in_primary.
std::vector< ProvenanceChainLink< std::vector< std::string > > > diagnostic_warnings_include_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for diagnostic_warnings_include.
std::vector< ProvenanceChainLink< std::string > > tileset_paths_secondary_src_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tileset_paths_secondary_src.
ChainableResult< ConfigValue< std::size_t > > num_tiles_in_primary_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::size_t > > num_tiles_per_metatile_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< bool > > pal_hints_enabled_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::vector< std::string > > > diagnostic_remarks_exclude_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< PackingStrategyType > > packing_strategy_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< TilesPalMode > > tiles_pal_mode_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::size_t > > num_tiles_per_metatile_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_tiles_per_metatile.
std::vector< ProvenanceChainLink< PerAnimOverrides > > per_anim_overrides_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for per_anim_overrides.
std::vector< ProvenanceChainLink< ArtifactEditMode > > tiles_edit_mode_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tiles_edit_mode.
std::vector< ProvenanceChainLink< AnimKeyFrameResolutionStrategy > > global_anim_key_frame_resolution_strategy_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for global_anim_key_frame_resolution_strategy.
std::vector< ProvenanceChainLink< std::size_t > > num_pals_total_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_pals_total.
ChainableResult< ConfigValue< bool > > verify_checksums_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< bool > > cross_tileset_anim_linking_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for cross_tileset_anim_linking.
std::vector< ProvenanceChainLink< std::size_t > > num_metatiles_total_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_metatiles_total.
std::vector< ProvenanceChainLink< AnimPalResolutionStrategy > > global_anim_pal_resolution_strategy_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for global_anim_pal_resolution_strategy.
std::vector< ProvenanceChainLink< std::vector< std::string > > > diagnostic_remarks_include_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for diagnostic_remarks_include.
std::vector< ProvenanceChainLink< TileSharingAlignment > > tile_sharing_alignment_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tile_sharing_alignment.
ChainableResult< ConfigValue< TileSharingPacking > > tile_sharing_packing_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< PrimaryPairingMode > > primary_pairing_mode_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< bool > > tileset_animations_wire_anim_code_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::size_t > > metatile_attr_size_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< PrimaryPairingMode > > primary_pairing_mode_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for primary_pairing_mode.
ChainableResult< ConfigValue< AnimPalResolutionStrategy > > global_anim_pal_resolution_strategy_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::string > > tileset_paths_secondary_bin_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tileset_paths_secondary_bin.
std::vector< ProvenanceChainLink< std::vector< PaletteHint > > > pal_hints_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for pal_hints.
std::vector< ProvenanceChainLink< std::size_t > > num_tiles_total_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_tiles_total.
ChainableResult< ConfigValue< std::string > > tileset_paths_primary_src_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::size_t > > num_pals_in_primary_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_pals_in_primary.
ChainableResult< ConfigValue< std::vector< std::string > > > diagnostic_warnings_include_raw(ConfigScopeType type, const std::string &scope) const override
void dump_config(std::ostream &out, ConfigScopeType type, const std::string &scope) const
Dumps the full provenance chain for all config values to an output stream.
void add_provider(std::unique_ptr< ConfigProvider > provider) override
Prepends a ConfigProvider to the provider chain at highest priority and invalidates resolution caches...
ChainableResult< ConfigValue< std::vector< std::string > > > primary_pairing_partners_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< TileSharingAlignment > > tile_sharing_alignment_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::size_t > > max_map_data_size_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< std::size_t > > metatile_attr_size_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for metatile_attr_size.
std::vector< ProvenanceChainLink< std::string > > tileset_paths_primary_bin_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tileset_paths_primary_bin.
std::vector< ProvenanceChainLink< ArtifactEditMode > > pals_edit_mode_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for pals_edit_mode.
std::vector< ProvenanceChainLink< PackingStrategyType > > packing_strategy_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for packing_strategy.
ChainableResult< ConfigValue< std::string > > tileset_paths_secondary_src_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< AnimKeyFrameResolutionStrategy > > global_anim_key_frame_resolution_strategy_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< PackingStrategyParams > > packing_strategy_params_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for packing_strategy_params.
std::vector< ProvenanceChainLink< TilesPalMode > > tiles_pal_mode_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tiles_pal_mode.
ChainableResult< ConfigValue< ArtifactEditMode > > tiles_edit_mode_raw(ConfigScopeType type, const std::string &scope) const override
static const Style faint
Faint text formatting.
static const Style red
Red foreground color.
static const Style cyan
Cyan foreground color.
static const Style bold
Bold text formatting.
static const Style green
Green foreground color.
virtual std::string style(const std::string &text, Style styles) const =0
Applies styling to a text string.
virtual std::string format(const std::string &format_str, const std::vector< FormatParam > &params) const
Formats a string with styled parameters using fmtlib syntax.
void panic(const StringViewSourceLoc &s)
Unconditionally terminates the program with a panic message.
Definition panic.cpp:43
std::string extract_function_name(const std::source_location &location=std::source_location::current())
Extracts the function name from a source location.
std::vector< std::string > format_config_note(const TextFormatter &format, const ConfigValue< T > &config)
Format a ConfigValue into diagnostic note lines.
ConfigScopeType
Specifies the scope type for configuration value lookups.
std::string to_string(const PrimaryPairingMode m)
Converts a PrimaryPairingMode to its canonical string representation.
A small container that holds an optional-wrapped value, validation state, and metadata about the valu...