|
Porytiles
|
Provides a pokeemerald project filesystem-based implementation for LayoutMetadataProvider. More...
#include <project_layout_metadata_provider.hpp>
Public Member Functions | |
| ProjectLayoutMetadataProvider (std::filesystem::path project_root, gsl::not_null< const TextFormatter * > format, gsl::not_null< const UserDiagnostics * > diag) | |
| bool | exists (const std::string &layout_name_or_id) const override |
| Checks whether a layout exists in the backing store for the given layout name or ID. | |
| ChainableResult< std::size_t > | width (const std::string &layout_name_or_id) const override |
| Determines the given layout's width in metatiles. | |
| ChainableResult< std::size_t > | height (const std::string &layout_name_or_id) const override |
| Determines the given layout's height in metatiles. | |
| ChainableResult< std::string > | primary_tileset (const std::string &layout_name_or_id) const override |
| Determines the given layout's primary tileset. | |
| ChainableResult< std::string > | secondary_tileset (const std::string &layout_name_or_id) const override |
| Determines the given layout's secondary tileset. | |
| ChainableResult< std::set< std::string > > | layout_names () const override |
| Returns all layout names known to this provider. | |
| ChainableResult< std::set< std::string > > | layout_ids () const override |
| Returns all layout IDs known to this provider. | |
| ChainableResult< std::string > | layouts_table_label () const |
| ChainableResult< std::filesystem::path > | border_filepath (const std::string &layout_name_or_id) const |
| Resolves border file path for a layout by parsing layouts.json. | |
| ChainableResult< std::filesystem::path > | blockdata_filepath (const std::string &layout_name_or_id) const |
| Resolves blockdata file path for a layout by parsing layouts.json. | |
| void | invalidate_metadata_cache () const |
| Invalidates the lazy-loaded layout cache, forcing a re-parse on next access. | |
Public Member Functions inherited from porytiles::LayoutMetadataProvider | |
| virtual | ~LayoutMetadataProvider ()=default |
Provides a pokeemerald project filesystem-based implementation for LayoutMetadataProvider.
This class parses layout definitions from layouts.json to extract metadata such a layout's width/height, primary tileset, border filepath, etc.
Layout metadata is lazy-loaded and cached for efficiency.
Definition at line 30 of file project_layout_metadata_provider.hpp.
|
inline |
Definition at line 32 of file project_layout_metadata_provider.hpp.
| ChainableResult< std::filesystem::path > porytiles::ProjectLayoutMetadataProvider::blockdata_filepath | ( | const std::string & | layout_name_or_id | ) | const |
Resolves blockdata file path for a layout by parsing layouts.json.
| layout_name_or_id | The name or ID of the layout to check (e.g., "PetalburgCity_Layout" or "LAYOUT_PETALBURG_CITY") |
Definition at line 311 of file project_layout_metadata_provider.cpp.
| ChainableResult< std::filesystem::path > porytiles::ProjectLayoutMetadataProvider::border_filepath | ( | const std::string & | layout_name_or_id | ) | const |
Resolves border file path for a layout by parsing layouts.json.
| layout_name_or_id | The name or ID of the layout to check (e.g., "PetalburgCity_Layout" or "LAYOUT_PETALBURG_CITY") |
Definition at line 294 of file project_layout_metadata_provider.cpp.
|
overridevirtual |
Checks whether a layout exists in the backing store for the given layout name or ID.
| layout_name_or_id | The name or ID of the layout to check (e.g., "PetalburgCity_Layout" or "LAYOUT_PETALBURG_CITY") |
Implements porytiles::LayoutMetadataProvider.
Definition at line 178 of file project_layout_metadata_provider.cpp.
|
overridevirtual |
Determines the given layout's height in metatiles.
| layout_name_or_id | The name or ID of the layout to check (e.g., "PetalburgCity_Layout" or "LAYOUT_PETALBURG_CITY") |
Implements porytiles::LayoutMetadataProvider.
Definition at line 204 of file project_layout_metadata_provider.cpp.
| void porytiles::ProjectLayoutMetadataProvider::invalidate_metadata_cache | ( | ) | const |
Invalidates the lazy-loaded layout cache, forcing a re-parse on next access.
This is needed when the underlying layouts.json file has been modified on disk since the cache was populated. For example, after creating a new layout entry, the cache must be invalidated so subsequent lookups see the newly written layout.
Definition at line 327 of file project_layout_metadata_provider.cpp.
|
overridevirtual |
Returns all layout IDs known to this provider.
Enumerates all layout IDs available in the backing store. This enables batch operations, validation, and listing without requiring callers to know layout IDs in advance.
Implements porytiles::LayoutMetadataProvider.
Definition at line 268 of file project_layout_metadata_provider.cpp.
|
overridevirtual |
Returns all layout names known to this provider.
Enumerates all layout names available in the backing store. This enables batch operations, validation, and listing without requiring callers to know layout names in advance.
Implements porytiles::LayoutMetadataProvider.
Definition at line 253 of file project_layout_metadata_provider.cpp.
| ChainableResult< std::string > porytiles::ProjectLayoutMetadataProvider::layouts_table_label | ( | ) | const |
Definition at line 283 of file project_layout_metadata_provider.cpp.
|
overridevirtual |
Determines the given layout's primary tileset.
| layout_name_or_id | The name or ID of the layout to check (e.g., "PetalburgCity_Layout" or "LAYOUT_PETALBURG_CITY") |
Implements porytiles::LayoutMetadataProvider.
Definition at line 220 of file project_layout_metadata_provider.cpp.
|
overridevirtual |
Determines the given layout's secondary tileset.
| layout_name_or_id | The name or ID of the layout to check (e.g., "PetalburgCity_Layout" or "LAYOUT_PETALBURG_CITY") |
Implements porytiles::LayoutMetadataProvider.
Definition at line 237 of file project_layout_metadata_provider.cpp.
|
overridevirtual |
Determines the given layout's width in metatiles.
| layout_name_or_id | The name or ID of the layout to check (e.g., "PetalburgCity_Layout" or "LAYOUT_PETALBURG_CITY") |
Implements porytiles::LayoutMetadataProvider.
Definition at line 188 of file project_layout_metadata_provider.cpp.