galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
galaxy::map::Map Class Referencefinal

An LDTK level. More...

#include <Map.hpp>

+ Collaboration diagram for galaxy::map::Map:

Public Member Functions

 Map ()
 Constructor.
 
 Map (Map &&)
 Move constructor.
 
Mapoperator= (Map &&)
 Move assignment operator.
 
 ~Map ()
 Destructor.
 
void load (const ldtk::Level &level)
 Load a map from an ldtk level.
 
const std::string & name () const
 Get map name.
 

Public Attributes

core::Registry m_registry
 Map entities.
 

Private Member Functions

 Map (const Map &)=delete
 Copy constructor.
 
Mapoperator= (const Map &)=delete
 Copy assignment operator.
 
void parse_intgrid_layer (const ldtk::Layer &layer)
 Parse LDTK int-grid layer.
 
void parse_entitiy_layer (const ldtk::Layer &layer)
 Parse LDTK entity layer.
 
void parse_tile_layer (const ldtk::Layer &layer, const int render_layer)
 Parse LDTK tile layer / auto layer.
 

Private Attributes

std::string m_name
 Map name.
 

Detailed Description

An LDTK level.

Some implementation notes: Only 1 tileset per layer is currently supported.

Definition at line 25 of file Map.hpp.

Constructor & Destructor Documentation

◆ Map() [1/3]

galaxy::map::Map::Map ( )

Constructor.

Definition at line 25 of file Map.cpp.

◆ Map() [2/3]

galaxy::map::Map::Map ( Map && m)

Move constructor.

Definition at line 29 of file Map.cpp.

◆ ~Map()

galaxy::map::Map::~Map ( )

Destructor.

Definition at line 46 of file Map.cpp.

◆ Map() [3/3]

galaxy::map::Map::Map ( const Map & )
privatedelete

Copy constructor.

Member Function Documentation

◆ operator=() [1/2]

Map & galaxy::map::Map::operator= ( Map && m)

Move assignment operator.

Definition at line 35 of file Map.cpp.

◆ load()

void galaxy::map::Map::load ( const ldtk::Level & level)

Load a map from an ldtk level.

Parameters
levelParsed from an LDTK project.

Definition at line 50 of file Map.cpp.

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

◆ name()

const std::string & galaxy::map::Map::name ( ) const
nodiscard

Get map name.

Returns
Const string reference.

Definition at line 150 of file Map.cpp.

+ Here is the caller graph for this function:

◆ operator=() [2/2]

Map & galaxy::map::Map::operator= ( const Map & )
privatedelete

Copy assignment operator.

◆ parse_intgrid_layer()

void galaxy::map::Map::parse_intgrid_layer ( const ldtk::Layer & layer)
private

Parse LDTK int-grid layer.

Parameters
layerLayer being parsed.

Definition at line 81 of file Map.cpp.

+ Here is the caller graph for this function:

◆ parse_entitiy_layer()

void galaxy::map::Map::parse_entitiy_layer ( const ldtk::Layer & layer)
private

Parse LDTK entity layer.

An entity needs a specific tag to be parsed. Tags: COLLISION

Parameters
layerLayer being parsed.

Definition at line 86 of file Map.cpp.

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

◆ parse_tile_layer()

void galaxy::map::Map::parse_tile_layer ( const ldtk::Layer & layer,
const int render_layer )
private

Parse LDTK tile layer / auto layer.

Parameters
layerLayer being parsed.

Definition at line 110 of file Map.cpp.

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

Member Data Documentation

◆ m_registry

core::Registry galaxy::map::Map::m_registry

Map entities.

Definition at line 103 of file Map.hpp.

◆ m_name

std::string galaxy::map::Map::m_name
private

Map name.

Definition at line 109 of file Map.hpp.


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