|
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) | |
| ArtifactKey | key_for (const std::string &tileset_name, const TilesetArtifact &artifact) const override |
| Constructs a key for a given tileset artifact. | |
| bool | artifact_exists (const ArtifactKey &key) const override |
| Checks whether an artifact exists in the backing store for the given key. | |
| bool | tileset_exists (const std::string &tileset_name) const override |
| Checks whether a tileset exists in the backing store for the given tileset name. | |
| 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. | |
| std::set< int > | 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. | |
| 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. | |
| std::set< int > | 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. | |
| std::filesystem::path | tileset_root (const std::string &tileset_name) const |
| Returns the filesystem path to the root directory of a tileset. | |
Public Member Functions inherited from porytiles2::TilesetArtifactKeyProvider | |
| virtual | ~TilesetArtifactKeyProvider ()=default |
| virtual 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 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 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.
Class precondition: the tileset_name parameter in each method below (except tileset_exists) must refer to an existing tileset on-disk. If no tileset corresponds to the given tileset_name, ProjectTilesetKeyProvider will panic.
Definition at line 24 of file project_tileset_artifact_key_provider.hpp.
|
inlineexplicit |
Definition at line 26 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 porytiles2::TilesetArtifactKeyProvider.
Definition at line 119 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 porytiles2::TilesetArtifactKeyProvider.
Definition at line 241 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 porytiles2::TilesetArtifactKeyProvider.
Definition at line 210 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 porytiles2::TilesetArtifactKeyProvider.
Definition at line 167 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 porytiles2::TilesetArtifactKeyProvider.
Definition at line 136 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Constructs a key for a given tileset artifact.
This method should focus primarily on building keys from the provided parameters, not on searching the filesystem or backing store. The key generation should be fast and deterministic based on the tileset name and artifact specification.
| tileset_name | The name of the tileset for the tileset artifact |
| artifact | The artifact details specifying type, name, and index as applicable |
Implements porytiles2::TilesetArtifactKeyProvider.
Definition at line 47 of file project_tileset_artifact_key_provider.cpp.
|
overridevirtual |
Checks whether a tileset exists in the backing store for the given tileset name.
| tileset_name | The name of the tileset to check |
Implements porytiles2::TilesetArtifactKeyProvider.
Definition at line 125 of file project_tileset_artifact_key_provider.cpp.
| std::filesystem::path porytiles2::ProjectTilesetArtifactKeyProvider::tileset_root | ( | const std::string & | tileset_name | ) | const |
Returns the filesystem path to the root directory of a tileset.
This method provides the base directory path where all artifacts for a specific tileset are stored within the project's filesystem structure. This is specific to the filesystem-based implementation, as other backing stores may not have a concept of a single root directory for tileset artifacts.
| tileset_name | The name of the tileset |
Definition at line 285 of file project_tileset_artifact_key_provider.cpp.