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.

56 lines
1.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. // NextBot paths that go through this entity must fulfill the given prerequisites to pass
  3. // Michael Booth, August 2009
  4. #ifndef FUNC_NAV_PREREQUISITE_H
  5. #define FUNC_NAV_PREREQUISITE_H
  6. #include "triggers.h"
  7. /**
  8. * NextBot paths that pass through this entity must fulfill the given prerequisites to pass
  9. */
  10. DECLARE_AUTO_LIST( IFuncNavPrerequisiteAutoList );
  11. class CFuncNavPrerequisite : public CBaseTrigger, public IFuncNavPrerequisiteAutoList
  12. {
  13. DECLARE_CLASS( CFuncNavPrerequisite, CBaseTrigger );
  14. public:
  15. CFuncNavPrerequisite();
  16. DECLARE_DATADESC();
  17. virtual void Spawn( void );
  18. enum TaskType
  19. {
  20. TASK_NONE = 0,
  21. TASK_DESTROY_ENTITY = 1,
  22. TASK_MOVE_TO_ENTITY = 2,
  23. TASK_WAIT = 3,
  24. };
  25. bool IsTask( TaskType type ) const;
  26. CBaseEntity *GetTaskEntity( void );
  27. float GetTaskValue( void ) const;
  28. void InputEnable( inputdata_t &inputdata );
  29. void InputDisable( inputdata_t &inputdata );
  30. bool IsEnabled( void ) const { return !m_isDisabled; }
  31. protected:
  32. int m_task;
  33. string_t m_taskEntityName;
  34. float m_taskValue;
  35. bool m_isDisabled;
  36. EHANDLE m_hTaskEntity;
  37. };
  38. inline float CFuncNavPrerequisite::GetTaskValue( void ) const
  39. {
  40. return m_taskValue;
  41. }
  42. #endif // FUNC_NAV_PREREQUISITE_H