Emergency 20 Dokumentation  4.2.0
em5::multiplayer::MapCache Class Reference

EMERGENCY 5 multiplayer map cache. More...

#include <MapCache.h>

Inheritance diagram for em5::multiplayer::MapCache:

Public Member Functions

 MapCache ()
 Constructor. More...
 
virtual ~MapCache ()
 Destructor. More...
 
bool isInitialized ()
 
void setMap (qsf::Map &map)
 Sets the map for which the cache should be used. This causes also the initialization of the cache. More...
 
void addEntity (qsf::Entity &entity)
 Adds an entity to the map cache. More...
 
void addEntities (const std::unordered_set< uint64 > &entityIdList)
 Adds a list of entities to the map cache. More...
 
void removeEntity (const uint64 entityId)
 Removes an entity from the map cache. More...
 
void removeEntities (const std::unordered_set< uint64 > &entityIdList)
 Removes a list of entities from the map cache. More...
 
void updateCache (qsf::game::BitStream &bitStream, const qsf::Clock &clock)
 Updates the cache with the data from the map. Any changed data will be written to the bitStream. More...
 
void applyChanges (uint64 dataSize, const qsf::game::BitStream &bitStream)
 Reads the data from the bitStream and applies any changes to the cache items. More...
 
bool interpolate (const qsf::Clock &clock)
 Do any interpolation needed for applying the data from the cache to the entities on the map. More...
 
void logStatistics ()
 

Detailed Description

EMERGENCY 5 multiplayer map cache.

Constructor & Destructor Documentation

em5::multiplayer::MapCache::MapCache ( )

Constructor.

virtual em5::multiplayer::MapCache::~MapCache ( )
virtual

Destructor.

Member Function Documentation

void em5::multiplayer::MapCache::addEntities ( const std::unordered_set< uint64 > &  entityIdList)

Adds a list of entities to the map cache.

void em5::multiplayer::MapCache::addEntity ( qsf::Entity entity)

Adds an entity to the map cache.

void em5::multiplayer::MapCache::applyChanges ( uint64  dataSize,
const qsf::game::BitStream bitStream 
)

Reads the data from the bitStream and applies any changes to the cache items.

Parameters
[in]bitStreamThe stream from which the data will be read
Note
This method gets only called on the client side
bool em5::multiplayer::MapCache::interpolate ( const qsf::Clock clock)

Do any interpolation needed for applying the data from the cache to the entities on the map.

Returns
"True", when interpolation still possible otherwise false
Note
This method gets only called on the client side
bool em5::multiplayer::MapCache::isInitialized ( )
inline
void em5::multiplayer::MapCache::logStatistics ( )
void em5::multiplayer::MapCache::removeEntities ( const std::unordered_set< uint64 > &  entityIdList)

Removes a list of entities from the map cache.

void em5::multiplayer::MapCache::removeEntity ( const uint64  entityId)

Removes an entity from the map cache.

void em5::multiplayer::MapCache::setMap ( qsf::Map map)

Sets the map for which the cache should be used. This causes also the initialization of the cache.

void em5::multiplayer::MapCache::updateCache ( qsf::game::BitStream bitStream,
const qsf::Clock clock 
)

Updates the cache with the data from the map. Any changed data will be written to the bitStream.

Parameters
[in]bitStreamThe stream to which any changed data will be written to (This stream will contain the data for the "data update" message)
Note
This method gets only called on the host side

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