Uranus  1.0.1.0
Uranus is a GameEngine written in C++
Loading...
Searching...
No Matches
tson::Chunk Class Reference
Collaboration diagram for tson::Chunk:
[legend]

Public Member Functions

 Chunk (IJson &json)
 
const std::string & getBase64Data () const
 
const std::vector< int > & getData () const
 
const Vector2igetPosition () const
 
const Vector2igetSize () const
 
bool parse (IJson &json)
 

Private Attributes

std::string m_base64Data
 
std::vector< int > m_data
 
tson::Vector2i m_position
 
tson::Vector2i m_size
 

Constructor & Destructor Documentation

◆ Chunk()

tson::Chunk::Chunk ( IJson json)
inlineexplicit

Parses 'chunk' data from Tiled json and stores the values in this class

Parameters
jsonjson-data

Member Function Documentation

◆ getBase64Data()

const std::string & tson::Chunk::getBase64Data ( ) const
inline

'data' (when string): Array of unsigned int (GIDs) or base64-encoded data.

Returns
base64 string

◆ getData()

const std::vector< int > & tson::Chunk::getData ( ) const
inline

'data' (when uint array): Array of unsigned int (GIDs) or base64-encoded data. tilelayer only.

Returns
list of tile ids

◆ getPosition()

const tson::Vector2i & tson::Chunk::getPosition ( ) const
inline

'x' and 'y' position in tiles

Returns
Position in int

◆ getSize()

const tson::Vector2i & tson::Chunk::getSize ( ) const
inline

x='width' (in tiles) and y='height' (in tiles).

Returns
Size (x and y), containing the values from the fields 'width' and 'height' in Tiled

◆ parse()

bool tson::Chunk::parse ( IJson json)
inline

Parses 'chunk' data from Tiled json and stores the values in this class

Parameters
jsonjson-data
Returns
true if all mandatory fields was found. false otherwise.

Field Documentation

◆ m_base64Data

std::string tson::Chunk::m_base64Data
private

'data' (when uint array): Array of unsigned int (GIDs) or base64-encoded data. tilelayer only.

◆ m_position

tson::Vector2i tson::Chunk::m_position
private

x='width' (in tiles) and y='height' (in tiles):

◆ m_size

tson::Vector2i tson::Chunk::m_size
private

'data' (when string): Array of unsigned int (GIDs) or base64-encoded data.


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