My Project
Public Member Functions | List of all members
ParaEngine::ICharacterTrackerContainer Class Reference

it is a class for holding various character trackers by their name. More...

#include <GameNetCommon.h>

Inheritance diagram for ParaEngine::ICharacterTrackerContainer:
ParaEngine::CEnvSimClient ParaEngine::COPCBiped

Public Member Functions

void ResetCharTrackers ()
 reset all character trackers. More...
 
CCharacterTrackerGetCharTracker (const char *sName=NULL)
 Get the tracker for a character. More...
 
CCharacterTrackerCreateCharTracker (const char *sName=NULL)
 create a new character tracker with the given name. More...
 
bool RemoveCharTracker (const char *sName)
 remove a given character tacker by name More...
 
int RemoveCharTracker (int nBeforePerceivedTime)
 remove any tracker whose perceived time is smaller than or equal to nBeforePerceivedTime. More...
 
int GetLastTrackerGCTime ()
 get last character tracker garbage collection time. More...
 
void SetLastTrackerGCTime (int nLag)
 set last character tracker garbage collection time. More...
 
int GetTimeLag ()
 get the time since last network synchronization. More...
 
void SetTimeLag (int nLag)
 set the time since last network synchronization. More...
 

Detailed Description

it is a class for holding various character trackers by their name.

some network object, such as the COPCObject and EnvSimClient may derive from it.

Member Function Documentation

§ CreateCharTracker()

CCharacterTracker * ICharacterTrackerContainer::CreateCharTracker ( const char *  sName = NULL)

create a new character tracker with the given name.

If the tracker already exists, it will be emptied.

Parameters
sNameif this is NULL, it means this character. Otherwise, it is a character in its perception.
Returns
the tracker created is returned.

§ GetCharTracker()

CCharacterTracker * ICharacterTrackerContainer::GetCharTracker ( const char *  sName = NULL)

Get the tracker for a character.

Parameters
sNameif this is NULL, it means this character. Otherwise, it is a character in its perception.
Returns
if NULL, the tracker is not found and one should call CreateCharTracker() to create it.

§ GetLastTrackerGCTime()

int ParaEngine::ICharacterTrackerContainer::GetLastTrackerGCTime ( )
inline

get last character tracker garbage collection time.

§ GetTimeLag()

int ParaEngine::ICharacterTrackerContainer::GetTimeLag ( )
inline

get the time since last network synchronization.

§ RemoveCharTracker() [1/2]

bool ParaEngine::ICharacterTrackerContainer::RemoveCharTracker ( const char *  sName)

remove a given character tacker by name

Parameters
sNamename of the tacker.
Returns
true if removed.

§ RemoveCharTracker() [2/2]

int ICharacterTrackerContainer::RemoveCharTracker ( int  nBeforePerceivedTime)

remove any tracker whose perceived time is smaller than or equal to nBeforePerceivedTime.

this function may be called periodically at low frame rate to release memory. note: it will not remove newly created trackers, which has time 0.

Parameters
nBeforePerceivedTimethis should be above 1 to prevent newly created trackers to be removed.
Returns
the number of tackers removed are returned

§ ResetCharTrackers()

void ICharacterTrackerContainer::ResetCharTrackers ( )

reset all character trackers.

§ SetLastTrackerGCTime()

void ParaEngine::ICharacterTrackerContainer::SetLastTrackerGCTime ( int  nLag)
inline

set last character tracker garbage collection time.

§ SetTimeLag()

void ParaEngine::ICharacterTrackerContainer::SetTimeLag ( int  nLag)
inline

set the time since last network synchronization.


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