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

Private Member Functions

void PlayerStats (Man player)
 
void Init (Man player)
 
PlayerStatsPCO_Base GetPCO (int version=-1)
 
void ~PlayerStats ()
 
PlayerStatBase GetStatObject (int id)
 
void SetAllowLogs (bool enable)
 
bool GetAllowLogs ()
 
void GetDebugInfo (array< ref StatDebugObject > objects, int flags)
 
void GatherAllRecords ()
 
void SaveStats (ParamsWriteContext ctx)
 
bool LoadStats (ParamsReadContext ctx, int version)
 
void ResetAllStats ()
 

Private Attributes

ref array< ref PlayerStatBasem_PlayerStats
 
ref array< ref StatDebugObjectm_PlayerStatsDebug
 
ref PCOHandlerStats m_PCOhandler = new PCOHandlerStats()
 
ref Timer m_SyncTimer
 
Man m_Player
 
bool m_AllowLogs
 
string m_System = "Stats"
 

Detailed Description

Definition at line 6 of file PlayerStats.c.

Constructor & Destructor Documentation

◆ PlayerStats()

void PlayerStats::PlayerStats ( Man player)
inlineprivate

Definition at line 21 of file PlayerStats.c.

22 {
23 Init(player);
24 }
override Widget Init()
Definition DayZGame.c:120

References Init().

◆ ~PlayerStats()

void PlayerStats::~PlayerStats ( )
inlineprivate

Definition at line 36 of file PlayerStats.c.

37 {
38 //if( GetGame() && GetGame().IsDebugActions() ) GatherAllRecords();
39 }

Member Function Documentation

◆ GatherAllRecords()

void PlayerStats::GatherAllRecords ( )
inlineprivate

Definition at line 77 of file PlayerStats.c.

78 {
79 /*
80 FileHandle file = OpenFile("$profile:StatRecords.log", FileMode.WRITE);
81
82 FPrintln(file, "================================================================");
83 FPrintln(file," ================== " + m_Player.ToString() +" ================== ");
84 FPrintln(file, "================================================================");
85
86 for(int i = 0; i < m_PlayerStats.Count(); i++)
87 {
88 array<PlayerStatRecord> records = m_PlayerStats.Get(i).GetRecords();
89
90 FPrintln(file, m_PlayerStats.Get(i).GetLabel() );
91
92 for(int z = 0; z < records.Count(); z++)
93 {
94 PlayerStatRecord record = records.Get(z);
95 string output = record.GetStringOutput();
96 FPrintln(file, output);
97 }
98 }
99 */
100 }

◆ GetAllowLogs()

bool PlayerStats::GetAllowLogs ( )
inlineprivate

Definition at line 62 of file PlayerStats.c.

63 {
64 return m_AllowLogs;
65 }
bool m_AllowLogs
Definition PlayerStats.c:16

References m_AllowLogs.

◆ GetDebugInfo()

void PlayerStats::GetDebugInfo ( array< ref StatDebugObject > objects,
int flags )
inlineprivate

Definition at line 67 of file PlayerStats.c.

68 {
69 /*
70 for(int i = 0; i < m_PlayerStats.Count(); i++)
71 {
72 m_PlayerStats.Get(i).SerializeValue(objects, flags);
73 }
74 */
75 }

◆ GetPCO()

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

Definition at line 31 of file PlayerStats.c.

32 {
33 return m_PCOhandler.GetPCO(version);
34 }
ref PCOHandlerStats m_PCOhandler
Definition PlayerStats.c:12

References m_PCOhandler.

Referenced by GetStatObject(), LoadStats(), ResetAllStats(), and SaveStats().

◆ GetStatObject()

PlayerStatBase PlayerStats::GetStatObject ( int id)
inlineprivate

Definition at line 42 of file PlayerStats.c.

43 {
45 if (pco)
46 return pco.GetStatObject(id);
47 else
48 return null;
49 }
PlayerStatsPCO_Base GetPCO(int version=-1)
Definition PlayerStats.c:31

References GetPCO().

◆ Init()

void PlayerStats::Init ( Man player)
inlineprivate

Definition at line 26 of file PlayerStats.c.

27 {
29 }

References m_Player.

◆ LoadStats()

bool PlayerStats::LoadStats ( ParamsReadContext ctx,
int version )
inlineprivate

Definition at line 116 of file PlayerStats.c.

117 {
118 PlayerStatsPCO_Base pco = GetPCO(version);
119 if (pco && pco.OnStoreLoad(ctx))
120 {
121 //Print("********* LoadStats loading version: " + pco.GetVersion());
122 return true;
123 }
124 else
125 return false;
126
127 }

References GetPCO().

◆ ResetAllStats()

void PlayerStats::ResetAllStats ( )
inlineprivate

Definition at line 129 of file PlayerStats.c.

130 {
131 GetPCO().ResetAllStats();
132 }

References GetPCO().

◆ SaveStats()

void PlayerStats::SaveStats ( ParamsWriteContext ctx)
inlineprivate

Definition at line 102 of file PlayerStats.c.

103 {
104 int current_version = GetGame().SaveVersion();
106
107 if (pco)
108 {
109 pco.OnStoreSave(ctx);
110 //Print("Saving stats in version: "+ pco.GetVersion());
111 }
112 else
113 return;
114 }
proto native CGame GetGame()

References GetGame(), and GetPCO().

◆ SetAllowLogs()

void PlayerStats::SetAllowLogs ( bool enable)
inlineprivate

Definition at line 57 of file PlayerStats.c.

58 {
60 }

References m_AllowLogs.

Member Data Documentation

◆ m_AllowLogs

bool PlayerStats::m_AllowLogs
private

Definition at line 16 of file PlayerStats.c.

Referenced by GetAllowLogs(), and SetAllowLogs().

◆ m_PCOhandler

ref PCOHandlerStats PlayerStats::m_PCOhandler = new PCOHandlerStats()
private

Definition at line 12 of file PlayerStats.c.

Referenced by GetPCO().

◆ m_Player

Man PlayerStats::m_Player
private

Definition at line 15 of file PlayerStats.c.

Referenced by Init().

◆ m_PlayerStats

ref array<ref PlayerStatBase> PlayerStats::m_PlayerStats
private

Definition at line 8 of file PlayerStats.c.

◆ m_PlayerStatsDebug

ref array<ref StatDebugObject> PlayerStats::m_PlayerStatsDebug
private

Definition at line 9 of file PlayerStats.c.

◆ m_SyncTimer

ref Timer PlayerStats::m_SyncTimer
private

Definition at line 14 of file PlayerStats.c.

◆ m_System

string PlayerStats::m_System = "Stats"
private

Definition at line 17 of file PlayerStats.c.


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