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.

60 lines
1.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef TF_TIMER_H
  7. #define TF_TIMER_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "ehandle.h"
  12. #include "tf_shareddefs.h"
  13. class CTFPlayer;
  14. class CTimer
  15. {
  16. public:
  17. CTimer();
  18. int GetTeamNumber() const;
  19. public:
  20. EHANDLE m_hOwner;
  21. EHANDLE m_hEnemy;
  22. TFTimer_t m_Type; // One of the TF_TIMER_ defines.
  23. int m_iTeamNumber;
  24. float m_flNextThink;
  25. int weapon; // GI_RET_ define.
  26. // For g_Timers.
  27. int m_iListIndex;
  28. };
  29. // This stuff replaces the functions like CBaseEntity::FindTimer, CBaseEntity::CreateTimer,
  30. // and all the timer handlers in TF.
  31. // Find an active timer on the specified entity.
  32. CTimer* Timer_FindTimer( CBaseEntity *pPlayer, TFTimer_t timerType );
  33. // Create a new timer.
  34. CTimer* Timer_CreateTimer( CBaseEntity *pPlayer, TFTimer_t timerType );
  35. // Get rid of a timer.
  36. void Timer_Remove( CTimer *pTimer );
  37. // Update all timers.
  38. void Timer_UpdateAll();
  39. // Call at round restart.
  40. void Timer_RemoveAll();
  41. #endif // TF_TIMER_H