| enum EPSstatsFlags |
| { |
| EMPTY, |
| }; |
|
|
| class PlayerStats |
| { |
| ref array<ref PlayerStatBase> m_PlayerStats; |
| ref array<ref StatDebugObject> m_PlayerStatsDebug; |
| |
| |
| ref PCOHandlerStats m_PCOhandler = new PCOHandlerStats(); |
| |
| ref Timer m_SyncTimer; |
| Man m_Player; |
| bool m_AllowLogs; |
| string m_System = "Stats"; |
| |
| |
| |
| void PlayerStats(Man player) |
| { |
| Init(player); |
| } |
|
|
| void Init(Man player) |
| { |
| m_Player = player; |
| } |
|
|
| PlayerStatsPCO_Base GetPCO(int version = -1 ) |
| { |
| return m_PCOhandler.GetPCO(version); |
| } |
| |
| void ~PlayerStats() |
| { |
| |
| } |
| |
| |
| PlayerStatBase GetStatObject(int id) |
| { |
| PlayerStatsPCO_Base pco = GetPCO(); |
| if ( pco ) |
| { |
| return pco.GetStatObject(id); |
| } |
| else |
| { |
| return null; |
| } |
| } |
| |
| |
| |
| |
| |
| |
| |
| void SetAllowLogs(bool enable) |
| { |
| m_AllowLogs = enable; |
| } |
|
|
| bool GetAllowLogs() |
| { |
| return m_AllowLogs; |
| } |
| |
| void GetDebugInfo( array<ref StatDebugObject> objects, int flags ) |
| { |
| |
| |
| |
| |
| |
| |
| } |
| |
| void GatherAllRecords() |
| { |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| } |
| |
| void SaveStats( ParamsWriteContext ctx ) |
| { |
| int current_version = GetGame().SaveVersion(); |
| PlayerStatsPCO_Base pco = GetPCO(current_version); |
| |
| if ( pco ) |
| { |
| pco.OnStoreSave(ctx); |
| |
| } |
| else |
| { |
| return; |
| } |
| } |
|
|
| bool LoadStats( ParamsReadContext ctx, int version ) |
| { |
| PlayerStatsPCO_Base pco = GetPCO(version); |
| if (pco && pco.OnStoreLoad(ctx)) |
| { |
| |
| return true; |
| } |
| else |
| { |
| return false; |
| } |
| |
| } |
|
|
| void ResetAllStats() |
| { |
| GetPCO().ResetAllStats(); |
| } |
| } |