|
Porytiles
|
Abstract interface for querying Porytiles tileset ownership. More...
#include <porytiles_tileset_manager.hpp>
Public Member Functions | |
| virtual | ~PorytilesTilesetManager ()=default |
| virtual bool | is_porytiles_managed (const std::string &tileset_name) const =0 |
| Checks whether a tileset is managed by Porytiles. | |
| virtual ChainableResult< void > | persist_managed_existing (const std::string &tileset_name) const =0 |
| Persists managed state for an existing tileset. | |
| virtual ChainableResult< void > | persist_managed_new (const std::string &tileset_name, bool is_secondary=false) const =0 |
| Persists managed state for a new tileset. | |
| virtual ChainableResult< void > | wire_anim_code (const std::string &tileset_name, bool is_secondary) const =0 |
| Wires animation code for a tileset that already has its manifest persisted. | |
| virtual ChainableResult< void > | remove_wired_anim_code (const std::string &tileset_name, bool is_secondary) const =0 |
| Removes wired animation code for a tileset from the project. | |
Abstract interface for querying Porytiles tileset ownership.
This interface provides a domain-layer abstraction for determining whether a tileset is managed by Porytiles. A Porytiles-managed tileset is one that was either imported into or created by Porytiles, as opposed to a vanilla pokeemerald tileset that has not been processed.
Implementations may use different strategies to determine ownership (e.g., checking for marker files, querying a database, etc.).
Definition at line 22 of file porytiles_tileset_manager.hpp.
|
virtualdefault |
|
pure virtual |
Checks whether a tileset is managed by Porytiles.
If the tileset does not exist, this function returns false.
| tileset_name | The name of the tileset (e.g., "gTileset_General") |
Implemented in porytiles::ProjectPorytilesTilesetManager.
|
pure virtual |
Persists managed state for an existing tileset.
Used when an existing tileset in headers.h is being converted to Porytiles-managed. The implementation reads original field values from headers.h and stores them in the tileset manifest for potential restoration later.
| tileset_name | The name of the tileset (e.g., "gTileset_General") |
Implemented in porytiles::ProjectPorytilesTilesetManager.
|
pure virtual |
Persists managed state for a new tileset.
Used when a new tileset is being added from scratch. The implementation creates a new entry in headers.h rather than modifying an existing one.
| tileset_name | The name of the tileset (e.g., "gTileset_MyNewTileset") |
Implemented in porytiles::ProjectPorytilesTilesetManager.
|
pure virtual |
Removes wired animation code for a tileset from the project.
Performs the inverse of wire_anim_code(). This method:
The callback is only cleared if it starts with "InitTilesetAnim_PorytilesManaged_". User-managed callbacks are preserved, allowing users to set wire_anim_code=false while maintaining their own custom animation callbacks.
This method is idempotent - safe to call even if no wiring exists. Should be called after compilation when a tileset has no animations to ensure stale animation references are cleaned up.
| tileset_name | Name of the tileset to remove wiring for |
| is_secondary | True if this is a secondary tileset |
Implemented in porytiles::ProjectPorytilesTilesetManager.
|
pure virtual |
Wires animation code for a tileset that already has its manifest persisted.
Called after compilation when a tileset has animations. Performs:
Idempotent - safe to call multiple times.
| tileset_name | The tileset name (e.g., "gTileset_MyTileset") |
| is_secondary | True for secondary tilesets, false for primary |
Implemented in porytiles::ProjectPorytilesTilesetManager.