Porytiles
Loading...
Searching...
No Matches
yaml_file_provider.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <filesystem>
4#include <memory>
5#include <string>
6
7#include "gsl/pointers"
8
12
13namespace porytiles {
14
15// NOTE: DO NOT EDIT THIS FILE DIRECTLY. It is AUTO-GENERATED from config_schema.yaml.
16// To add new config values or make other changes, edit config_schema.yaml and regenerate via:
17//
18// uv run scripts/generate_config.py
19
32class YamlFileProvider final : public ConfigProvider {
33 public:
44 explicit YamlFileProvider(
45 gsl::not_null<const TextFormatter *> format,
46 const UserDiagnostics *diagnostics,
47 const std::filesystem::path &project_root);
48
59 explicit YamlFileProvider(const UserDiagnostics *diagnostics, const std::filesystem::path &project_root);
60
64 [[nodiscard]] std::string name() const override;
65
76 [[nodiscard]] bool preload_and_validate(ConfigScopeType type, const std::string &scope) const;
77
78 [[nodiscard]] LayerValue<std::size_t>
79 num_tiles_in_primary(ConfigScopeType type, const std::string &scope) const override;
80
81 [[nodiscard]] LayerValue<std::size_t>
82 num_tiles_total(ConfigScopeType type, const std::string &scope) const override;
83
84 [[nodiscard]] LayerValue<std::size_t>
85 num_metatiles_in_primary(ConfigScopeType type, const std::string &scope) const override;
86
87 [[nodiscard]] LayerValue<std::size_t>
88 num_metatiles_total(ConfigScopeType type, const std::string &scope) const override;
89
90 [[nodiscard]] LayerValue<std::size_t>
91 num_palettes_in_primary(ConfigScopeType type, const std::string &scope) const override;
92
93 [[nodiscard]] LayerValue<std::size_t>
94 num_palettes_total(ConfigScopeType type, const std::string &scope) const override;
95
96 [[nodiscard]] LayerValue<std::size_t>
97 max_map_data_size(ConfigScopeType type, const std::string &scope) const override;
98
99 [[nodiscard]] LayerValue<std::size_t>
100 num_tiles_per_metatile(ConfigScopeType type, const std::string &scope) const override;
101
102 [[nodiscard]] LayerValue<Rgba32>
103 extrinsic_transparency(ConfigScopeType type, const std::string &scope) const override;
104
105 [[nodiscard]] LayerValue<bool>
106 ignore_triple_layer_content(ConfigScopeType type, const std::string &scope) const override;
107
108 [[nodiscard]] LayerValue<ArtifactEditMode>
109 tiles_edit_mode(ConfigScopeType type, const std::string &scope) const override;
110
111 [[nodiscard]] LayerValue<ArtifactEditMode>
112 palettes_edit_mode(ConfigScopeType type, const std::string &scope) const override;
113
114 [[nodiscard]] LayerValue<bool> palette_hints_enabled(ConfigScopeType type, const std::string &scope) const override;
115
117 palette_hints(ConfigScopeType type, const std::string &scope) const override;
118
120 packing_strategy(ConfigScopeType type, const std::string &scope) const override;
121
123 packing_strategy_params(ConfigScopeType type, const std::string &scope) const override;
124
126 tile_sharing_packing(ConfigScopeType type, const std::string &scope) const override;
127
129 tile_sharing_alignment(ConfigScopeType type, const std::string &scope) const override;
130
131 [[nodiscard]] LayerValue<TilesPaletteMode>
132 tiles_palette_mode(ConfigScopeType type, const std::string &scope) const override;
133
135 global_anim_palette_resolution_strategy(ConfigScopeType type, const std::string &scope) const override;
136
138 global_anim_key_frame_resolution_strategy(ConfigScopeType type, const std::string &scope) const override;
139
142 ConfigScopeType type, const std::string &scope) const override;
143
144 [[nodiscard]] LayerValue<FrameLinking>
145 global_frame_linking(ConfigScopeType type, const std::string &scope) const override;
146
147 [[nodiscard]] LayerValue<PerAnimOverrides>
148 per_anim_overrides(ConfigScopeType type, const std::string &scope) const override;
149
150 [[nodiscard]] LayerValue<bool>
151 cross_tileset_anim_linking(ConfigScopeType type, const std::string &scope) const override;
152
153 [[nodiscard]] LayerValue<bool> verify_checksums(ConfigScopeType type, const std::string &scope) const override;
154
156 primary_pairing_mode(ConfigScopeType type, const std::string &scope) const override;
157
159 primary_pairing_partners(ConfigScopeType type, const std::string &scope) const override;
160
162 diagnostic_warnings_exclude(ConfigScopeType type, const std::string &scope) const override;
163
165 diagnostic_warnings_include(ConfigScopeType type, const std::string &scope) const override;
166
168 diagnostic_remarks_exclude(ConfigScopeType type, const std::string &scope) const override;
169
171 diagnostic_remarks_include(ConfigScopeType type, const std::string &scope) const override;
172
173 [[nodiscard]] LayerValue<std::string>
174 tileset_paths_primary_src(ConfigScopeType type, const std::string &scope) const override;
175
176 [[nodiscard]] LayerValue<std::string>
177 tileset_paths_primary_bin(ConfigScopeType type, const std::string &scope) const override;
178
179 [[nodiscard]] LayerValue<std::string>
180 tileset_paths_secondary_src(ConfigScopeType type, const std::string &scope) const override;
181
182 [[nodiscard]] LayerValue<std::string>
183 tileset_paths_secondary_bin(ConfigScopeType type, const std::string &scope) const override;
184
186 metatile_attribute_size(ConfigScopeType type, const std::string &scope) const override;
187
189 metatile_attribute_declaration_size(ConfigScopeType type, const std::string &scope) const override;
190
192 metatile_attribute_fields(ConfigScopeType type, const std::string &scope) const override;
193
195 metatile_attribute_field_overrides(ConfigScopeType type, const std::string &scope) const override;
196
198 role_pins(ConfigScopeType type, const std::string &scope) const override;
199
200 [[nodiscard]] LayerValue<bool>
201 tileset_animations_wire_anim_code(ConfigScopeType type, const std::string &scope) const override;
202
203 private:
204 std::unique_ptr<TextFormatter> owned_format_; // Optional owned formatter (when using default ctor)
205 const TextFormatter *format_; // Non-owning pointer to formatter
206 const UserDiagnostics *diagnostics_; // Non-owning pointer to diagnostics
207 std::filesystem::path project_root_;
208};
209
210} // namespace porytiles
An interface which config implementations can use to load config values.
Abstract base class for applying text styling with context-aware formatting.
Abstract class for structured error reporting and diagnostic output.
A ConfigProvider implementation that reads configuration values from multiple YAML files with priorit...
LayerValue< TilesPaletteMode > tiles_palette_mode(ConfigScopeType type, const std::string &scope) const override
LayerValue< ArtifactEditMode > palettes_edit_mode(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > num_tiles_in_primary(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::vector< std::string > > diagnostic_remarks_exclude(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::string > tileset_paths_secondary_bin(ConfigScopeType type, const std::string &scope) const override
LayerValue< Rgba32 > extrinsic_transparency(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::vector< PaletteHint > > palette_hints(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::vector< std::string > > primary_pairing_partners(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::optional< std::size_t > > metatile_attribute_declaration_size(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > num_metatiles_in_primary(ConfigScopeType type, const std::string &scope) const override
LayerValue< AnimKeyFrameResolutionStrategy > global_anim_key_frame_resolution_strategy(ConfigScopeType type, const std::string &scope) const override
LayerValue< RolePinDefinitions > role_pins(ConfigScopeType type, const std::string &scope) const override
LayerValue< bool > tileset_animations_wire_anim_code(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > max_map_data_size(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::string > tileset_paths_primary_src(ConfigScopeType type, const std::string &scope) const override
LayerValue< bool > palette_hints_enabled(ConfigScopeType type, const std::string &scope) const override
LayerValue< PerAnimOverrides > per_anim_overrides(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::string > tileset_paths_primary_bin(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::string > tileset_paths_secondary_src(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::vector< std::string > > diagnostic_remarks_include(ConfigScopeType type, const std::string &scope) const override
LayerValue< PrimaryPairingMode > primary_pairing_mode(ConfigScopeType type, const std::string &scope) const override
LayerValue< MetatileAttributeFieldDefinitions > metatile_attribute_fields(ConfigScopeType type, const std::string &scope) const override
LayerValue< ArtifactEditMode > tiles_edit_mode(ConfigScopeType type, const std::string &scope) const override
LayerValue< MetatileAttributeFieldOverrides > metatile_attribute_field_overrides(ConfigScopeType type, const std::string &scope) const override
LayerValue< bool > cross_tileset_anim_linking(ConfigScopeType type, const std::string &scope) const override
LayerValue< bool > verify_checksums(ConfigScopeType type, const std::string &scope) const override
LayerValue< PackingStrategyType > packing_strategy(ConfigScopeType type, const std::string &scope) const override
LayerValue< FrameLinking > global_frame_linking(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::vector< std::string > > diagnostic_warnings_include(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > num_palettes_total(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > num_tiles_total(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > num_metatiles_total(ConfigScopeType type, const std::string &scope) const override
LayerValue< bool > ignore_triple_layer_content(ConfigScopeType type, const std::string &scope) const override
bool preload_and_validate(ConfigScopeType type, const std::string &scope) const
Eagerly loads all YAML config files and validates them for unknown keys.
std::string name() const override
Gets the name of this config layer.
LayerValue< TileSharingPacking > tile_sharing_packing(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > num_palettes_in_primary(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::optional< std::size_t > > metatile_attribute_size(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > num_tiles_per_metatile(ConfigScopeType type, const std::string &scope) const override
LayerValue< AnimMultiPaletteSubtileResolutionStrategy > global_anim_multi_palette_subtile_resolution_strategy(ConfigScopeType type, const std::string &scope) const override
LayerValue< AnimPaletteResolutionStrategy > global_anim_palette_resolution_strategy(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::vector< std::string > > diagnostic_warnings_exclude(ConfigScopeType type, const std::string &scope) const override
LayerValue< PackingStrategyParams > packing_strategy_params(ConfigScopeType type, const std::string &scope) const override
LayerValue< TileSharingAlignment > tile_sharing_alignment(ConfigScopeType type, const std::string &scope) const override
ConfigScopeType
Specifies the scope type for configuration value lookups.
A small container that holds an optional-wrapped value, validation state, and metadata about the valu...