Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Olympe::Tiled::TiledLevelLoader Class Reference

#include <TiledLevelLoader.h>

Public Member Functions

 TiledLevelLoader ()
 
 ~TiledLevelLoader ()
 
bool LoadFromFile (const std::string &filepath, TiledMap &outMap)
 
const std::string & GetLastError () const
 

Private Member Functions

bool ParseMap (const json &j, TiledMap &map)
 
bool ParseMapXML (void *doc, TiledMap &map)
 
bool ParseLayer (const json &j, std::shared_ptr< TiledLayer > &layer)
 
bool ParseLayerXML (void *element, std::shared_ptr< TiledLayer > &layer)
 
bool ParseTileLayer (const json &j, TiledLayer &layer)
 
bool ParseTileLayerXML (void *element, TiledLayer &layer)
 
bool ParseObjectLayer (const json &j, TiledLayer &layer)
 
bool ParseObjectLayerXML (void *element, TiledLayer &layer)
 
bool ParseImageLayer (const json &j, TiledLayer &layer)
 
bool ParseImageLayerXML (void *element, TiledLayer &layer)
 
bool ParseGroupLayer (const json &j, TiledLayer &layer)
 
bool ParseGroupLayerXML (void *element, TiledLayer &layer)
 
bool ParseObject (const json &j, TiledObject &object)
 
bool ParseObjectXML (void *element, TiledObject &object)
 
bool ParseTileset (const json &j, TiledTileset &tileset, const std::string &mapDir)
 
bool ParseTilesetXML (void *element, TiledTileset &tileset, const std::string &mapDir)
 
bool LoadExternalTileset (const std::string &filepath, TiledTileset &tileset)
 
bool ParseChunk (const json &j, TiledChunk &chunk, const std::string &layerEncoding, const std::string &layerCompression)
 
bool ParseChunkXML (void *element, TiledChunk &chunk, const std::string &layerEncoding, const std::string &layerCompression)
 
void ParseProperties (const json &j, std::map< std::string, TiledProperty > &properties)
 
void ParsePropertiesXML (void *element, std::map< std::string, TiledProperty > &properties)
 
void ParseProperty (const json &j, TiledProperty &prop)
 
void ParsePropertyXML (void *element, TiledProperty &prop)
 
bool ParseTileData (const json &j, TiledLayer &layer)
 
bool ParseTileDataXML (void *element, TiledLayer &layer)
 
std::string ResolvePath (const std::string &mapDir, const std::string &relativePath)
 
std::string GetDirectory (const std::string &filepath)
 
bool ReadFile (const std::string &filepath, std::string &outContent)
 

Private Attributes

std::string lastError_
 

Detailed Description

Definition at line 24 of file TiledLevelLoader.h.

Constructor & Destructor Documentation

◆ TiledLevelLoader()

Olympe::Tiled::TiledLevelLoader::TiledLevelLoader ( )

Definition at line 18 of file TiledLevelLoader.cpp.

◆ ~TiledLevelLoader()

Olympe::Tiled::TiledLevelLoader::~TiledLevelLoader ( )

Definition at line 22 of file TiledLevelLoader.cpp.

Member Function Documentation

◆ GetDirectory()

std::string Olympe::Tiled::TiledLevelLoader::GetDirectory ( const std::string &  filepath)
private

Definition at line 1212 of file TiledLevelLoader.cpp.

References GetComponentTypeID_Static().

Referenced by LoadFromFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetLastError()

const std::string & Olympe::Tiled::TiledLevelLoader::GetLastError ( ) const
inline

Definition at line 34 of file TiledLevelLoader.h.

References lastError_.

Referenced by Olympe::Tiled::LevelParser::ParseAndAnalyze().

+ Here is the caller graph for this function:

◆ LoadExternalTileset()

bool Olympe::Tiled::TiledLevelLoader::LoadExternalTileset ( const std::string &  filepath,
TiledTileset tileset 
)
private

◆ LoadFromFile()

bool Olympe::Tiled::TiledLevelLoader::LoadFromFile ( const std::string &  filepath,
TiledMap outMap 
)

Definition at line 26 of file TiledLevelLoader.cpp.

