Emergency 20 Dokumentation  4.2.0
em5::OrderInfoManager Class Reference

#include <OrderInfoManager.h>

Inheritance diagram for em5::OrderInfoManager:
qsf::ElementManager< uint32, OrderInfo > qsf::Manager

Public Member Functions

 OrderInfoManager ()
 Default constructor. More...
 
virtual ~OrderInfoManager ()
 Destructor. More...
 
void loadAssets ()
 Load the assets. More...
 
bool loadByFilename (const std::string &filename)
 Load order information JSON file. More...
 
bool saveByFilename (const std::string &filename)
 Save order information JSON file. More...
 
const OrderInfogetOrderInfoById (const qsf::StringHash &id) const
 Find order information by ID. More...
 
OrderInfogetOrderInfoByIdForWriting (const qsf::StringHash &id)
 Access order information by ID. More...
 
const OrderInfogetOrderInfoByPrefab (const qsf::AssetProxy &assetProxy) const
 Find order information by prefab. More...
 
- Public Member Functions inherited from qsf::ElementManager< uint32, OrderInfo >
 ElementManager ()
 Default constructor. More...
 
virtual ~ElementManager ()
 Destructor. More...
 
const ElementMapgetElements () const
 Return map of elements. More...
 
OrderInfo * 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...
 
OrderInfo * createElement ()
 Create a new element. More...
 
OrderInfo * createElementById (const uint32 &key)
 Create a new element with an enforced given unique element identifier. More...
 
bool insertElement (const uint32 &key, OrderInfo &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, OrderInfo, detail::DirectAllocator< OrderInfo >, ConsecutiveIdGenerator< uint32 > >::ElementMap::iterator destroyElement (typename ElementMap::iterator iterator)
 Destroy an element by iterator. More...
 
void destroyAllElements ()
 Destroy all elements. More...
 
OrderInfo * 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, OrderInfo >
typedef boost::container::flat_map< uint32, OrderInfo * > ElementMap
 
- Protected Member Functions inherited from qsf::ElementManager< uint32, OrderInfo >
ElementMapgetElementsWritable ()
 Return map of elements. More...
 
virtual void onElementInsertion (const uint32 &key, OrderInfo &element)
 Called whenever an element is inserted into the element map. More...
 
virtual void onElementRemoval (const uint32 &key, OrderInfo &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::OrderInfoManager::OrderInfoManager ( )

Default constructor.

virtual em5::OrderInfoManager::~OrderInfoManager ( )
virtual

Destructor.

Member Function Documentation

const OrderInfo* em5::OrderInfoManager::getOrderInfoById ( const qsf::StringHash id) const

Find order information by ID.

Parameters
[in]idUnit type ID to searching for (for example qsf::StringHash("ambulance"))
Returns
Returns the found order information, can be a null pointer, do not destroy the returned instance
OrderInfo* em5::OrderInfoManager::getOrderInfoByIdForWriting ( const qsf::StringHash id)

Access order information by ID.

Parameters
[in]idUnit type ID to searching for (for example qsf::StringHash("ambulance"))
Returns
Returns the found order information, can be a null pointer, do not destroy the returned instance
const OrderInfo* em5::OrderInfoManager::getOrderInfoByPrefab ( const qsf::AssetProxy assetProxy) const

Find order information by prefab.

Parameters
[in]assetProxyPrefab asset to searching for
Returns
Returns the found order information, can be a null pointer, do not destroy the returned instance
void em5::OrderInfoManager::loadAssets ( )

Load the assets.

bool em5::OrderInfoManager::loadByFilename ( const std::string &  filename)

Load order information JSON file.

Parameters
[in]filenamePath of the file to load
bool em5::OrderInfoManager::saveByFilename ( const std::string &  filename)

Save order information JSON file.

Parameters
[in]filenamePath of the file to save

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