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/*
16 * NOTE: DO NOT EDIT THIS FILE DIRECTLY. It is AUTO-GENERATED from config_schema.yaml.
17 * To add new config values or make other changes, edit config_schema.yaml and regenerate via:
18 *
19 * uv run scripts/generate_config.py
20 */
21
36class YamlFileProvider final : public ConfigProvider {
37 public:
50 explicit YamlFileProvider(
51 gsl::not_null<const TextFormatter *> format,
52 const UserDiagnostics *diagnostics,
53 const std::filesystem::path &project_root);
54
67 explicit YamlFileProvider(
68 const UserDiagnostics *diagnostics,
69 const std::filesystem::path &project_root);
70
76 [[nodiscard]] std::string name() const override;
77
90 [[nodiscard]] bool preload_and_validate(ConfigScopeType type, const std::string &scope) const;
91
92 [[nodiscard]] LayerValue<std::size_t> num_tiles_in_primary(ConfigScopeType type, const std::string &scope) const override;
93
94 [[nodiscard]] LayerValue<std::size_t> num_tiles_total(ConfigScopeType type, const std::string &scope) const override;
95
96 [[nodiscard]] LayerValue<std::size_t> num_metatiles_in_primary(ConfigScopeType type, const std::string &scope) const override;
97
98 [[nodiscard]] LayerValue<std::size_t> num_metatiles_total(ConfigScopeType type, const std::string &scope) const override;
99
100 [[nodiscard]] LayerValue<std::size_t> num_pals_in_primary(ConfigScopeType type, const std::string &scope) const override;
101
102 [[nodiscard]] LayerValue<std::size_t> num_pals_total(ConfigScopeType type, const std::string &scope) const override;
103
104 [[nodiscard]] LayerValue<std::size_t> max_map_data_size(ConfigScopeType type, const std::string &scope) const override;
105
106 [[nodiscard]] LayerValue<std::size_t> num_tiles_per_metatile(ConfigScopeType type, const std::string &scope) const override;
107
108 [[nodiscard]] LayerValue<Rgba32> extrinsic_transparency(ConfigScopeType type, const std::string &scope) const override;
109
110 [[nodiscard]] LayerValue<ArtifactEditMode> tiles_edit_mode(ConfigScopeType type, const std::string &scope) const override;
111
112 [[nodiscard]] LayerValue<ArtifactEditMode> pals_edit_mode(ConfigScopeType type, const std::string &scope) const override;
113
114 [[nodiscard]] LayerValue<bool> pal_hints_enabled(ConfigScopeType type, const std::string &scope) const override;
115
116 [[nodiscard]] LayerValue<std::vector<PaletteHint>> pal_hints(ConfigScopeType type, const std::string &scope) const override;
117
118 [[nodiscard]] LayerValue<PackingStrategyType> packing_strategy(ConfigScopeType type, const std::string &scope) const override;
119
120 [[nodiscard]] LayerValue<PackingStrategyParams> packing_strategy_params(ConfigScopeType type, const std::string &scope) const override;
121
122 [[nodiscard]] LayerValue<TileSharingPacking> tile_sharing_packing(ConfigScopeType type, const std::string &scope) const override;
123
124 [[nodiscard]] LayerValue<TileSharingAlignment> tile_sharing_alignment(ConfigScopeType type, const std::string &scope) const override;
125
126 [[nodiscard]] LayerValue<TilesPalMode> tiles_pal_mode(ConfigScopeType type, const std::string &scope) const override;
127
128 [[nodiscard]] LayerValue<AnimPalResolutionStrategy> global_anim_pal_resolution_strategy(ConfigScopeType type, const std::string &scope) const override;
129
130 [[nodiscard]] LayerValue<AnimKeyFrameResolutionStrategy> global_anim_key_frame_resolution_strategy(ConfigScopeType type, const std::string &scope) const override;
131
133
134 [[nodiscard]] LayerValue<FrameLinking> global_frame_linking(ConfigScopeType type, const std::string &scope) const override;
135
136 [[nodiscard]] LayerValue<PerAnimOverrides> per_anim_overrides(ConfigScopeType type, const std::string &scope) const override;
137
138 [[nodiscard]] LayerValue<bool> cross_tileset_anim_linking(ConfigScopeType type, const std::string &scope) const override;
139
140 [[nodiscard]] LayerValue<bool> verify_checksums(ConfigScopeType type, const std::string &scope) const override;
141
142 [[nodiscard]] LayerValue<PrimaryPairingMode> primary_pairing_mode(ConfigScopeType type, const std::string &scope) const override;
143
144 [[nodiscard]] LayerValue<std::vector<std::string>> primary_pairing_partners(ConfigScopeType type, const std::string &scope) const override;
145
146 [[nodiscard]] LayerValue<std::vector<std::string>> diagnostic_warnings_exclude(ConfigScopeType type, const std::string &scope) const override;
147
148 [[nodiscard]] LayerValue<std::vector<std::string>> diagnostic_warnings_include(ConfigScopeType type, const std::string &scope) const override;
149
150 [[nodiscard]] LayerValue<std::vector<std::string>> diagnostic_remarks_exclude(ConfigScopeType type, const std::string &scope) const override;
151
152 [[nodiscard]] LayerValue<std::vector<std::string>> diagnostic_remarks_include(ConfigScopeType type, const std::string &scope) const override;
153
154 [[nodiscard]] LayerValue<std::string> tileset_paths_primary_src(ConfigScopeType type, const std::string &scope) const override;
155
156 [[nodiscard]] LayerValue<std::string> tileset_paths_primary_bin(ConfigScopeType type, const std::string &scope) const override;
157
158 [[nodiscard]] LayerValue<std::string> tileset_paths_secondary_src(ConfigScopeType type, const std::string &scope) const override;
159
160 [[nodiscard]] LayerValue<std::string> tileset_paths_secondary_bin(ConfigScopeType type, const std::string &scope) const override;
161
162 [[nodiscard]] LayerValue<std::size_t> metatile_attr_size(ConfigScopeType type, const std::string &scope) const override;
163
164 [[nodiscard]] LayerValue<bool> tileset_animations_wire_anim_code(ConfigScopeType type, const std::string &scope) const override;
165
166 private:
167 std::unique_ptr<TextFormatter> owned_format_; // Optional owned formatter (when using default ctor)
168 const TextFormatter *format_; // Non-owning pointer to formatter
169 const UserDiagnostics *diagnostics_; // Non-owning pointer to diagnostics
170 std::filesystem::path project_root_;
171};
172
173} // 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< 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< std::string > > primary_pairing_partners(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > num_pals_in_primary(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< 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< 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::size_t > metatile_attr_size(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::size_t > num_pals_total(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< ArtifactEditMode > tiles_edit_mode(ConfigScopeType type, const std::string &scope) const override
LayerValue< std::vector< PaletteHint > > pal_hints(ConfigScopeType type, const std::string &scope) const override
LayerValue< TilesPalMode > tiles_pal_mode(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< ArtifactEditMode > pals_edit_mode(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
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< bool > pal_hints_enabled(ConfigScopeType type, const std::string &scope) const override
LayerValue< AnimPalResolutionStrategy > global_anim_pal_resolution_strategy(ConfigScopeType type, const std::string &scope) const override
LayerValue< TileSharingPacking > tile_sharing_packing(ConfigScopeType type, const std::string &scope) const override
LayerValue< AnimMultiPalSubtileResolutionStrategy > global_anim_multi_pal_subtile_resolution_strategy(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< 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...