References GetComponentTypeID_Static(), GetDirectory(), lastError_, LoadExternalTileset(), ParseMap(), ParseMapXML(), ReadFile(), ResolvePath(), and SYSTEM_LOG.

+ Here is the call graph for this function:

◆ ParseChunk()

bool Olympe::Tiled::TiledLevelLoader::ParseChunk ( const json j,
TiledChunk chunk,
const std::string &  layerEncoding,
const std::string &  layerCompression 
)
private

Definition at line 446 of file TiledLevelLoader.cpp.

References Olympe::Tiled::TiledDecoder::DecodeTileData(), GetComponentTypeID_Static(), Olympe::Tiled::GetInt(), Olympe::Tiled::HasKey(), and SYSTEM_LOG.

Referenced by ParseTileLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ParseChunkXML()

bool Olympe::Tiled::TiledLevelLoader::ParseChunkXML ( void element,
TiledChunk chunk,
const std::string &  layerEncoding,
const std::string &  layerCompression 
)
private

Definition at line 1102 of file TiledLevelLoader.cpp.

References Olympe::Tiled::TiledDecoder::DecodeTileData(), GetComponentTypeID_Static(), and SYSTEM_LOG.

Referenced by ParseTileLayerXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ParseGroupLayer()

bool Olympe::Tiled::TiledLevelLoader::ParseGroupLayer ( const json j,
TiledLayer layer 
)
private

Definition at line 270 of file TiledLevelLoader.cpp.

References GetComponentTypeID_Static(), Olympe::Tiled::HasKey(), Olympe::Tiled::TiledLayer::layers, and ParseLayer().

Referenced by ParseLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ParseGroupLayerXML()

bool Olympe::Tiled::TiledLevelLoader::ParseGroupLayerXML ( void element,
TiledLayer layer 
)
private

Definition at line 903 of file TiledLevelLoader.cpp.

References GetComponentTypeID_Static(), Olympe::Tiled::TiledLayer::layers, and ParseLayerXML().

Referenced by ParseLayerXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ParseImageLayer()

bool Olympe::Tiled::TiledLevelLoader::ParseImageLayer ( const json j,
TiledLayer layer 
)
private

Definition at line 262 of file TiledLevelLoader.cpp.

References Olympe::Tiled::GetBool(), GetComponentTypeID_Static(), Olympe::Tiled::GetString(), Olympe::Tiled::TiledLayer::image, Olympe::Tiled::TiledLayer::repeatx, and Olympe::Tiled::TiledLayer::repeaty.

Referenced by ParseLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ParseImageLayerXML()

bool Olympe::Tiled::TiledLevelLoader::ParseImageLayerXML ( void element,
TiledLayer layer 
)
private

Definition at line 887 of file TiledLevelLoader.cpp.

References GetComponentTypeID_Static(), Olympe::Tiled::TiledLayer::image, Olympe::Tiled::TiledLayer::repeatx, and Olympe::Tiled::TiledLayer::repeaty.

Referenced by ParseLayerXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ParseLayer()

bool Olympe::Tiled::TiledLevelLoader::ParseLayer ( const json j,
std::shared_ptr< TiledLayer > &  layer 
)
private

◆ ParseLayerXML()

bool Olympe::Tiled::TiledLevelLoader::ParseLayerXML ( void element,
std::shared_ptr< TiledLayer > &  layer 
)
private

◆ ParseMap()

bool Olympe::Tiled::TiledLevelLoader::ParseMap ( const json j,
TiledMap map 
)
private

◆ ParseMapXML()

bool Olympe::Tiled::TiledLevelLoader::ParseMapXML ( void doc,
TiledMap map 
)
private

◆ ParseObject()

bool Olympe::Tiled::TiledLevelLoader::ParseObject ( const json j,
TiledObject object 
)
private

◆ ParseObjectLayer()

bool Olympe::Tiled::TiledLevelLoader::ParseObjectLayer ( const json j,
TiledLayer layer 
)
private

Definition at line 247 of file TiledLevelLoader.cpp.

References GetComponentTypeID_Static(), Olympe::Tiled::HasKey(), Olympe::Tiled::TiledLayer::objects, and ParseObject().

