|
Porytiles
|
Provides a pokeemerald project filesystem-based implementation for TilesetArtifactKeyProvider. More...
#include <project_tileset_artifact_key_provider.hpp>
Public Member Functions | |
| ProjectTilesetArtifactKeyProvider (std::filesystem::path project_root, gsl::not_null< const InfraConfig * > config, gsl::not_null< const TilesetMetadataProvider * > metadata_provider, gsl::not_null< const TextFormatter * > format, gsl::not_null< const UserDiagnostics * > diag) | |
| Constructs a ProjectTilesetArtifactKeyProvider. | |
| ChainableResult< ArtifactKey > | key_for_metatiles_bin (const std::string &tileset_name) const override |
| ChainableResult< ArtifactKey > | key_for_metatile_attributes_bin (const std::string &tileset_name) const override |
| ChainableResult< ArtifactKey > | key_for_tiles_png (const std::string &tileset_name) const override |
| ChainableResult< ArtifactKey > | key_for_porymap_pal_n (const std::string &tileset_name, std::size_t index) const override |
| ChainableResult< ArtifactKey > | key_for_porymap_anim_frame (const std::string &tileset_name, const std::string &anim_name, const std::string &frame_name) const override |
| ChainableResult< ArtifactKey > | key_for_porymap_anim_params (const std::string &tileset_name) const override |
| Returns the key for Porymap animation parameters. | |
| ChainableResult< ArtifactKey > | key_for_bottom_png (const std::string &tileset_name) const override |
| ChainableResult< ArtifactKey > | key_for_middle_png (const std::string &tileset_name) const override |
| ChainableResult< ArtifactKey > | key_for_top_png (const std::string &tileset_name) const override |
| ChainableResult< ArtifactKey > | key_for_attributes_csv (const std::string &tileset_name) const override |
| ChainableResult< ArtifactKey > | key_for_porytiles_pal_n (const std::string &tileset_name, std::size_t index) const override |
| ChainableResult< ArtifactKey > | key_for_porytiles_anim_frame (const std::string &tileset_name, const std::string &anim_name, const std::string &frame_name) const override |
| ChainableResult< ArtifactKey > | key_for_porytiles_anim_params (const std::string &tileset_name) const override |
| Returns the key for the anim.json file (Porytiles animation configuration). | |
| bool | artifact_exists (const ArtifactKey &key) const override |
| Checks whether an artifact exists in the backing store for the given key. | |
| ChainableResult< std::set< std::string > > | discover_porymap_anims (const std::string &tileset_name) const override |
| Discovers the names of all Porymap animations available for a tileset. | |
| ChainableResult< std::set< std::string > > | discover_porymap_anim_frames (const std::string &tileset_name, const std::string &anim_name) const override |
| Discovers the frame indices for a specific Porymap animation. | |
| ChainableResult< std::set< std::string > > | discover_porytiles_anims (const std::string &tileset_name) const override |
| Discovers the names of all Porytiles animations available for a tileset. | |
| ChainableResult< std::set< std::string > > | discover_porytiles_anim_frames (const std::string &tileset_name, const std::string &anim_name) const override |
| Discovers the frame indices for a specific Porytiles animation. | |
Public Member Functions inherited from porytiles::TilesetArtifactKeyProvider | |
| virtual | ~TilesetArtifactKeyProvider ()=default |
| virtual ChainableResult< std::vector< ArtifactKey > > | get_porymap_artifact_keys (const std::string &tileset_name) const |
| Gets the keys for all Porymap artifacts present in the given Tileset. | |
| virtual ChainableResult< std::vector< ArtifactKey > > | get_porytiles_artifact_keys (const std::string &tileset_name) const |
| Gets the keys for all Porytiles artifacts present in the given Tileset. | |
| virtual ChainableResult< std::vector< ArtifactKey > > | get_all_artifact_keys (const std::string &tileset_name) const |
| Gets the keys for all tileset artifacts (both Porytiles and Porymap) present in the given Tileset. | |
Provides a pokeemerald project filesystem-based implementation for TilesetArtifactKeyProvider.
This class implements the TilesetArtifactKeyProvider interface to provide filesystem paths as keys for various tileset artifacts. It operates within the context of a Pokémon Gen III decompilation project, discovering and managing paths for animations, tiles, and other tileset components based on the project's directory structure.
Tileset metadata and artifact paths are discovered dynamically by parsing C source files (headers.h, graphics.h, metatiles.h) rather than relying on hardcoded filesystem path conventions.
For Porymap artifacts (tiles, palettes, metatiles), paths are resolved from INCBIN declarations. For Porytiles artifacts (bottom.png, middle.png, etc.), paths use a hardcoded relative location within each tileset.
Definition at line 35 of file project_tileset_artifact_key_provider.hpp.
|
inlineexplicit |
Constructs a ProjectTilesetArtifactKeyProvider.
| project_root | The root directory of the pokeemerald-style project |
| format | Text formatter for styled output (non-owning, must outlive this) |
| diag | Diagnostics handler for warnings (non-owning, must outlive this) |
Definition at line 44 of file project_tileset_artifact_key_provider.hpp.
|
overridevirtual |
Checks whether an artifact exists in the backing store for the given key.
This method should perform the actual existence check against the backing store using the provided key. This may involve filesystem operations, database queries, or other I/O depending on the implementation.
| key | The key identifying the artifact to check (generated by key_for) |
Implements porytiles::TilesetArtifactKeyProvider.
Definition at line 384 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Discovers the frame indices for a specific Porymap animation.
Searches the backing store to find all animation frame files (excluding the key frame and 00.png) for a specific Porymap animation. The returned indices should be consecutive starting from 1. Since frame 0 is required, callers don't need to discover it.
| tileset_name | The name of the tileset containing the animation |
| anim_name | The name of the animation to search for frames |
Implements porytiles::TilesetArtifactKeyProvider.
Definition at line 410 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Discovers the names of all Porymap animations available for a tileset.
Searches the backing store to find all Porymap animation assets for the specified tileset. Porymap animations do not require key frames, only sequential frame files.
| tileset_name | The name of the tileset to search for animations |
Implements porytiles::TilesetArtifactKeyProvider.
Definition at line 392 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Discovers the frame indices for a specific Porytiles animation.
Searches the backing store to find all animation frame files (excluding the key frame and 00.png) for a specific Porytiles animation. The returned indices should be consecutive starting from 1. Since frame 0 is required, callers don't need to discover it.
| tileset_name | The name of the tileset containing the animation |
| anim_name | The name of the animation to search for frames |
Implements porytiles::TilesetArtifactKeyProvider.
Definition at line 448 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Discovers the names of all Porytiles animations available for a tileset.
Searches the backing store to find all Porytiles animation directories or assets for the specified tileset. Porytiles animations require both a key frame and at least one animation frame (00.png).
| tileset_name | The name of the tileset to search for animations |
Implements porytiles::TilesetArtifactKeyProvider.
Definition at line 430 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Implements porytiles::TilesetArtifactKeyProvider.
Definition at line 301 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Implements porytiles::TilesetArtifactKeyProvider.
Definition at line 240 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Implements porytiles::TilesetArtifactKeyProvider.
Definition at line 146 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Implements porytiles::TilesetArtifactKeyProvider.
Definition at line 125 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Implements porytiles::TilesetArtifactKeyProvider.
Definition at line 261 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Implements porytiles::TilesetArtifactKeyProvider.
Definition at line 207 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Returns the key for Porymap animation parameters.
| tileset_name | The name of the tileset |
Implements porytiles::TilesetArtifactKeyProvider.
Definition at line 229 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Implements porytiles::TilesetArtifactKeyProvider.
Definition at line 187 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Implements porytiles::TilesetArtifactKeyProvider.
Definition at line 342 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Returns the key for the anim.json file (Porytiles animation configuration).
The anim.json file stores animation parameters for the Porytiles component. It defines frame sequences, timing parameters, and other configuration for each animation in the tileset. For Porytiles animations, the anim parameters store is the source of truth for animation names, frame sequences, timing, and other parameters.
| tileset_name | The name of the tileset |
Implements porytiles::TilesetArtifactKeyProvider.
Definition at line 364 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Implements porytiles::TilesetArtifactKeyProvider.
Definition at line 322 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Implements porytiles::TilesetArtifactKeyProvider.
Definition at line 166 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Implements porytiles::TilesetArtifactKeyProvider.
Definition at line 281 of file project_tileset_artifact_key_provider.cpp.