Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef DOD_PLAYERSTATS_H
  8. #define DOD_PLAYERSTATS_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "steam/steam_api.h"
  13. #include "GameEventListener.h"
  14. #include "dod_shareddefs.h"
  15. #include "weapon_dodbase.h"
  16. typedef struct
  17. {
  18. dod_stat_accumulator_t stats;
  19. int iWeaponID;
  20. } weapon_stat_t;
  21. class CDODPlayerStats : public CAutoGameSystem, public CGameEventListener
  22. {
  23. public:
  24. CDODPlayerStats();
  25. virtual void PostInit();
  26. virtual void LevelShutdownPreEntity();
  27. void UploadStats();
  28. void UpdateStats( int iPlayerClass, int iTeam, dod_stat_accumulator_t *playerStats, CUtlVector<weapon_stat_t> *vecWeaponStats );
  29. void MsgFunc_DODPlayerStatsUpdate( bf_read &msg );
  30. private:
  31. void FireGameEvent( IGameEvent *event );
  32. void SetNextForceUploadTime();
  33. float m_flTimeNextForceUpload;
  34. // 6 x dod_stat_accumulator_t
  35. dod_stat_accumulator_t m_PlayerStats[2][NUM_DOD_PLAYERCLASSES];
  36. // num_weapons x dod_stat_accumulator_t
  37. dod_stat_accumulator_t m_WeaponStats[WEAPON_MAX];
  38. };
  39. extern CDODPlayerStats g_DODPlayerStats;
  40. #endif //DOD_PLAYERSTATS_H