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/client/playerandobjectenumerator.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/playerandobjectenumerator.h')
| -rw-r--r-- | game/client/playerandobjectenumerator.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/game/client/playerandobjectenumerator.h b/game/client/playerandobjectenumerator.h new file mode 100644 index 0000000..0f6fa2d --- /dev/null +++ b/game/client/playerandobjectenumerator.h @@ -0,0 +1,44 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#ifndef PLAYERANDOBJECTENUMERATOR_H +#define PLAYERANDOBJECTENUMERATOR_H +#ifdef _WIN32 +#pragma once +#endif + +#include "utlvector.h" +#include "ehandle.h" +#include "ispatialpartition.h" + +class C_BaseEntity; +class C_BasePlayer; + +// Enumator class for finding other players and objects close to the +// local player +class CPlayerAndObjectEnumerator : public IPartitionEnumerator +{ + DECLARE_CLASS_NOBASE( CPlayerAndObjectEnumerator ); +public: + //Forced constructor + CPlayerAndObjectEnumerator( float radius ); + + //Actual work code + virtual IterationRetval_t EnumElement( IHandleEntity *pHandleEntity ); + + int GetObjectCount(); + C_BaseEntity *GetObject( int index ); + +public: + //Data members + float m_flRadiusSquared; + + CUtlVector< CHandle< C_BaseEntity > > m_Objects; + C_BasePlayer *m_pLocal; +}; + +#endif // PLAYERANDOBJECTENUMERATOR_H |