Rehti MMORPG  1.0.0
Rehti MMORPG is a free and open source MMORPG game.
AssetManager Class Reference

Holds definitions to all the items, objects and skills in the game. This class is used to fetch the definitions and create instances of the items, objects and skills. More...

#include <AssetManager.hpp>

Collaboration diagram for AssetManager:
Collaboration graph

Static Public Member Functions

static void loadAssets ()
 Loads all the assets into memory. More...
 
static const std::vector< ObjectLocation > & getObjectLocations ()
 Get the Object Locations object. More...
 
static const std::map< int, GameSkill > & getSkills ()
 Get the Skills object. More...
 
static const GameObjectsgetObjects ()
 Get the GameObjects object. More...
 
static const GameItemsgetItems ()
 Get the GameItems object. More...
 
static const GameCharactersgetGameCharacters ()
 Get the GameCharacters object. More...
 
static std::shared_ptr< ItemcreateItemInstance (int id)
 Creates an instance of an item. More...
 

Static Private Attributes

static GameItems itemsM = {}
 
static std::map< int, GameSkillskillsM = {}
 
static GameObjects objectsM = {}
 Tells what possible objects exists and what attributes they have (For example tree) More...
 
static std::vector< ObjectLocationobjectLocationsM = {}
 Tells where objects instances are located on the map (For example, tree at 1,1, tree at 2,2, tree at 4,5 etc) More...
 
static GameCharacters gameCharactersM = {}
 

Detailed Description

Holds definitions to all the items, objects and skills in the game. This class is used to fetch the definitions and create instances of the items, objects and skills.

Member Function Documentation

◆ createItemInstance()

std::shared_ptr< Item > AssetManager::createItemInstance ( int  id)
static

Creates an instance of an item.

Parameters
idItem id
Returns
std::shared_ptr<Item>, nullptr if item id is not found.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getGameCharacters()

const GameCharacters & AssetManager::getGameCharacters ( )
static

Get the GameCharacters object.

Returns
GameCharacters
Here is the caller graph for this function:

◆ getItems()

const GameItems & AssetManager::getItems ( )
static

Get the GameItems object.

Returns
GameItems
Here is the caller graph for this function:

◆ getObjectLocations()

const std::vector< ObjectLocation > & AssetManager::getObjectLocations ( )
static

Get the Object Locations object.

Returns
std::vector<ObjectLocation>
Here is the caller graph for this function:

◆ getObjects()

const GameObjects & AssetManager::getObjects ( )
static

Get the GameObjects object.

Returns
GameObjects
Here is the caller graph for this function:

◆ getSkills()

const std::map< int, GameSkill > & AssetManager::getSkills ( )
static

Get the Skills object.

Returns
std::map<int, GameSkill>
Here is the caller graph for this function:

◆ loadAssets()

void AssetManager::loadAssets ( )
static

Loads all the assets into memory.

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

Member Data Documentation

◆ gameCharactersM

GameCharacters AssetManager::gameCharactersM = {}
inlinestaticprivate

◆ itemsM

GameItems AssetManager::itemsM = {}
inlinestaticprivate

◆ objectLocationsM

std::vector<ObjectLocation> AssetManager::objectLocationsM = {}
inlinestaticprivate

Tells where objects instances are located on the map (For example, tree at 1,1, tree at 2,2, tree at 4,5 etc)

◆ objectsM

GameObjects AssetManager::objectsM = {}
inlinestaticprivate

Tells what possible objects exists and what attributes they have (For example tree)

◆ skillsM

std::map<int, GameSkill> AssetManager::skillsM = {}
inlinestaticprivate

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