Team Fortress 2 Source Code as on 22/4/2020
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.

46 lines
1.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #pragma once
  7. #ifndef AI_LOOKTARGET_H
  8. #define AI_LOOKTARGET_H
  9. #define SF_LOOKTARGET_ONLYONCE 0x00000001
  10. //=============================================================================
  11. //=============================================================================
  12. class CAI_LookTarget : public CPointEntity
  13. {
  14. public:
  15. DECLARE_CLASS( CAI_LookTarget, CPointEntity );
  16. DECLARE_DATADESC();
  17. CAI_LookTarget() { m_flTimeNextAvailable = -1; }
  18. // Debugging
  19. int DrawDebugTextOverlays(void);
  20. // Accessors & Availability
  21. bool IsEligible( CBaseEntity *pLooker );
  22. bool IsEnabled() { return !m_bDisabled; }
  23. bool IsAvailable() { return (gpGlobals->curtime > m_flTimeNextAvailable); }
  24. void Reserve( float flDuration );
  25. // Searching
  26. static CAI_LookTarget *GetFirstLookTarget();
  27. static CAI_LookTarget *GetNextLookTarget( CAI_LookTarget *pCurrentTarget );
  28. int m_iContext;
  29. int m_iPriority;
  30. void Enable() { m_bDisabled = false; }
  31. void Disable() { m_bDisabled = true; }
  32. private:
  33. bool m_bDisabled;
  34. float m_flTimeNextAvailable;
  35. float m_flMaxDist;
  36. };
  37. #endif//AI_LOOKTARGET_H