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::World Class Referencefinal

An LDTK level. More...

#include <World.hpp>

+ Collaboration diagram for galaxy::map::World:

Public Member Functions

 World ()
 Constructor.
 
 World (const std::string &file)
 Argument Constructor.
 
 ~World ()
 Destructor.
 
bool load (const std::string &file)
 Load a world.
 
void parse ()
 Parse world and create entities.
 
void clear ()
 Clear all map and world data.
 
void set_active (const std::string &map)
 Set currently active map.
 
map::Mapget_active () const
 Get currently active map.
 
const std::string & name () const
 Get world name.
 
const std::string & file () const
 Get file.
 
bool loaded () const
 Check if load() was called.
 
ankerl::unordered_dense::map< std::string, map::Map > & maps ()
 Get maps.
 

Private Attributes

std::string m_file
 File.
 
ldtk::Project m_project
 LDTK project data.
 
ankerl::unordered_dense::map< std::string, map::Mapm_maps
 List of ldtk levels.
 
map::Mapm_current
 Current map.
 
bool m_loaded
 Loaded flag.
 

Detailed Description

An LDTK level.

Definition at line 23 of file World.hpp.

Constructor & Destructor Documentation

◆ World() [1/2]

galaxy::map::World::World ( )

Constructor.

Definition at line 17 of file World.cpp.

◆ World() [2/2]

galaxy::map::World::World ( const std::string & file)

Argument Constructor.

Parameters
fileFile in VFS to load.

Definition at line 23 of file World.cpp.

+ Here is the call graph for this function:

◆ ~World()

galaxy::map::World::~World ( )

Destructor.

Definition at line 33 of file World.cpp.

Member Function Documentation

◆ load()

bool galaxy::map::World::load ( const std::string & file)
nodiscard

Load a world.

Parameters
fileWorld in VFS.

Definition at line 37 of file World.cpp.

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

◆ parse()

void galaxy::map::World::parse ( )

Parse world and create entities.

Definition at line 63 of file World.cpp.

+ Here is the caller graph for this function:

◆ clear()

void galaxy::map::World::clear ( )

Clear all map and world data.

Definition at line 77 of file World.cpp.

+ Here is the caller graph for this function:

◆ set_active()

void galaxy::map::World::set_active ( const std::string & map)

Set currently active map.

Parameters
mapMap ID.

Definition at line 85 of file World.cpp.

+ Here is the caller graph for this function:

◆ get_active()

map::Map * galaxy::map::World::get_active ( ) const
nodiscard

Get currently active map.

Returns
Pointer to active map.

Definition at line 97 of file World.cpp.

+ Here is the caller graph for this function:

◆ name()

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

Get world name.

Returns
Const string reference.

Definition at line 102 of file World.cpp.

+ Here is the caller graph for this function:

◆ file()

const std::string & galaxy::map::World::file ( ) const
nodiscard

Get file.

Returns
Const string reference.

Definition at line 107 of file World.cpp.

+ Here is the caller graph for this function:

◆ loaded()

bool galaxy::map::World::loaded ( ) const
nodiscard

Check if load() was called.

Returns
True if loaded.

Definition at line 112 of file World.cpp.

+ Here is the caller graph for this function:

◆ maps()

ankerl::unordered_dense::map< std::string, map::Map > & galaxy::map::World::maps ( )
nodiscard

Get maps.

Returns
Map of maps.

Definition at line 117 of file World.cpp.

Member Data Documentation

◆ m_file

std::string galaxy::map::World::m_file
private

File.

Definition at line 112 of file World.hpp.

◆ m_project

ldtk::Project galaxy::map::World::m_project
private

LDTK project data.

Definition at line 117 of file World.hpp.

◆ m_maps

ankerl::unordered_dense::map<std::string, map::Map> galaxy::map::World::m_maps
private

List of ldtk levels.

Definition at line 122 of file World.hpp.

◆ m_current

map::Map* galaxy::map::World::m_current
private

Current map.

Definition at line 127 of file World.hpp.

◆ m_loaded

bool galaxy::map::World::m_loaded
private

Loaded flag.

Definition at line 132 of file World.hpp.


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