Porytiles
Loading...
Searching...
No Matches
porytiles::ProjectLayoutMetadata Class Reference

Represents parsed metadata for a single layout from layouts.json. More...

#include <project_layout_metadata.hpp>

Public Member Functions

 ProjectLayoutMetadata (std::string id, std::string name, std::size_t width, std::size_t height, std::string primary_tileset, std::string secondary_tileset, std::filesystem::path border_filepath, std::filesystem::path blockdata_filepath)
 Constructs a ProjectLayoutMetadata from parsed layout fields.
 
const std::string & id () const
 
const std::string & name () const
 
std::size_t width () const
 
std::size_t height () const
 
const std::string & primary_tileset () const
 
const std::string & secondary_tileset () const
 
const std::filesystem::path & border_filepath () const
 
const std::filesystem::path & blockdata_filepath () const
 

Detailed Description

Represents parsed metadata for a single layout from layouts.json.

ProjectLayoutMetadata captures the key fields from a pokeemerald layout definition:

{
"id": "LAYOUT_PETALBURG_CITY",
"name": "PetalburgCity_Layout",
"width": 20,
"height": 20,
"primary_tileset": "gTileset_General",
"secondary_tileset": "gTileset_Petalburg",
"border_filepath": "data/layouts/PetalburgCity/border.bin",
"blockdata_filepath": "data/layouts/PetalburgCity/map.bin"
}
Invariant
id_ is never empty
name_ is never empty
primary_tileset_ is never empty
secondary_tileset_ is never empty

Definition at line 33 of file project_layout_metadata.hpp.

Constructor & Destructor Documentation

◆ ProjectLayoutMetadata()

porytiles::ProjectLayoutMetadata::ProjectLayoutMetadata ( std::string  id,
std::string  name,
std::size_t  width,
std::size_t  height,
std::string  primary_tileset,
std::string  secondary_tileset,
std::filesystem::path  border_filepath,
std::filesystem::path  blockdata_filepath 
)
inline

Constructs a ProjectLayoutMetadata from parsed layout fields.

Parameters
idThe layout ID (e.g., "LAYOUT_PETALBURG_CITY")
nameThe layout name (e.g., "PetalburgCity_Layout")
widthThe layout width in metatiles
heightThe layout height in metatiles
primary_tilesetThe primary tileset name (e.g., "gTileset_General")
secondary_tilesetThe secondary tileset name (e.g., "gTileset_Petalburg")
border_filepathRelative path to the border file
blockdata_filepathRelative path to the blockdata file

Definition at line 47 of file project_layout_metadata.hpp.

Member Function Documentation

◆ blockdata_filepath()

const std::filesystem::path & porytiles::ProjectLayoutMetadata::blockdata_filepath ( ) const
inline

Definition at line 97 of file project_layout_metadata.hpp.

◆ border_filepath()

const std::filesystem::path & porytiles::ProjectLayoutMetadata::border_filepath ( ) const
inline

Definition at line 92 of file project_layout_metadata.hpp.

◆ height()

std::size_t porytiles::ProjectLayoutMetadata::height ( ) const
inline

Definition at line 77 of file project_layout_metadata.hpp.

◆ id()

const std::string & porytiles::ProjectLayoutMetadata::id ( ) const
inline

Definition at line 62 of file project_layout_metadata.hpp.

◆ name()

const std::string & porytiles::ProjectLayoutMetadata::name ( ) const
inline

Definition at line 67 of file project_layout_metadata.hpp.

◆ primary_tileset()

const std::string & porytiles::ProjectLayoutMetadata::primary_tileset ( ) const
inline

Definition at line 82 of file project_layout_metadata.hpp.

◆ secondary_tileset()

const std::string & porytiles::ProjectLayoutMetadata::secondary_tileset ( ) const
inline

Definition at line 87 of file project_layout_metadata.hpp.

◆ width()

std::size_t porytiles::ProjectLayoutMetadata::width ( ) const
inline

Definition at line 72 of file project_layout_metadata.hpp.


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