Middle Europe Productions Library  alpha 1.3.3
Public Member Functions | List of all members
MEP::Resources Class Reference

A main MEP::Drawable cointainer. More...

#include <ResourceManager.h>

Inheritance diagram for MEP::Resources:
MEPtools::GroupManager< MEP::Object > MEPtools::GroupManager< MEP::Font > MEP::Template::Application

Public Member Functions

 Resources (const std::string &path)
 
template<typename ... Values>
void initResources (Values &&... values)
 
bool isLoaded () const
 
ObjectgetObject (const U_int32 ID, const U_int32 group=-1)
 
sf::Font & getFont (const U_int32 ID, const U_int32 group=-1)
 
template<typename T >
T & get (const U_int32 ID, const U_int32 group=-1)
 
void deleteObject (const U_int32 ID, const U_int32 group=-1)
 
void deleteObjectsGroup (const U_int32 group)
 
void deleteFont (const U_int32 ID, const U_int32 group=-1)
 
void deleteFontGroup (const U_int32 group)
 
virtual ~Resources ()
 

Detailed Description

A main MEP::Drawable cointainer.

Resources class is a utility which is meant to be working with all of the MEP::Drawable objects.

Constructor & Destructor Documentation

◆ Resources()

MEP::Resources::Resources ( const std::string &  path)
inline

Constructor of the resources.

Parameters
[in]path: Path of the resource folder.

◆ ~Resources()

virtual MEP::Resources::~Resources ( )
inlinevirtual

Deletes all MEP::Object.

Parameters
[in]name: Name of a MEP::Object.

Member Function Documentation

◆ deleteFont()

void MEP::Resources::deleteFont ( const U_int32  ID,
const U_int32  group = -1 
)
inline

Deletes sf::Font with agiven name.

Parameters
[in]name: ID of a sf::Font
[in]group: Group of a sf::Font.

◆ deleteFontGroup()

void MEP::Resources::deleteFontGroup ( const U_int32  group)
inline

Deletes sf::Font(s) within a given group.

Parameters
[in]group: Group of a sf::Font.

◆ deleteObject()

void MEP::Resources::deleteObject ( const U_int32  ID,
const U_int32  group = -1 
)
inline

Deletes MEP::Object with a given name.

Parameters
[in]name: ID of a MEP::Object
[in]group: Group of a MEP::Object.

◆ deleteObjectsGroup()

void MEP::Resources::deleteObjectsGroup ( const U_int32  group)
inline

Deletes MEP::Object(s) within a given group.

Parameters
[in]group: Group of a MEP::Object.

◆ get()

template<typename T >
T & MEP::Resources::get ( const U_int32  ID,
const U_int32  group = -1 
)
inline

Outputs the Type. if MEP::Objects outputs object. if sf::Font outputs font.

Parameters
[in]ID: ID of a MEP::Object.
[in]group: Group of a MEP::Object.

◆ getFont()

sf::Font & MEP::Resources::getFont ( const U_int32  ID,
const U_int32  group = -1 
)
inline

Outputs the font.

Parameters
[in]ID: ID of a MEP::Object.
[in]group: Group of a MEP::Object.

◆ getObject()

Object & MEP::Resources::getObject ( const U_int32  ID,
const U_int32  group = -1 
)
inline

Outputs created MEP::Object

Parameters
[in]ID: ID of a MEP::Object.
[in]group: Group of a MEP::Object.
Returns
Reference to MEP::Object.

◆ initResources()

template<typename ... Values>
void MEP::Resources::initResources ( Values &&...  values)
inline

Initialization of the resources.

Parameters
[in]values: Inputs ... number of MEP::Resources::Resource.

◆ isLoaded()

bool MEP::Resources::isLoaded ( ) const
inline

Outputs the status of the resources.