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// NOTE: DO NOT EDIT THIS FILE DIRECTLY. It is AUTO-GENERATED from config_schema.yaml.
21// To add new config values or make other changes, edit config_schema.yaml and regenerate via:
22//
23// uv run scripts/generate_config.py
24
25namespace {
26
27template <typename T>
28void dump_single_config_value(
29 std::ostream &out,
30 const TextFormatter &format,
31 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 || link.layer_value.state == ValidationState::invalid) {
42 winning_link = &link;
43 break;
44 }
45 }
46
47 // Display resolved value using format_config_note, or an error/missing message
48 if (winning_link != nullptr && winning_link->layer_value.state == ValidationState::valid) {
49 ConfigValue<T> config_value{
50 winning_link->layer_value.value.value(),
51 canonical_name,
52 winning_link->layer_value.source_key,
53 winning_link->layer_value.source_info,
54 winning_link->layer_value.source_details};
55 auto note_lines = format_config_note(format, config_value);
56 for (const auto &line : note_lines) {
57 out << " " << line << "\n";
58 }
59 }
60 else if (winning_link != nullptr && winning_link->layer_value.state == ValidationState::invalid) {
61 out << " " << format.style("INVALID: " + winning_link->layer_value.error_message, Style::red) << "\n";
62 }
63 else {
64 out << " " << format.style("(no value found)", Style::faint) << "\n";
65 }
66
67 // Provider chain
68 out << "\n " << format.style("Provider Chain:", Style::faint) << "\n";
69 for (const auto &link : chain) {
70 switch (link.layer_value.state) {
72 if (&link == winning_link) {
73 out << " " << format.style("✓", Style::green) << " " << link.provider_name;
74 out << " = " << format.style(std::format("{}", link.layer_value.value.value()), Style::green);
75 }
76 else {
77 out << " " << format.style("○", Style::faint) << " "
78 << format.style(
79 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(
116 << "\n";
117 out << format_->style(std::string(header.size(), '='), Style::faint) << "\n\n";
118 dump_single_config_value(
119 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(
122 out, *format_, "Number Of Metatiles In Primary", num_metatiles_in_primary_provenance_chain(type, scope));
123 dump_single_config_value(
124 out, *format_, "Number Of Metatiles Total", num_metatiles_total_provenance_chain(type, scope));
125 dump_single_config_value(
126 out, *format_, "Number Of Palettes In Primary", num_palettes_in_primary_provenance_chain(type, scope));
127 dump_single_config_value(
128 out, *format_, "Number Of Palettes Total", num_palettes_total_provenance_chain(type, scope));
129 dump_single_config_value(out, *format_, "Max Map Data Size", max_map_data_size_provenance_chain(type, scope));
130 dump_single_config_value(
131 out, *format_, "Number Of Tiles Per Metatile", num_tiles_per_metatile_provenance_chain(type, scope));
132 dump_single_config_value(
133 out, *format_, "Extrinsic Transparency", extrinsic_transparency_provenance_chain(type, scope));
134 dump_single_config_value(
135 out, *format_, "Ignore Triple Layer Content", ignore_triple_layer_content_provenance_chain(type, scope));
136 dump_single_config_value(out, *format_, "Tiles Edit Mode", tiles_edit_mode_provenance_chain(type, scope));
137 dump_single_config_value(out, *format_, "Palettes Edit Mode", palettes_edit_mode_provenance_chain(type, scope));
138 dump_single_config_value(
139 out, *format_, "Palette Hints Enabled", palette_hints_enabled_provenance_chain(type, scope));
140 dump_single_config_value(out, *format_, "Palette Hints", palette_hints_provenance_chain(type, scope));
141 dump_single_config_value(out, *format_, "Packing Strategy", packing_strategy_provenance_chain(type, scope));
142 dump_single_config_value(
143 out, *format_, "Packing Strategy Params", packing_strategy_params_provenance_chain(type, scope));
144 dump_single_config_value(out, *format_, "Tile Sharing Packing", tile_sharing_packing_provenance_chain(type, scope));
145 dump_single_config_value(
146 out, *format_, "Tile Sharing Alignment", tile_sharing_alignment_provenance_chain(type, scope));
147 dump_single_config_value(out, *format_, "Tiles Palette Mode", tiles_palette_mode_provenance_chain(type, scope));
148 dump_single_config_value(
149 out,
150 *format_,
151 "Global Animation Palette Resolution Strategy",
153 dump_single_config_value(
154 out,
155 *format_,
156 "Global Animation Key Frame Resolution Strategy",
158 dump_single_config_value(
159 out,
160 *format_,
161 "Global Animation Multi-Palette Subtile Resolution Strategy",
163 dump_single_config_value(out, *format_, "Global Frame Linking", global_frame_linking_provenance_chain(type, scope));
164 dump_single_config_value(
165 out, *format_, "Per-Animation Overrides", per_anim_overrides_provenance_chain(type, scope));
166 dump_single_config_value(
167 out, *format_, "Cross-Tileset Animation Linking", cross_tileset_anim_linking_provenance_chain(type, scope));
168 dump_single_config_value(out, *format_, "Verify Checksums", verify_checksums_provenance_chain(type, scope));
169 dump_single_config_value(out, *format_, "Primary Pairing Mode", primary_pairing_mode_provenance_chain(type, scope));
170 dump_single_config_value(
171 out, *format_, "Primary Pairing Partners", primary_pairing_partners_provenance_chain(type, scope));
172 dump_single_config_value(
173 out, *format_, "Diagnostic Warnings Exclude", diagnostic_warnings_exclude_provenance_chain(type, scope));
174 dump_single_config_value(
175 out, *format_, "Diagnostic Warnings Include", diagnostic_warnings_include_provenance_chain(type, scope));
176 dump_single_config_value(
177 out, *format_, "Diagnostic Remarks Exclude", diagnostic_remarks_exclude_provenance_chain(type, scope));
178 dump_single_config_value(
179 out, *format_, "Diagnostic Remarks Include", diagnostic_remarks_include_provenance_chain(type, scope));
180 dump_single_config_value(
181 out, *format_, "Tileset Paths Primary Source", tileset_paths_primary_src_provenance_chain(type, scope));
182 dump_single_config_value(
183 out, *format_, "Tileset Paths Primary Bin", tileset_paths_primary_bin_provenance_chain(type, scope));
184 dump_single_config_value(
185 out, *format_, "Tileset Paths Secondary Source", tileset_paths_secondary_src_provenance_chain(type, scope));
186 dump_single_config_value(
187 out, *format_, "Tileset Paths Secondary Bin", tileset_paths_secondary_bin_provenance_chain(type, scope));
188 dump_single_config_value(
189 out, *format_, "Metatile Attribute Size", metatile_attribute_size_provenance_chain(type, scope));
190 dump_single_config_value(
191 out,
192 *format_,
193 "Metatile Attribute Declaration Size",
195 dump_single_config_value(
196 out, *format_, "Metatile Attribute Fields", metatile_attribute_fields_provenance_chain(type, scope));
197 dump_single_config_value(
198 out,
199 *format_,
200 "Metatile Attribute Field Overrides",
202 dump_single_config_value(out, *format_, "Role Pins", role_pins_provenance_chain(type, scope));
203 dump_single_config_value(
204 out,
205 *format_,
206 "Tileset Animations Wire Anim Code",
208}
209
210template <typename T>
211ChainableResult<ConfigValue<T>> LazyLayeredConfig::resolve_config_value(
212 const std::string &cache_key,
213 const std::string &canonical_name,
214 std::function<LayerValue<T>(const ConfigProvider &)> provider_call) const
215{
216 // Check if already cached
217 if (cache_.contains(cache_key)) {
218 T cached_value{};
219 try {
220 cached_value = std::any_cast<T>(cache_.at(cache_key));
221 }
222 catch (const std::bad_any_cast &) {
223 panic(format_->format(
224 "bad_any_cast for cache key '{}': cached type does not match requested type", cache_key));
225 }
226 std::string cached_source_key = source_key_.at(cache_key);
227 std::string source = source_.at(cache_key);
228 std::vector<std::string> source_details = source_details_.at(cache_key);
229 return ConfigValue<T>{cached_value, canonical_name, cached_source_key, source, source_details};
230 }
231
232 // Search through providers in priority order
233 for (const auto &provider : providers_) {
234 LayerValue<T> layer_value = provider_call(*provider);
235
236 // Check if provider found an invalid value - stop immediately and return error
237 if (layer_value.state == ValidationState::invalid) {
238 const auto source_info = format_->format("{}", layer_value.source_info);
239 std::vector<std::string> error_lines;
240 error_lines.push_back(format_->format(
241 "Invalid value for '{}' from config source '{}':",
242 FormatParam{canonical_name, Style::bold},
243 FormatParam{source_info, Style::bold}));
244 error_lines.emplace_back();
245 error_lines.push_back(format_->format("{}", layer_value.error_message));
246
247 if (!layer_value.source_details.empty()) {
248 error_lines.emplace_back(""); // Blank line separator
249 for (const auto &detail : layer_value.source_details) {
250 error_lines.push_back(detail);
251 }
252 }
253
254 return FormattableError{error_lines};
255 }
256
257 // Check if provider has a valid value
258 if (layer_value.state == ValidationState::valid) {
259 T resolved_value = layer_value.value.value();
260 cache_[cache_key] = resolved_value;
261 cache_value_strings_[cache_key] = std::format("{}", resolved_value);
262 source_key_[cache_key] = layer_value.source_key;
263 std::string source = format_->format("{}", layer_value.source_info);
264 source_[cache_key] = source;
265 source_details_[cache_key] = layer_value.source_details;
266 return ConfigValue<T>{
267 resolved_value, canonical_name, layer_value.source_key, source, layer_value.source_details};
268 }
269
270 // Otherwise, state is not_provided - continue to next provider
271 if (layer_value.state == ValidationState::not_provided) {
272 continue;
273 }
274
275 panic("hit unexpected ValidationState");
276 }
277
278 // No value found in any layer - this is a programmer error
279 panic(format_->format("no value found for '{}' in any config layer", cache_key));
280}
281
282template <typename T>
283std::vector<ProvenanceChainLink<T>>
284LazyLayeredConfig::collect_provenance_chain(std::function<LayerValue<T>(const ConfigProvider &)> provider_call) const
285{
286 std::vector<ProvenanceChainLink<T>> chain;
287 chain.reserve(providers_.size());
288
289 for (const auto &provider : providers_) {
290 LayerValue<T> layer_value = provider_call(*provider);
291 chain.push_back(ProvenanceChainLink<T>{provider->name(), std::move(layer_value)});
292 }
293
294 return chain;
295}
296
297ChainableResult<ConfigValue<std::size_t>>
299{
300 const auto name = extract_function_name();
301 // Strip the _raw suffix from the function name for cache key
302 const auto base_name = name.substr(0, name.size() - 4);
303 const auto key = to_string(type) + ":" + scope + ":" + base_name;
304 return resolve_config_value<std::size_t>(
305 key, "Number Of Tiles In Primary", [&type, &scope](const ConfigProvider &provider) {
306 return provider.num_tiles_in_primary(type, scope);
307 });
308}
309
311LazyLayeredConfig::num_tiles_total_raw(ConfigScopeType type, const std::string &scope) const
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 Total", [&type, &scope](const ConfigProvider &provider) {
319 return provider.num_tiles_total(type, scope);
320 });
321}
322
325{
326 const auto name = extract_function_name();
327 // Strip the _raw suffix from the function name for cache key
328 const auto base_name = name.substr(0, name.size() - 4);
329 const auto key = to_string(type) + ":" + scope + ":" + base_name;
330 return resolve_config_value<std::size_t>(
331 key, "Number Of Metatiles In Primary", [&type, &scope](const ConfigProvider &provider) {
332 return provider.num_metatiles_in_primary(type, scope);
333 });
334}
335
338{
339 const auto name = extract_function_name();
340 // Strip the _raw suffix from the function name for cache key
341 const auto base_name = name.substr(0, name.size() - 4);
342 const auto key = to_string(type) + ":" + scope + ":" + base_name;
343 return resolve_config_value<std::size_t>(
344 key, "Number Of Metatiles Total", [&type, &scope](const ConfigProvider &provider) {
345 return provider.num_metatiles_total(type, scope);
346 });
347}
348
351{
352 const auto name = extract_function_name();
353 // Strip the _raw suffix from the function name for cache key
354 const auto base_name = name.substr(0, name.size() - 4);
355 const auto key = to_string(type) + ":" + scope + ":" + base_name;
356 return resolve_config_value<std::size_t>(
357 key, "Number Of Palettes In Primary", [&type, &scope](const ConfigProvider &provider) {
358 return provider.num_palettes_in_primary(type, scope);
359 });
360}
361
364{
365 const auto name = extract_function_name();
366 // Strip the _raw suffix from the function name for cache key
367 const auto base_name = name.substr(0, name.size() - 4);
368 const auto key = to_string(type) + ":" + scope + ":" + base_name;
369 return resolve_config_value<std::size_t>(
370 key, "Number Of Palettes Total", [&type, &scope](const ConfigProvider &provider) {
371 return provider.num_palettes_total(type, scope);
372 });
373}
374
377{
378 const auto name = extract_function_name();
379 // Strip the _raw suffix from the function name for cache key
380 const auto base_name = name.substr(0, name.size() - 4);
381 const auto key = to_string(type) + ":" + scope + ":" + base_name;
382 return resolve_config_value<std::size_t>(key, "Max Map Data Size", [&type, &scope](const ConfigProvider &provider) {
383 return provider.max_map_data_size(type, scope);
384 });
385}
386
389{
390 const auto name = extract_function_name();
391 // Strip the _raw suffix from the function name for cache key
392 const auto base_name = name.substr(0, name.size() - 4);
393 const auto key = to_string(type) + ":" + scope + ":" + base_name;
394 return resolve_config_value<std::size_t>(
395 key, "Number Of Tiles Per Metatile", [&type, &scope](const ConfigProvider &provider) {
396 return provider.num_tiles_per_metatile(type, scope);
397 });
398}
399
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<Rgba32>(key, "Extrinsic Transparency", [&type, &scope](const ConfigProvider &provider) {
408 return provider.extrinsic_transparency(type, scope);
409 });
410}
411
414{
415 const auto name = extract_function_name();
416 // Strip the _raw suffix from the function name for cache key
417 const auto base_name = name.substr(0, name.size() - 4);
418 const auto key = to_string(type) + ":" + scope + ":" + base_name;
419 return resolve_config_value<bool>(
420 key, "Ignore Triple Layer Content", [&type, &scope](const ConfigProvider &provider) {
421 return provider.ignore_triple_layer_content(type, scope);
422 });
423}
424
426LazyLayeredConfig::tiles_edit_mode_raw(ConfigScopeType type, const std::string &scope) const
427{
428 const auto name = extract_function_name();
429 // Strip the _raw suffix from the function name for cache key
430 const auto base_name = name.substr(0, name.size() - 4);
431 const auto key = to_string(type) + ":" + scope + ":" + base_name;
432 return resolve_config_value<ArtifactEditMode>(
433 key, "Tiles Edit Mode", [&type, &scope](const ConfigProvider &provider) {
434 return provider.tiles_edit_mode(type, scope);
435 });
436}
437
440{
441 const auto name = extract_function_name();
442 // Strip the _raw suffix from the function name for cache key
443 const auto base_name = name.substr(0, name.size() - 4);
444 const auto key = to_string(type) + ":" + scope + ":" + base_name;
445 return resolve_config_value<ArtifactEditMode>(
446 key, "Palettes Edit Mode", [&type, &scope](const ConfigProvider &provider) {
447 return provider.palettes_edit_mode(type, scope);
448 });
449}
450
453{
454 const auto name = extract_function_name();
455 // Strip the _raw suffix from the function name for cache key
456 const auto base_name = name.substr(0, name.size() - 4);
457 const auto key = to_string(type) + ":" + scope + ":" + base_name;
458 return resolve_config_value<bool>(key, "Palette Hints Enabled", [&type, &scope](const ConfigProvider &provider) {
459 return provider.palette_hints_enabled(type, scope);
460 });
461}
462
464LazyLayeredConfig::palette_hints_raw(ConfigScopeType type, const std::string &scope) const
465{
466 const auto name = extract_function_name();
467 // Strip the _raw suffix from the function name for cache key
468 const auto base_name = name.substr(0, name.size() - 4);
469 const auto key = to_string(type) + ":" + scope + ":" + base_name;
470 return resolve_config_value<std::vector<PaletteHint>>(
471 key, "Palette Hints", [&type, &scope](const ConfigProvider &provider) {
472 return provider.palette_hints(type, scope);
473 });
474}
475
477LazyLayeredConfig::packing_strategy_raw(ConfigScopeType type, const std::string &scope) const
478{
479 const auto name = extract_function_name();
480 // Strip the _raw suffix from the function name for cache key
481 const auto base_name = name.substr(0, name.size() - 4);
482 const auto key = to_string(type) + ":" + scope + ":" + base_name;
483 return resolve_config_value<PackingStrategyType>(
484 key, "Packing Strategy", [&type, &scope](const ConfigProvider &provider) {
485 return provider.packing_strategy(type, scope);
486 });
487}
488
491{
492 const auto name = extract_function_name();
493 // Strip the _raw suffix from the function name for cache key
494 const auto base_name = name.substr(0, name.size() - 4);
495 const auto key = to_string(type) + ":" + scope + ":" + base_name;
496 return resolve_config_value<PackingStrategyParams>(
497 key, "Packing Strategy Params", [&type, &scope](const ConfigProvider &provider) {
498 return provider.packing_strategy_params(type, scope);
499 });
500}
501
504{
505 const auto name = extract_function_name();
506 // Strip the _raw suffix from the function name for cache key
507 const auto base_name = name.substr(0, name.size() - 4);
508 const auto key = to_string(type) + ":" + scope + ":" + base_name;
509 return resolve_config_value<TileSharingPacking>(
510 key, "Tile Sharing Packing", [&type, &scope](const ConfigProvider &provider) {
511 return provider.tile_sharing_packing(type, scope);
512 });
513}
514
517{
518 const auto name = extract_function_name();
519 // Strip the _raw suffix from the function name for cache key
520 const auto base_name = name.substr(0, name.size() - 4);
521 const auto key = to_string(type) + ":" + scope + ":" + base_name;
522 return resolve_config_value<TileSharingAlignment>(
523 key, "Tile Sharing Alignment", [&type, &scope](const ConfigProvider &provider) {
524 return provider.tile_sharing_alignment(type, scope);
525 });
526}
527
530{
531 const auto name = extract_function_name();
532 // Strip the _raw suffix from the function name for cache key
533 const auto base_name = name.substr(0, name.size() - 4);
534 const auto key = to_string(type) + ":" + scope + ":" + base_name;
535 return resolve_config_value<TilesPaletteMode>(
536 key, "Tiles Palette Mode", [&type, &scope](const ConfigProvider &provider) {
537 return provider.tiles_palette_mode(type, scope);
538 });
539}
540
543{
544 const auto name = extract_function_name();
545 // Strip the _raw suffix from the function name for cache key
546 const auto base_name = name.substr(0, name.size() - 4);
547 const auto key = to_string(type) + ":" + scope + ":" + base_name;
548 return resolve_config_value<AnimPaletteResolutionStrategy>(
549 key, "Global Animation Palette Resolution Strategy", [&type, &scope](const ConfigProvider &provider) {
550 return provider.global_anim_palette_resolution_strategy(type, scope);
551 });
552}
553
556{
557 const auto name = extract_function_name();
558 // Strip the _raw suffix from the function name for cache key
559 const auto base_name = name.substr(0, name.size() - 4);
560 const auto key = to_string(type) + ":" + scope + ":" + base_name;
561 return resolve_config_value<AnimKeyFrameResolutionStrategy>(
562 key, "Global Animation Key Frame Resolution Strategy", [&type, &scope](const ConfigProvider &provider) {
563 return provider.global_anim_key_frame_resolution_strategy(type, scope);
564 });
565}
566
569 ConfigScopeType type, const std::string &scope) const
570{
571 const auto name = extract_function_name();
572 // Strip the _raw suffix from the function name for cache key
573 const auto base_name = name.substr(0, name.size() - 4);
574 const auto key = to_string(type) + ":" + scope + ":" + base_name;
575 return resolve_config_value<AnimMultiPaletteSubtileResolutionStrategy>(
576 key,
577 "Global Animation Multi-Palette Subtile Resolution Strategy",
578 [&type, &scope](const ConfigProvider &provider) {
579 return provider.global_anim_multi_palette_subtile_resolution_strategy(type, scope);
580 });
581}
582
585{
586 const auto name = extract_function_name();
587 // Strip the _raw suffix from the function name for cache key
588 const auto base_name = name.substr(0, name.size() - 4);
589 const auto key = to_string(type) + ":" + scope + ":" + base_name;
590 return resolve_config_value<FrameLinking>(
591 key, "Global Frame Linking", [&type, &scope](const ConfigProvider &provider) {
592 return provider.global_frame_linking(type, scope);
593 });
594}
595
598{
599 const auto name = extract_function_name();
600 // Strip the _raw suffix from the function name for cache key
601 const auto base_name = name.substr(0, name.size() - 4);
602 const auto key = to_string(type) + ":" + scope + ":" + base_name;
603 return resolve_config_value<PerAnimOverrides>(
604 key, "Per-Animation Overrides", [&type, &scope](const ConfigProvider &provider) {
605 return provider.per_anim_overrides(type, scope);
606 });
607}
608
611{
612 const auto name = extract_function_name();
613 // Strip the _raw suffix from the function name for cache key
614 const auto base_name = name.substr(0, name.size() - 4);
615 const auto key = to_string(type) + ":" + scope + ":" + base_name;
616 return resolve_config_value<bool>(
617 key, "Cross-Tileset Animation Linking", [&type, &scope](const ConfigProvider &provider) {
618 return provider.cross_tileset_anim_linking(type, scope);
619 });
620}
621
623LazyLayeredConfig::verify_checksums_raw(ConfigScopeType type, const std::string &scope) const
624{
625 const auto name = extract_function_name();
626 // Strip the _raw suffix from the function name for cache key
627 const auto base_name = name.substr(0, name.size() - 4);
628 const auto key = to_string(type) + ":" + scope + ":" + base_name;
629 return resolve_config_value<bool>(key, "Verify Checksums", [&type, &scope](const ConfigProvider &provider) {
630 return provider.verify_checksums(type, scope);
631 });
632}
633
636{
637 const auto name = extract_function_name();
638 // Strip the _raw suffix from the function name for cache key
639 const auto base_name = name.substr(0, name.size() - 4);
640 const auto key = to_string(type) + ":" + scope + ":" + base_name;
641 return resolve_config_value<PrimaryPairingMode>(
642 key, "Primary Pairing Mode", [&type, &scope](const ConfigProvider &provider) {
643 return provider.primary_pairing_mode(type, scope);
644 });
645}
646
649{
650 const auto name = extract_function_name();
651 // Strip the _raw suffix from the function name for cache key
652 const auto base_name = name.substr(0, name.size() - 4);
653 const auto key = to_string(type) + ":" + scope + ":" + base_name;
654 return resolve_config_value<std::vector<std::string>>(
655 key, "Primary Pairing Partners", [&type, &scope](const ConfigProvider &provider) {
656 return provider.primary_pairing_partners(type, scope);
657 });
658}
659
662{
663 const auto name = extract_function_name();
664 // Strip the _raw suffix from the function name for cache key
665 const auto base_name = name.substr(0, name.size() - 4);
666 const auto key = to_string(type) + ":" + scope + ":" + base_name;
667 return resolve_config_value<std::vector<std::string>>(
668 key, "Diagnostic Warnings Exclude", [&type, &scope](const ConfigProvider &provider) {
669 return provider.diagnostic_warnings_exclude(type, scope);
670 });
671}
672
675{
676 const auto name = extract_function_name();
677 // Strip the _raw suffix from the function name for cache key
678 const auto base_name = name.substr(0, name.size() - 4);
679 const auto key = to_string(type) + ":" + scope + ":" + base_name;
680 return resolve_config_value<std::vector<std::string>>(
681 key, "Diagnostic Warnings Include", [&type, &scope](const ConfigProvider &provider) {
682 return provider.diagnostic_warnings_include(type, scope);
683 });
684}
685
688{
689 const auto name = extract_function_name();
690 // Strip the _raw suffix from the function name for cache key
691 const auto base_name = name.substr(0, name.size() - 4);
692 const auto key = to_string(type) + ":" + scope + ":" + base_name;
693 return resolve_config_value<std::vector<std::string>>(
694 key, "Diagnostic Remarks Exclude", [&type, &scope](const ConfigProvider &provider) {
695 return provider.diagnostic_remarks_exclude(type, scope);
696 });
697}
698
701{
702 const auto name = extract_function_name();
703 // Strip the _raw suffix from the function name for cache key
704 const auto base_name = name.substr(0, name.size() - 4);
705 const auto key = to_string(type) + ":" + scope + ":" + base_name;
706 return resolve_config_value<std::vector<std::string>>(
707 key, "Diagnostic Remarks Include", [&type, &scope](const ConfigProvider &provider) {
708 return provider.diagnostic_remarks_include(type, scope);
709 });
710}
711
714{
715 const auto name = extract_function_name();
716 // Strip the _raw suffix from the function name for cache key
717 const auto base_name = name.substr(0, name.size() - 4);
718 const auto key = to_string(type) + ":" + scope + ":" + base_name;
719 return resolve_config_value<std::string>(
720 key, "Tileset Paths Primary Source", [&type, &scope](const ConfigProvider &provider) {
721 return provider.tileset_paths_primary_src(type, scope);
722 });
723}
724
727{
728 const auto name = extract_function_name();
729 // Strip the _raw suffix from the function name for cache key
730 const auto base_name = name.substr(0, name.size() - 4);
731 const auto key = to_string(type) + ":" + scope + ":" + base_name;
732 return resolve_config_value<std::string>(
733 key, "Tileset Paths Primary Bin", [&type, &scope](const ConfigProvider &provider) {
734 return provider.tileset_paths_primary_bin(type, scope);
735 });
736}
737
740{
741 const auto name = extract_function_name();
742 // Strip the _raw suffix from the function name for cache key
743 const auto base_name = name.substr(0, name.size() - 4);
744 const auto key = to_string(type) + ":" + scope + ":" + base_name;
745 return resolve_config_value<std::string>(
746 key, "Tileset Paths Secondary Source", [&type, &scope](const ConfigProvider &provider) {
747 return provider.tileset_paths_secondary_src(type, scope);
748 });
749}
750
753{
754 const auto name = extract_function_name();
755 // Strip the _raw suffix from the function name for cache key
756 const auto base_name = name.substr(0, name.size() - 4);
757 const auto key = to_string(type) + ":" + scope + ":" + base_name;
758 return resolve_config_value<std::string>(
759 key, "Tileset Paths Secondary Bin", [&type, &scope](const ConfigProvider &provider) {
760 return provider.tileset_paths_secondary_bin(type, scope);
761 });
762}
763
766{
767 const auto name = extract_function_name();
768 // Strip the _raw suffix from the function name for cache key
769 const auto base_name = name.substr(0, name.size() - 4);
770 const auto key = to_string(type) + ":" + scope + ":" + base_name;
771 return resolve_config_value<std::optional<std::size_t>>(
772 key, "Metatile Attribute Size", [&type, &scope](const ConfigProvider &provider) {
773 return provider.metatile_attribute_size(type, scope);
774 });
775}
776
779{
780 const auto name = extract_function_name();
781 // Strip the _raw suffix from the function name for cache key
782 const auto base_name = name.substr(0, name.size() - 4);
783 const auto key = to_string(type) + ":" + scope + ":" + base_name;
784 return resolve_config_value<std::optional<std::size_t>>(
785 key, "Metatile Attribute Declaration Size", [&type, &scope](const ConfigProvider &provider) {
786 return provider.metatile_attribute_declaration_size(type, scope);
787 });
788}
789
792{
793 const auto name = extract_function_name();
794 // Strip the _raw suffix from the function name for cache key
795 const auto base_name = name.substr(0, name.size() - 4);
796 const auto key = to_string(type) + ":" + scope + ":" + base_name;
797 return resolve_config_value<MetatileAttributeFieldDefinitions>(
798 key, "Metatile Attribute Fields", [&type, &scope](const ConfigProvider &provider) {
799 return provider.metatile_attribute_fields(type, scope);
800 });
801}
802
805{
806 const auto name = extract_function_name();
807 // Strip the _raw suffix from the function name for cache key
808 const auto base_name = name.substr(0, name.size() - 4);
809 const auto key = to_string(type) + ":" + scope + ":" + base_name;
810 return resolve_config_value<MetatileAttributeFieldOverrides>(
811 key, "Metatile Attribute Field Overrides", [&type, &scope](const ConfigProvider &provider) {
812 return provider.metatile_attribute_field_overrides(type, scope);
813 });
814}
815
817LazyLayeredConfig::role_pins_raw(ConfigScopeType type, const std::string &scope) const
818{
819 const auto name = extract_function_name();
820 // Strip the _raw suffix from the function name for cache key
821 const auto base_name = name.substr(0, name.size() - 4);
822 const auto key = to_string(type) + ":" + scope + ":" + base_name;
823 return resolve_config_value<RolePinDefinitions>(
824 key, "Role Pins", [&type, &scope](const ConfigProvider &provider) { return provider.role_pins(type, scope); });
825}
826
829{
830 const auto name = extract_function_name();
831 // Strip the _raw suffix from the function name for cache key
832 const auto base_name = name.substr(0, name.size() - 4);
833 const auto key = to_string(type) + ":" + scope + ":" + base_name;
834 return resolve_config_value<bool>(
835 key, "Tileset Animations Wire Anim Code", [&type, &scope](const ConfigProvider &provider) {
836 return provider.tileset_animations_wire_anim_code(type, scope);
837 });
838}
839
840std::vector<ProvenanceChainLink<std::size_t>>
842{
843 return collect_provenance_chain<std::size_t>(
844 [&type, &scope](const ConfigProvider &provider) { return provider.num_tiles_in_primary(type, scope); });
845}
846
847std::vector<ProvenanceChainLink<std::size_t>>
849{
850 return collect_provenance_chain<std::size_t>(
851 [&type, &scope](const ConfigProvider &provider) { return provider.num_tiles_total(type, scope); });
852}
853
854std::vector<ProvenanceChainLink<std::size_t>>
856{
857 return collect_provenance_chain<std::size_t>(
858 [&type, &scope](const ConfigProvider &provider) { return provider.num_metatiles_in_primary(type, scope); });
859}
860
861std::vector<ProvenanceChainLink<std::size_t>>
863{
864 return collect_provenance_chain<std::size_t>(
865 [&type, &scope](const ConfigProvider &provider) { return provider.num_metatiles_total(type, scope); });
866}
867
868std::vector<ProvenanceChainLink<std::size_t>>
870{
871 return collect_provenance_chain<std::size_t>(
872 [&type, &scope](const ConfigProvider &provider) { return provider.num_palettes_in_primary(type, scope); });
873}
874
875std::vector<ProvenanceChainLink<std::size_t>>
877{
878 return collect_provenance_chain<std::size_t>(
879 [&type, &scope](const ConfigProvider &provider) { return provider.num_palettes_total(type, scope); });
880}
881
882std::vector<ProvenanceChainLink<std::size_t>>
884{
885 return collect_provenance_chain<std::size_t>(
886 [&type, &scope](const ConfigProvider &provider) { return provider.max_map_data_size(type, scope); });
887}
888
889std::vector<ProvenanceChainLink<std::size_t>>
891{
892 return collect_provenance_chain<std::size_t>(
893 [&type, &scope](const ConfigProvider &provider) { return provider.num_tiles_per_metatile(type, scope); });
894}
895
896std::vector<ProvenanceChainLink<Rgba32>>
898{
899 return collect_provenance_chain<Rgba32>(
900 [&type, &scope](const ConfigProvider &provider) { return provider.extrinsic_transparency(type, scope); });
901}
902
903std::vector<ProvenanceChainLink<bool>>
905{
906 return collect_provenance_chain<bool>(
907 [&type, &scope](const ConfigProvider &provider) { return provider.ignore_triple_layer_content(type, scope); });
908}
909
910std::vector<ProvenanceChainLink<ArtifactEditMode>>
912{
913 return collect_provenance_chain<ArtifactEditMode>(
914 [&type, &scope](const ConfigProvider &provider) { return provider.tiles_edit_mode(type, scope); });
915}
916
917std::vector<ProvenanceChainLink<ArtifactEditMode>>
919{
920 return collect_provenance_chain<ArtifactEditMode>(
921 [&type, &scope](const ConfigProvider &provider) { return provider.palettes_edit_mode(type, scope); });
922}
923
924std::vector<ProvenanceChainLink<bool>>
926{
927 return collect_provenance_chain<bool>(
928 [&type, &scope](const ConfigProvider &provider) { return provider.palette_hints_enabled(type, scope); });
929}
930
931std::vector<ProvenanceChainLink<std::vector<PaletteHint>>>
933{
934 return collect_provenance_chain<std::vector<PaletteHint>>(
935 [&type, &scope](const ConfigProvider &provider) { return provider.palette_hints(type, scope); });
936}
937
938std::vector<ProvenanceChainLink<PackingStrategyType>>
940{
941 return collect_provenance_chain<PackingStrategyType>(
942 [&type, &scope](const ConfigProvider &provider) { return provider.packing_strategy(type, scope); });
943}
944
945std::vector<ProvenanceChainLink<PackingStrategyParams>>
947{
948 return collect_provenance_chain<PackingStrategyParams>(
949 [&type, &scope](const ConfigProvider &provider) { return provider.packing_strategy_params(type, scope); });
950}
951
952std::vector<ProvenanceChainLink<TileSharingPacking>>
954{
955 return collect_provenance_chain<TileSharingPacking>(
956 [&type, &scope](const ConfigProvider &provider) { return provider.tile_sharing_packing(type, scope); });
957}
958
959std::vector<ProvenanceChainLink<TileSharingAlignment>>
961{
962 return collect_provenance_chain<TileSharingAlignment>(
963 [&type, &scope](const ConfigProvider &provider) { return provider.tile_sharing_alignment(type, scope); });
964}
965
966std::vector<ProvenanceChainLink<TilesPaletteMode>>
968{
969 return collect_provenance_chain<TilesPaletteMode>(
970 [&type, &scope](const ConfigProvider &provider) { return provider.tiles_palette_mode(type, scope); });
971}
972
973std::vector<ProvenanceChainLink<AnimPaletteResolutionStrategy>>
975 ConfigScopeType type, const std::string &scope) const
976{
977 return collect_provenance_chain<AnimPaletteResolutionStrategy>([&type, &scope](const ConfigProvider &provider) {
978 return provider.global_anim_palette_resolution_strategy(type, scope);
979 });
980}
981
982std::vector<ProvenanceChainLink<AnimKeyFrameResolutionStrategy>>
984 ConfigScopeType type, const std::string &scope) const
985{
986 return collect_provenance_chain<AnimKeyFrameResolutionStrategy>([&type, &scope](const ConfigProvider &provider) {
987 return provider.global_anim_key_frame_resolution_strategy(type, scope);
988 });
989}
990
991std::vector<ProvenanceChainLink<AnimMultiPaletteSubtileResolutionStrategy>>
993 ConfigScopeType type, const std::string &scope) const
994{
995 return collect_provenance_chain<AnimMultiPaletteSubtileResolutionStrategy>(
996 [&type, &scope](const ConfigProvider &provider) {
997 return provider.global_anim_multi_palette_subtile_resolution_strategy(type, scope);
998 });
999}
1000
1001std::vector<ProvenanceChainLink<FrameLinking>>
1003{
1004 return collect_provenance_chain<FrameLinking>(
1005 [&type, &scope](const ConfigProvider &provider) { return provider.global_frame_linking(type, scope); });
1006}
1007
1008std::vector<ProvenanceChainLink<PerAnimOverrides>>
1010{
1011 return collect_provenance_chain<PerAnimOverrides>(
1012 [&type, &scope](const ConfigProvider &provider) { return provider.per_anim_overrides(type, scope); });
1013}
1014
1015std::vector<ProvenanceChainLink<bool>>
1017{
1018 return collect_provenance_chain<bool>(
1019 [&type, &scope](const ConfigProvider &provider) { return provider.cross_tileset_anim_linking(type, scope); });
1020}
1021
1022std::vector<ProvenanceChainLink<bool>>
1024{
1025 return collect_provenance_chain<bool>(
1026 [&type, &scope](const ConfigProvider &provider) { return provider.verify_checksums(type, scope); });
1027}
1028
1029std::vector<ProvenanceChainLink<PrimaryPairingMode>>
1031{
1032 return collect_provenance_chain<PrimaryPairingMode>(
1033 [&type, &scope](const ConfigProvider &provider) { return provider.primary_pairing_mode(type, scope); });
1034}
1035
1036std::vector<ProvenanceChainLink<std::vector<std::string>>>
1038{
1039 return collect_provenance_chain<std::vector<std::string>>(
1040 [&type, &scope](const ConfigProvider &provider) { return provider.primary_pairing_partners(type, scope); });
1041}
1042
1043std::vector<ProvenanceChainLink<std::vector<std::string>>>
1045{
1046 return collect_provenance_chain<std::vector<std::string>>(
1047 [&type, &scope](const ConfigProvider &provider) { return provider.diagnostic_warnings_exclude(type, scope); });
1048}
1049
1050std::vector<ProvenanceChainLink<std::vector<std::string>>>
1052{
1053 return collect_provenance_chain<std::vector<std::string>>(
1054 [&type, &scope](const ConfigProvider &provider) { return provider.diagnostic_warnings_include(type, scope); });
1055}
1056
1057std::vector<ProvenanceChainLink<std::vector<std::string>>>
1059{
1060 return collect_provenance_chain<std::vector<std::string>>(
1061 [&type, &scope](const ConfigProvider &provider) { return provider.diagnostic_remarks_exclude(type, scope); });
1062}
1063
1064std::vector<ProvenanceChainLink<std::vector<std::string>>>
1066{
1067 return collect_provenance_chain<std::vector<std::string>>(
1068 [&type, &scope](const ConfigProvider &provider) { return provider.diagnostic_remarks_include(type, scope); });
1069}
1070
1071std::vector<ProvenanceChainLink<std::string>>
1073{
1074 return collect_provenance_chain<std::string>(
1075 [&type, &scope](const ConfigProvider &provider) { return provider.tileset_paths_primary_src(type, scope); });
1076}
1077
1078std::vector<ProvenanceChainLink<std::string>>
1080{
1081 return collect_provenance_chain<std::string>(
1082 [&type, &scope](const ConfigProvider &provider) { return provider.tileset_paths_primary_bin(type, scope); });
1083}
1084
1085std::vector<ProvenanceChainLink<std::string>>
1087{
1088 return collect_provenance_chain<std::string>(
1089 [&type, &scope](const ConfigProvider &provider) { return provider.tileset_paths_secondary_src(type, scope); });
1090}
1091
1092std::vector<ProvenanceChainLink<std::string>>
1094{
1095 return collect_provenance_chain<std::string>(
1096 [&type, &scope](const ConfigProvider &provider) { return provider.tileset_paths_secondary_bin(type, scope); });
1097}
1098
1099std::vector<ProvenanceChainLink<std::optional<std::size_t>>>
1101{
1102 return collect_provenance_chain<std::optional<std::size_t>>(
1103 [&type, &scope](const ConfigProvider &provider) { return provider.metatile_attribute_size(type, scope); });
1104}
1105
1106std::vector<ProvenanceChainLink<std::optional<std::size_t>>>
1108 ConfigScopeType type, const std::string &scope) const
1109{
1110 return collect_provenance_chain<std::optional<std::size_t>>([&type, &scope](const ConfigProvider &provider) {
1111 return provider.metatile_attribute_declaration_size(type, scope);
1112 });
1113}
1114
1115std::vector<ProvenanceChainLink<MetatileAttributeFieldDefinitions>>
1117{
1118 return collect_provenance_chain<MetatileAttributeFieldDefinitions>(
1119 [&type, &scope](const ConfigProvider &provider) { return provider.metatile_attribute_fields(type, scope); });
1120}
1121
1122std::vector<ProvenanceChainLink<MetatileAttributeFieldOverrides>>
1124 ConfigScopeType type, const std::string &scope) const
1125{
1126 return collect_provenance_chain<MetatileAttributeFieldOverrides>([&type, &scope](const ConfigProvider &provider) {
1127 return provider.metatile_attribute_field_overrides(type, scope);
1128 });
1129}
1130
1131std::vector<ProvenanceChainLink<RolePinDefinitions>>
1133{
1134 return collect_provenance_chain<RolePinDefinitions>(
1135 [&type, &scope](const ConfigProvider &provider) { return provider.role_pins(type, scope); });
1136}
1137
1139 ConfigScopeType type, const std::string &scope) const
1140{
1141 return collect_provenance_chain<bool>([&type, &scope](const ConfigProvider &provider) {
1142 return provider.tileset_animations_wire_anim_code(type, scope);
1143 });
1144}
1145
1146} // 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.
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< RolePinDefinitions > > role_pins_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for role_pins.
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 > > 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< std::size_t > > num_palettes_total_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< AnimPaletteResolutionStrategy > > global_anim_palette_resolution_strategy_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for global_anim_palette_resolution_strategy.
ChainableResult< ConfigValue< std::vector< PaletteHint > > > palette_hints_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
ChainableResult< ConfigValue< AnimMultiPaletteSubtileResolutionStrategy > > global_anim_multi_palette_subtile_resolution_strategy_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.
ChainableResult< ConfigValue< AnimPaletteResolutionStrategy > > global_anim_palette_resolution_strategy_raw(ConfigScopeType type, const std::string &scope) const override
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.
std::vector< ProvenanceChainLink< AnimMultiPaletteSubtileResolutionStrategy > > global_anim_multi_palette_subtile_resolution_strategy_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for global_anim_multi_palette_subtile_resolution_strategy.
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.
ChainableResult< ConfigValue< ArtifactEditMode > > palettes_edit_mode_raw(ConfigScopeType type, const std::string &scope) const override
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< 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
std::vector< ProvenanceChainLink< std::size_t > > num_palettes_in_primary_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_palettes_in_primary.
ChainableResult< ConfigValue< MetatileAttributeFieldOverrides > > metatile_attribute_field_overrides_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
std::vector< ProvenanceChainLink< std::size_t > > num_palettes_total_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for num_palettes_total.
ChainableResult< ConfigValue< std::vector< std::string > > > diagnostic_remarks_include_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::optional< std::size_t > > > metatile_attribute_size_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< std::optional< std::size_t > > > metatile_attribute_declaration_size_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.
std::vector< ProvenanceChainLink< TilesPaletteMode > > tiles_palette_mode_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for tiles_palette_mode.
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< 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< bool > > palette_hints_enabled_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for palette_hints_enabled.
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.
ChainableResult< ConfigValue< bool > > palette_hints_enabled_raw(ConfigScopeType type, const std::string &scope) const override
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< std::vector< std::string > > > diagnostic_remarks_exclude_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< bool > > ignore_triple_layer_content_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< PackingStrategyType > > packing_strategy_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::optional< std::size_t > > > metatile_attribute_declaration_size_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for metatile_attribute_declaration_size.
ChainableResult< ConfigValue< MetatileAttributeFieldDefinitions > > metatile_attribute_fields_raw(ConfigScopeType type, const std::string &scope) const override
std::vector< ProvenanceChainLink< ArtifactEditMode > > palettes_edit_mode_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for palettes_edit_mode.
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::vector< PaletteHint > > > palette_hints_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for palette_hints.
std::vector< ProvenanceChainLink< std::optional< std::size_t > > > metatile_attribute_size_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for metatile_attribute_size.
std::vector< ProvenanceChainLink< bool > > ignore_triple_layer_content_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for ignore_triple_layer_content.
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< 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.
ChainableResult< ConfigValue< TilesPaletteMode > > tiles_palette_mode_raw(ConfigScopeType type, const std::string &scope) const override
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< std::size_t > > num_palettes_in_primary_raw(ConfigScopeType type, const std::string &scope) const override
ChainableResult< ConfigValue< RolePinDefinitions > > role_pins_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
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.
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::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
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...
std::vector< ProvenanceChainLink< MetatileAttributeFieldOverrides > > metatile_attribute_field_overrides_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for metatile_attribute_field_overrides.
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::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< 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< MetatileAttributeFieldDefinitions > > metatile_attribute_fields_provenance_chain(ConfigScopeType type, const std::string &scope) const
Gets the full provenance chain for metatile_attribute_fields.
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.
std::string name
std::optional< ProviderDefinition > provider
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...