Counter Strike : Global Offensive Source Code
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.

44 lines
1.0 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef PLAYERANDOBJECTENUMERATOR_H
  8. #define PLAYERANDOBJECTENUMERATOR_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "utlvector.h"
  13. #include "ehandle.h"
  14. #include "ispatialpartition.h"
  15. class C_BaseEntity;
  16. class C_BasePlayer;
  17. // Enumator class for finding other players and objects close to the
  18. // local player
  19. class CPlayerAndObjectEnumerator : public IPartitionEnumerator
  20. {
  21. DECLARE_CLASS_NOBASE( CPlayerAndObjectEnumerator );
  22. public:
  23. //Forced constructor
  24. explicit CPlayerAndObjectEnumerator( float radius );
  25. //Actual work code
  26. virtual IterationRetval_t EnumElement( IHandleEntity *pHandleEntity );
  27. int GetObjectCount();
  28. C_BaseEntity *GetObject( int index );
  29. public:
  30. //Data members
  31. float m_flRadiusSquared;
  32. CUtlVector< CHandle< C_BaseEntity > > m_Objects;
  33. C_BasePlayer *m_pLocal;
  34. };
  35. #endif // PLAYERANDOBJECTENUMERATOR_H