DayZ 1.24
Loading...
Searching...
No Matches
PCOHandlerStats Class Reference
Collaboration diagram for PCOHandlerStats:
[legend]

Private Member Functions

void PCOHandlerStats ()
 
void RegisterPCO (PlayerStatsPCO_Base pco)
 
PlayerStatsPCO_Base GetPCO (int version=-1)
 

Private Attributes

ref map< int, ref PlayerStatsPCO_Basem_PCOs = new map<int, ref PlayerStatsPCO_Base>
 
int m_HighestVersion
 

Detailed Description

Definition at line 3 of file PlayerStatsPCO.c.

Constructor & Destructor Documentation

◆ PCOHandlerStats()

void PCOHandlerStats::PCOHandlerStats ( )
inlineprivate

Definition at line 8 of file PlayerStatsPCO.c.

9 {
10 RegisterPCO(new PlayerStatsPCO_v100);
13 }
void RegisterPCO(PlayerStatsPCO_Base pco)

References RegisterPCO().

Member Function Documentation

◆ GetPCO()

PlayerStatsPCO_Base PCOHandlerStats::GetPCO ( int version = -1)
inlineprivate

Definition at line 25 of file PlayerStatsPCO.c.

26 {
27 //PlayerStatsPCO_Base pco;
28
29 if (version == -1) //no version set - fetch the highest version
30 return m_PCOs.Get(m_HighestVersion);
31 else if (!m_PCOs.Contains(version))//version set - version not present, fetch the closest lower version
32 {
33 for (int i = version; i > 100; i--)
34 {
35 if (m_PCOs.Contains(i))
36 {
37 //Print("fetching PCO version:"+ i);
38 return m_PCOs.Get(i);
39 }
40 }
41 return null;
42 }
43 else//version set - version present, fetch it
44 {
45 //Print("fetching PCO version:"+ version);
46 return m_PCOs.Get(version);
47 }
48 }
ref map< int, ref PlayerStatsPCO_Base > m_PCOs

References m_HighestVersion, and m_PCOs.

◆ RegisterPCO()

void PCOHandlerStats::RegisterPCO ( PlayerStatsPCO_Base pco)
inlineprivate

Definition at line 15 of file PlayerStatsPCO.c.

16 {
17 int version = pco.GetVersion();
18
19 if (version > m_HighestVersion)
20 m_HighestVersion = version;
21
22 m_PCOs.Insert(version, pco);
23 }

References m_HighestVersion, and m_PCOs.

Referenced by PCOHandlerStats().

Member Data Documentation

◆ m_HighestVersion

int PCOHandlerStats::m_HighestVersion
private

Definition at line 6 of file PlayerStatsPCO.c.

Referenced by GetPCO(), and RegisterPCO().

◆ m_PCOs

ref map<int, ref PlayerStatsPCO_Base> PCOHandlerStats::m_PCOs = new map<int, ref PlayerStatsPCO_Base>
private

Definition at line 5 of file PlayerStatsPCO.c.

Referenced by GetPCO(), and RegisterPCO().


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