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/cstrike/funfactmgr_cs.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/server/cstrike/funfactmgr_cs.h')
| -rw-r--r-- | game/server/cstrike/funfactmgr_cs.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/game/server/cstrike/funfactmgr_cs.h b/game/server/cstrike/funfactmgr_cs.h new file mode 100644 index 0000000..aac715c --- /dev/null +++ b/game/server/cstrike/funfactmgr_cs.h @@ -0,0 +1,45 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +#ifndef FUNFACTMGR_H +#define FUNFACTMGR_H +#ifdef _WIN32 +#pragma once +#endif + +#include "GameEventListener.h" +#include "funfact_cs.h" +#include "utlmap.h" + +class FunFactEvaluator; + +class CCSFunFactMgr : public CAutoGameSystemPerFrame, public CGameEventListener +{ +public: + CCSFunFactMgr(); + ~CCSFunFactMgr(); + + virtual bool Init(); + virtual void Shutdown(); + virtual void Update( float frametime ); + + bool GetRoundEndFunFact( int iWinningTeam, int iRoundResult, FunFact& funfact ); + +protected: + float ScoreFunFact( const FunFact& funfact ); + void FireGameEvent( IGameEvent *event ); + +private: + + float m_playerCooldown[MAX_PLAYERS]; // Weights for all players. Updated every round + + struct FunFactDatabaseEntry + { + const FunFactEvaluator* pEvaluator; + int iOccurrences; + float fCooldown; + }; + CUtlMap<int, FunFactDatabaseEntry> m_funFactDatabase; + int m_numRounds; +}; + +#endif + |