|
Porytiles
|
Abstract interface for generating keys and discovering tileset artifacts in a backing store. More...
#include <tileset_artifact_key_provider.hpp>
Public Member Functions | |
| virtual | ~TilesetArtifactKeyProvider ()=default |
| virtual ArtifactKey | key_for (const std::string &tileset_name, const TilesetArtifact &artifact) const =0 |
| Constructs a key for a given tileset artifact. | |
| virtual bool | artifact_exists (const ArtifactKey &key) const =0 |
| Checks whether an artifact exists in the backing store for the given key. | |
| virtual bool | tileset_exists (const std::string &tileset_name) const =0 |
| Checks whether a tileset exists in the backing store for the given tileset name. | |
| virtual std::set< std::string > | discover_porytiles_anims (const std::string &tileset_name) const =0 |
| Discovers the names of all Porytiles animations available for a tileset. | |
| virtual std::set< int > | discover_porytiles_anim_frames (const std::string &tileset_name, const std::string &anim_name) const =0 |
| Discovers the frame indices for a specific Porytiles animation. | |
| virtual std::set< std::string > | discover_porymap_anims (const std::string &tileset_name) const =0 |
| Discovers the names of all Porymap animations available for a tileset. | |
| virtual std::set< int > | discover_porymap_anim_frames (const std::string &tileset_name, const std::string &anim_name) const =0 |
| Discovers the frame indices for a specific Porymap animation. | |
| 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. | |
Abstract interface for generating keys and discovering tileset artifacts in a backing store.
This interface provides the key generation and discovery functionality needed by the tileset repository system. Implementations handle the specifics of how to organize and access artifacts in different backing stores (filesystem, database, etc.).
The interface separates key generation (which should be fast and stateless) from discovery operations (which may involve I/O to search the backing store). Implementations may choose to cache expensive lookups during construction to optimize performance.
From the interface's perspective, tileset artifact keys are simple strings wrapped by the ArtifactKey class. If a particular implementation requires a complex key type, the implementation must take care to ensure that this key type is string-constructable. Luckily, rich string-based formats like JSON should be able to support almost any imaginable key schema.
Definition at line 28 of file tileset_artifact_key_provider.hpp.
|
virtualdefault |
|
pure virtual |
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) |
Implemented in porytiles2::ProjectTilesetArtifactKeyProvider.
|
pure virtual |
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 |
Implemented in porytiles2::ProjectTilesetArtifactKeyProvider.
|
pure virtual |
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 |
Implemented in porytiles2::ProjectTilesetArtifactKeyProvider.
|
pure virtual |
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 |
Implemented in porytiles2::ProjectTilesetArtifactKeyProvider.
|
pure virtual |
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 |
Implemented in porytiles2::ProjectTilesetArtifactKeyProvider.
|
inlinevirtual |
Gets the keys for all tileset artifacts (both Porytiles and Porymap) present in the given Tileset.
This method combines the results from both get_porytiles_artifact_keys() and get_porymap_artifact_keys() to provide a comprehensive list of all artifact keys associated with the tileset. This method will only return keys that actually exist in the backing store.
| tileset_name | The name of the Tileset for which to get all artifact keys |
Definition at line 261 of file tileset_artifact_key_provider.hpp.
|
inlinevirtual |
Gets the keys for all Porymap artifacts present in the given Tileset.
Each Porymap artifact has a unique key by which the ArtifactChecksumProvider and the TilesetRepo can identify it. The format of these keys and the method for producing them are implementation-defined. This method will only return keys that actually exist in the backing store.
Definition at line 202 of file tileset_artifact_key_provider.hpp.
|
inlinevirtual |
Gets the keys for all Porytiles artifacts present in the given Tileset.
Each Porytiles artifact has a unique key by which the ArtifactChecksumProvider and the TilesetRepo can identify it. The format of these keys and the method for producing them are implementation-defined. This method will only return keys that actually exist in the backing store.
Definition at line 131 of file tileset_artifact_key_provider.hpp.
|
pure virtual |
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 |
Implemented in porytiles2::ProjectTilesetArtifactKeyProvider.
|
pure virtual |
Checks whether a tileset exists in the backing store for the given tileset name.
| tileset_name | The name of the tileset to check |
Implemented in porytiles2::ProjectTilesetArtifactKeyProvider.