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/funfact_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/funfact_cs.h')
| -rw-r--r-- | game/server/cstrike/funfact_cs.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/game/server/cstrike/funfact_cs.h b/game/server/cstrike/funfact_cs.h new file mode 100644 index 0000000..bed7bec --- /dev/null +++ b/game/server/cstrike/funfact_cs.h @@ -0,0 +1,71 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +#ifndef INCLUDED_funfact_cs +#define INCLUDED_funfact_cs +#pragma once + +#include "cs_player.h" + +struct FunFact +{ + FunFact() : + id(-1), + szLocalizationToken(NULL), + iPlayer(0), + iData1(0), + iData2(0), + iData3(0), + fMagnitude(0.0f) + {} + int id; + const char* szLocalizationToken; + int iPlayer; + int iData1; + int iData2; + int iData3; + float fMagnitude; +}; + +typedef CUtlVector<FunFact> FunFactVector; + +class FunFactEvaluator +{ + DECLARE_CLASS_NOBASE( FunFactEvaluator ); +public: + FunFactEvaluator( int id, const char* szLocalizationToken, float fCoolness ) : + m_id(id), + m_pLocalizationToken(szLocalizationToken), + m_fCoolness(fCoolness) + {} + + virtual ~FunFactEvaluator() {} + + int GetId() const { return m_id; } + const char* GetLocalizationToken() const { return m_pLocalizationToken; } + float GetCoolness() const { return m_fCoolness; } + + virtual bool Evaluate( FunFactVector& results ) const = 0; + +private: + int m_id; + const char* m_pLocalizationToken; + float m_fCoolness; +}; + + +typedef FunFactEvaluator* (*funfactCreateFunc) (void); +class CFunFactHelper +{ +public: + CFunFactHelper ( funfactCreateFunc createFunc ) + { + m_pfnCreate = createFunc; + m_pNext = s_pFirst; + s_pFirst = this; + } + funfactCreateFunc m_pfnCreate; + CFunFactHelper *m_pNext; + static CFunFactHelper *s_pFirst; +}; + +#endif // INCLUDED_funfact_cs + |