Porytiles
Loading...
Searching...
No Matches
porytiles::TilesetMetadataProvider Class Referenceabstract

Abstract interface for querying tileset metadata by name. More...

#include <tileset_metadata_provider.hpp>

Inheritance diagram for porytiles::TilesetMetadataProvider:
[legend]

Public Member Functions

virtual ~TilesetMetadataProvider ()=default
 
virtual bool exists (const std::string &tileset_name) const =0
 Checks whether a tileset exists in the backing store for the given tileset name.
 
virtual ChainableResult< bool > is_secondary (const std::string &tileset_name) const =0
 Determines whether a tileset is a secondary tileset.
 
virtual ChainableResult< bool > has_animations (const std::string &tileset_name) const =0
 Determines whether a tileset has animation support.
 
virtual ChainableResult< std::set< std::string > > tilesets () const =0
 Returns all tileset names known to this provider.
 

Detailed Description

Abstract interface for querying tileset metadata by name.

TilesetMetadataProvider defines a domain-layer abstraction for retrieving metadata about tilesets. This allows the domain logic to query tileset properties (such as whether a tileset is primary/secondary or has animations) without depending on any specific data source or I/O mechanism. Concrete implementations may source this metadata from project files, configuration, or other external systems.

Invariant
Implementations must return consistent results for the same tileset_name within a single compilation run.

Definition at line 21 of file tileset_metadata_provider.hpp.

Constructor & Destructor Documentation

◆ ~TilesetMetadataProvider()

virtual porytiles::TilesetMetadataProvider::~TilesetMetadataProvider ( )
virtualdefault

Member Function Documentation

◆ exists()

virtual bool porytiles::TilesetMetadataProvider::exists ( const std::string &  tileset_name) const
pure virtual

Checks whether a tileset exists in the backing store for the given tileset name.

Parameters
tileset_nameThe name of the tileset to check (e.g., "gTileset_General")
Returns
True if the tileset exists in the backing store, false otherwise

Implemented in porytiles::ProjectTilesetMetadataProvider.

◆ has_animations()

virtual ChainableResult< bool > porytiles::TilesetMetadataProvider::has_animations ( const std::string &  tileset_name) const
pure virtual

Determines whether a tileset has animation support.

Animated tilesets have a non-null animation callback function that cycles through animation frames. This information is needed to properly handle tile references that may animate at runtime.

Parameters
tileset_nameThe identifier for the tileset (e.g., "gTileset_General")
Returns
ChainableResult containing true if the tileset has animations, false otherwise

Implemented in porytiles::ProjectTilesetMetadataProvider.

◆ is_secondary()

virtual ChainableResult< bool > porytiles::TilesetMetadataProvider::is_secondary ( const std::string &  tileset_name) const
pure virtual

Determines whether a tileset is a secondary tileset.

In pokeemerald, tilesets are either primary or secondary. Primary tilesets contain shared tiles and palettes, while secondary tilesets contain map-specific content and layer on top of primaries. This distinction affects tile indexing, palette allocation, and metatile attribute encoding.

Parameters
tileset_nameThe identifier for the tileset (e.g., "gTileset_General")
Returns
ChainableResult containing true if the tileset is secondary, false if primary

Implemented in porytiles::ProjectTilesetMetadataProvider.

◆ tilesets()

virtual ChainableResult< std::set< std::string > > porytiles::TilesetMetadataProvider::tilesets ( ) const
pure virtual

Returns all tileset names known to this provider.

Enumerates all tilesets available in the backing store. This enables batch operations, validation, and listing without requiring callers to know tileset names in advance.

Returns
ChainableResult containing a set of all tileset names

Implemented in porytiles::ProjectTilesetMetadataProvider.


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