diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/server/tf2/tf_stats.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/server/tf2/tf_stats.h')
| -rw-r--r-- | game/server/tf2/tf_stats.h | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/game/server/tf2/tf_stats.h b/game/server/tf2/tf_stats.h new file mode 100644 index 0000000..c5e68e5 --- /dev/null +++ b/game/server/tf2/tf_stats.h @@ -0,0 +1,106 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: game stat gathering +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef TF_STATS_H +#define TF_STATS_H + +#ifdef _WIN32 +#pragma once +#endif + +#include "tf_shareddefs.h" + +// NOTE: If you change these enums, change the string lists in tf_stats.cpp! +enum TFStatId_t +{ + TF_STAT_FERRY_CONTROL = 0, + TF_STAT_RESOURCE_CHUNKS_SPAWNED, + TF_STAT_RESOURCE_PROCESSED_CHUNKS_SPAWNED, + TF_STAT_RESOURCE_CHUNKS_RETIRED, + + // NOTE: These should go last + TF_STAT_FIRST_OBJECT_BUILT, + TF_STAT_LAST_OBJECT_BUILT = TF_STAT_FIRST_OBJECT_BUILT + OBJ_LAST - 1, + + TF_STAT_COUNT, +}; + +enum TFTeamStatId_t +{ + // First TFCLASS_CLASS_COUNT entries are the # of players of each class. + + TF_TEAM_STAT_PLAYER_COUNT = TFCLASS_CLASS_COUNT, + + TF_TEAM_STAT_RESOURCES_COLLECTED, + TF_TEAM_STAT_RESOURCES_HARVESTED, + TF_TEAM_STAT_RESOURCE_CHUNKS_DROPPED, + TF_TEAM_STAT_RESOURCE_CHUNKS_COLLECTED, + + TF_TEAM_STAT_KILL_COUNT, + TF_TEAM_STAT_DESTROYED_OBJECT_COUNT, + + TF_TEAM_STAT_FERRY_CONTROL_TIME, + + TF_TEAM_STAT_COUNT, +}; + +enum TFPlayerStatId_t +{ + // Player count + TF_PLAYER_STAT_PLAYER_COUNT = 0, + TF_PLAYER_STAT_PLAYER_SECONDS, + TF_PLAYER_STAT_EXISTING_SECONDS, + TF_PLAYER_STAT_FIRST_AVERAGE_STAT, + + // Economy-based stats + TF_PLAYER_STAT_RESOURCES_ACQUIRED = TF_PLAYER_STAT_FIRST_AVERAGE_STAT, + TF_PLAYER_STAT_RESOURCES_ACQUIRED_FROM_CHUNKS, + TF_PLAYER_STAT_RESOURCES_CARRIED, + TF_PLAYER_STAT_RESOURCES_SPENT, + TF_PLAYER_STAT_CURRENT_OBJECT_VALUE, + TF_PLAYER_STAT_OBJECT_COUNT, + + // Combat based stats + TF_PLAYER_STAT_KILL_COUNT, + TF_PLAYER_STAT_DESTROYED_OBJECT_COUNT, + TF_PLAYER_STAT_HEALTH_GIVEN, + + // Animation-based stats + TF_PLAYER_STAT_ANIMATION_IDLE, + TF_PLAYER_STAT_ANIMATION_WALKING, + TF_PLAYER_STAT_ANIMATION_RUNNING, + TF_PLAYER_STAT_ANIMATION_CROUCHING, + TF_PLAYER_STAT_ANIMATION_JUMPING, + TF_PLAYER_STAT_ANIMATION_OTHER, + + TF_PLAYER_STAT_COUNT, +}; + + +class ITFStats +{ +public: + // Clear out the stats + their history + virtual void ResetStats() = 0; + + virtual void IncrementStat( TFStatId_t stat, int nIncrement ) = 0; + virtual void SetStat( TFStatId_t stat, int nAmount ) = 0; + + virtual void IncrementTeamStat( int nTeam, TFTeamStatId_t stat, int nIncrement ) = 0; + virtual void SetTeamStat( int nTeam, TFTeamStatId_t stat, int nAmount ) = 0; + + virtual void IncrementPlayerStat( CBaseEntity *pPlayer, TFPlayerStatId_t stat, int nIncrement ) = 0; +}; + + +//----------------------------------------------------------------------------- +// Accessor method +//----------------------------------------------------------------------------- +ITFStats *TFStats(); + + +#endif // TF_STATS_H |