Referenced by ParseLayer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ParseObjectLayerXML()

bool Olympe::Tiled::TiledLevelLoader::ParseObjectLayerXML ( void element,
TiledLayer layer 
)
private

Definition at line 869 of file TiledLevelLoader.cpp.

References GetComponentTypeID_Static(), Olympe::Tiled::TiledLayer::objects, and ParseObjectXML().

Referenced by ParseLayerXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ParseObjectXML()

bool Olympe::Tiled::TiledLevelLoader::ParseObjectXML ( void element,
TiledObject object 
)
private

Definition at line 926 of file TiledLevelLoader.cpp.

References Olympe::Tiled::Ellipse, GetComponentTypeID_Static(), ParsePropertiesXML(), Olympe::Tiled::Point, Olympe::Tiled::Polygon, Olympe::Tiled::Polyline, Olympe::Tiled::Rectangle, and Olympe::Tiled::Text.

Referenced by ParseObjectLayerXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ParseProperties()

void Olympe::Tiled::TiledLevelLoader::ParseProperties ( const json j,
std::map< std::string, TiledProperty > &  properties 
)
private

Definition at line 506 of file TiledLevelLoader.cpp.

References GetComponentTypeID_Static(), and ParseProperty().

Referenced by ParseLayer(), ParseMap(), ParseObject(), and ParseTileset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ParsePropertiesXML()

void Olympe::Tiled::TiledLevelLoader::ParsePropertiesXML ( void element,
std::map< std::string, TiledProperty > &  properties 
)
private

Definition at line 1142 of file TiledLevelLoader.cpp.

References GetComponentTypeID_Static(), and ParsePropertyXML().

Referenced by ParseLayerXML(), ParseMapXML(), ParseObjectXML(), and ParseTilesetXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ParseProperty()

void Olympe::Tiled::TiledLevelLoader::ParseProperty ( const json j,
TiledProperty prop 
)
private

◆ ParsePropertyXML()

void Olympe::Tiled::TiledLevelLoader::ParsePropertyXML ( void element,
TiledProperty prop 
)
private

Definition at line 1156 of file TiledLevelLoader.cpp.

References Olympe::Tiled::Bool, Olympe::Tiled::Color, Olympe::Tiled::File, Olympe::Tiled::Float, GetComponentTypeID_Static(), Olympe::Tiled::Int, and Olympe::Tiled::String.

Referenced by ParsePropertiesXML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ParseTileData()

bool Olympe::Tiled::TiledLevelLoader::ParseTileData ( const json j,
TiledLayer layer 
)
private

◆ ParseTileDataXML()

bool Olympe::Tiled::TiledLevelLoader::ParseTileDataXML ( void element,
TiledLayer layer 
)
private

◆ ParseTileLayer()

bool Olympe::Tiled::TiledLevelLoader::ParseTileLayer ( const json j,
TiledLayer layer 
)
private

◆ ParseTileLayerXML()

bool Olympe::Tiled::TiledLevelLoader::ParseTileLayerXML ( void element,
TiledLayer layer 
)
private

◆ ParseTileset()

bool Olympe::Tiled::TiledLevelLoader::ParseTileset ( const json j,
TiledTileset tileset,
const std::string &  mapDir 
)
private

◆ ParseTilesetXML()

bool Olympe::Tiled::TiledLevelLoader::ParseTilesetXML ( void element,
TiledTileset tileset,
const std::string &  mapDir 
)
private

◆ ReadFile()

bool Olympe::Tiled::TiledLevelLoader::ReadFile ( const std::string &  filepath,
std::string &  outContent 
)
private

Definition at line 1221 of file TiledLevelLoader.cpp.

References GetComponentTypeID_Static(), and SYSTEM_LOG.

Referenced by LoadFromFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ResolvePath()

std::string Olympe::Tiled::TiledLevelLoader::ResolvePath ( const std::string &  mapDir,
const std::string &  relativePath 
)
private

Definition at line 1195 of file TiledLevelLoader.cpp.

References GetComponentTypeID_Static().

Referenced by LoadFromFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ lastError_

std::string Olympe::Tiled::TiledLevelLoader::lastError_
private

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