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.

43 lines
886 B

  1. //=========== Copyright Valve Corporation, All rights reserved. ===============//
  2. //
  3. // Purpose:
  4. //=============================================================================//
  5. #ifndef UISCHEDULEDDEL_H
  6. #define UISCHEDULEDDEL_H
  7. #ifdef _WIN32
  8. #pragma once
  9. #endif
  10. #include "tier1/utldelegate.h"
  11. namespace panorama
  12. {
  13. // Panorama wrapper around CUtlSymbol which always creates symbol in panorama.dll module
  14. class CUIScheduledDel
  15. {
  16. public:
  17. // constructor, destructor
  18. CUIScheduledDel( CUtlDelegate< void() > del );
  19. ~CUIScheduledDel();
  20. void Schedule( double flSecondsToRunIn );
  21. void Cancel();
  22. bool BScheduled();
  23. double GetSecondsUntilScheduled() { return MAX( m_flNextScheduled - UIEngine()->GetCurrentFrameTime(), 0.0 ); }
  24. private:
  25. double m_flNextScheduled;
  26. int m_iScheduledIndex;
  27. CUtlDelegate< void() > m_del;
  28. };
  29. } // namespace panorama
  30. #endif // UISCHEDULEDDEL_H