|
Porytiles
|
Provides a filesystem-based implementation for TilesetArtifactWriter. More...
#include <project_tileset_artifact_writer.hpp>
Public Member Functions | |
| ProjectTilesetArtifactWriter (gsl::not_null< InfraConfig * > config, std::filesystem::path project_root, gsl::not_null< PngRgbaImageSaver * > png_rgba_saver, gsl::not_null< PngIndexedImageSaver * > png_indexed_saver, gsl::not_null< FilePalSaver * > pal_saver) | |
| Result< void > | begin_transaction () override |
| Begins a new transaction for atomic write operations. | |
| ChainableResult< void > | commit () override |
| Commits all buffered write operations in the current transaction. | |
| Result< void > | rollback () override |
| Rolls back all buffered write operations in the current transaction. | |
| ChainableResult< void > | write (const ArtifactKey &dest_key, const TilesetArtifact &artifact, const Tileset &src) override |
| Writes an artifact from a Tileset to the backing store. | |
Public Member Functions inherited from porytiles2::TilesetArtifactWriter | |
| virtual | ~TilesetArtifactWriter ()=default |
Provides a filesystem-based implementation for TilesetArtifactWriter.
This class implements the TilesetArtifactWriter interface to provide writing functionality for tileset artifacts. It operates within the context of a Pokémon Gen III decompilation project on the local filesystem.
Definition at line 21 of file project_tileset_artifact_writer.hpp.
|
inline |
Definition at line 23 of file project_tileset_artifact_writer.hpp.
|
overridevirtual |
Begins a new transaction for atomic write operations.
Starts a transaction that buffers all subsequent write operations until a commit() call. If a transaction is already active, this should return an error.
Implements porytiles2::TilesetArtifactWriter.
Definition at line 117 of file project_tileset_artifact_writer.cpp.
|
overridevirtual |
Commits all buffered write operations in the current transaction.
Finalizes and persists all write operations that were buffered since begin_transaction() was called. After commit, the transaction is closed and a new one must be started for further transactional writes. If no transaction is active, this should return an error.
Implements porytiles2::TilesetArtifactWriter.
Definition at line 127 of file project_tileset_artifact_writer.cpp.
|
overridevirtual |
Rolls back all buffered write operations in the current transaction.
Discards all write operations that were buffered since begin_transaction() was called. After rollback, the transaction is closed and a new one must be started for further transactional writes. If no transaction is active, this should return an error.
Implements porytiles2::TilesetArtifactWriter.
Definition at line 222 of file project_tileset_artifact_writer.cpp.
|
overridevirtual |
Writes an artifact from a Tileset to the backing store.
This method extracts the appropriate data from the source Tileset object and writes the specified artifact to the backing store location identified by the dest_key. The TilesetArtifact parameter specifies the type and metadata needed to determine what data to extract and how to format it.
The implementation should handle formatting the specific artifact type (PNG images, binary data, etc.) and extracting the correct data from the Tileset components (Porymap or Porytiles components, palettes, animations, etc.).
If a transaction is active (via begin_transaction()), the write should buffer until a commit() call. If no transaction is active, the behavior is implementation-defined (immediate write or error).
| dest_key | The ArtifactKey identifying the destination location in the backing store |
| artifact | The TilesetArtifact specification including type and optional metadata |
| src | The Tileset object containing the data to be written |
Implements porytiles2::TilesetArtifactWriter.
Definition at line 242 of file project_tileset_artifact_writer.cpp.