Porytiles
Loading...
Searching...
No Matches
porytiles2::ProjectTilesetArtifactReader Class Referencefinal

Provides a filesystem-based implementation for TilesetArtifactReader. More...

#include <project_tileset_artifact_reader.hpp>

Inheritance diagram for porytiles2::ProjectTilesetArtifactReader:
[legend]
Collaboration diagram for porytiles2::ProjectTilesetArtifactReader:
[legend]

Public Member Functions

 ProjectTilesetArtifactReader (gsl::not_null< PngRgbaImageLoader * > png_rgba_loader, gsl::not_null< PngIndexedImageLoader * > png_indexed_loader, gsl::not_null< FilePalLoader * > pal_loader)
 
ChainableResult< void > read (Tileset &dest, const ArtifactKey &src_key, const TilesetArtifact &artifact) const override
 Reads an artifact from the backing store and updates the target Tileset.
 
- Public Member Functions inherited from porytiles2::TilesetArtifactReader
virtual ~TilesetArtifactReader ()=default
 

Detailed Description

Provides a filesystem-based implementation for TilesetArtifactReader.

This class implements the TilesetArtifactReader interface to provide reading functionality for tileset artifacts. It operates within the context of a Pokémon Gen III decompilation project on the local filesystem.

Definition at line 23 of file project_tileset_artifact_reader.hpp.

Constructor & Destructor Documentation

◆ ProjectTilesetArtifactReader()

porytiles2::ProjectTilesetArtifactReader::ProjectTilesetArtifactReader ( gsl::not_null< PngRgbaImageLoader * >  png_rgba_loader,
gsl::not_null< PngIndexedImageLoader * >  png_indexed_loader,
gsl::not_null< FilePalLoader * >  pal_loader 
)
inline

Definition at line 25 of file project_tileset_artifact_reader.hpp.

Member Function Documentation

◆ read()

ChainableResult< void > porytiles2::ProjectTilesetArtifactReader::read ( Tileset dest,
const ArtifactKey src_key,
const TilesetArtifact artifact 
) const
overridevirtual

Reads an artifact from the backing store and updates the target Tileset.

This method reads the specified artifact from the backing store location identified by the src_key and updates the appropriate fields or components within the destination Tileset object. The TilesetArtifact parameter specifies the type and metadata needed to determine how to read and where to store the data. The implementation should handle parsing the specific artifact format (PNG images, binary data, CSV files, etc.) and updating the correct Tileset components (Porymap or Porytiles components, palettes, animations, etc.).

Precondition: the TilesetRepo checks that src_key actually exists before performing a read. Thus, the TilesetArtifactReader's read method can assume the specified artifact really does exist. If the artifact does not exist, the result is implementation-defined but will probably panic.

Parameters
destThe Tileset object to be updated with the read artifact data
src_keyThe ArtifactKey identifying the artifact location in the backing store
artifactThe TilesetArtifact specification including type and optional metadata
Returns
Empty Result on success, otherwise an error description

Implements porytiles2::TilesetArtifactReader.

Definition at line 181 of file project_tileset_artifact_reader.cpp.


The documentation for this class was generated from the following files: