Emergency 20 Dokumentation  4.2.0
em5::UnitPoolManager Class Reference

#include <UnitPoolManager.h>

Inheritance diagram for em5::UnitPoolManager:
qsf::ElementManager< uint32, UnitPoolDefinition > qsf::Manager

Public Member Functions

 UnitPoolManager ()
 Default constructor. More...
 
virtual ~UnitPoolManager ()
 Destructor. More...
 
void loadAssets ()
 Load definitions from assets. More...
 
const UnitPoolDefinitiongetUnitPoolDefinitionById (const qsf::StringHash &id) const
 Find unit pool definition by its ID. More...
 
- Public Member Functions inherited from qsf::ElementManager< uint32, UnitPoolDefinition >
 ElementManager ()
 Default constructor. More...
 
virtual ~ElementManager ()
 Destructor. More...
 
const ElementMapgetElements () const
 Return map of elements. More...
 
UnitPoolDefinition * findElement (const uint32 &key) const
 Find a specific element by its key in either the element map. More...
 
void reserveElements (size_t numberOfElements)
 Reserve elements. More...
 
UnitPoolDefinition * createElement ()
 Create a new element. More...
 
UnitPoolDefinition * createElementById (const uint32 &key)
 Create a new element with an enforced given unique element identifier. More...
 
bool insertElement (const uint32 &key, UnitPoolDefinition &element)
 Insert an element with an enforced given unique element identifier. More...
 
bool destroyElement (const uint32 &key)
 Destroy an element by its key. More...
 
ElementManager< uint32, UnitPoolDefinition, detail::DirectAllocator< UnitPoolDefinition >, ConsecutiveIdGenerator< uint32 > >::ElementMap::iterator destroyElement (typename ElementMap::iterator iterator)
 Destroy an element by iterator. More...
 
void destroyAllElements ()
 Destroy all elements. More...
 
UnitPoolDefinition * grabElement (const uint32 &key)
 Remove an element from the element manager without destroying it. More...
 
uint32 generateId ()
 Generate a new, unused key. More...
 

Additional Inherited Members

- Public Types inherited from qsf::ElementManager< uint32, UnitPoolDefinition >
typedef boost::container::flat_map< uint32, UnitPoolDefinition * > ElementMap
 
- Protected Member Functions inherited from qsf::ElementManager< uint32, UnitPoolDefinition >
ElementMapgetElementsWritable ()
 Return map of elements. More...
 
virtual void onElementInsertion (const uint32 &key, UnitPoolDefinition &element)
 Called whenever an element is inserted into the element map. More...
 
virtual void onElementRemoval (const uint32 &key, UnitPoolDefinition &element)
 Called whenever an element is actually going to be destroyed. More...
 
- Protected Member Functions inherited from qsf::Manager
 Manager ()
 Default constructor. More...
 
virtual ~Manager ()
 Destructor. More...
 

Constructor & Destructor Documentation

em5::UnitPoolManager::UnitPoolManager ( )

Default constructor.

virtual em5::UnitPoolManager::~UnitPoolManager ( )
virtual

Destructor.

Member Function Documentation

const UnitPoolDefinition* em5::UnitPoolManager::getUnitPoolDefinitionById ( const qsf::StringHash id) const

Find unit pool definition by its ID.

Parameters
[in]idID to search for
Returns
The unit pool definition if there is one with the given ID, a null pointer otherwise; do not destroy the instance
void em5::UnitPoolManager::loadAssets ( )

Load definitions from assets.


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