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.

69 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: For the slow removing of the CBaseToggle entity
  4. // only old entities that need it for backwards-compatibility should
  5. // include this file
  6. //=============================================================================//
  7. #ifndef BASETOGGLE_H
  8. #define BASETOGGLE_H
  9. #pragma once
  10. #include "baseentity.h"
  11. class CBaseToggle : public CBaseEntity
  12. {
  13. DECLARE_CLASS( CBaseToggle, CBaseEntity );
  14. public:
  15. CBaseToggle();
  16. virtual bool KeyValue( const char *szKeyName, const char *szValue );
  17. virtual bool KeyValue( const char *szKeyName, Vector vec ) { return BaseClass::KeyValue( szKeyName, vec ); };
  18. virtual bool KeyValue( const char *szKeyName, float flValue ) { return BaseClass::KeyValue( szKeyName, flValue ); };
  19. TOGGLE_STATE m_toggle_state;
  20. float m_flMoveDistance;// how far a door should slide or rotate
  21. float m_flWait;
  22. float m_flLip;
  23. Vector m_vecPosition1;
  24. Vector m_vecPosition2;
  25. QAngle m_vecMoveAng;
  26. QAngle m_vecAngle1;
  27. QAngle m_vecAngle2;
  28. float m_flHeight;
  29. EHANDLE m_hActivator;
  30. Vector m_vecFinalDest;
  31. QAngle m_vecFinalAngle;
  32. int m_movementType;
  33. DECLARE_DATADESC();
  34. virtual float GetDelay( void ) { return m_flWait; }
  35. // common member functions
  36. void LinearMove( const Vector &vecDest, float flSpeed );
  37. void LinearMoveDone( void );
  38. void AngularMove( const QAngle &vecDestAngle, float flSpeed );
  39. void AngularMoveDone( void );
  40. bool IsLockedByMaster( void );
  41. virtual void MoveDone( void );
  42. static float AxisValue( int flags, const QAngle &angles );
  43. void AxisDir( void );
  44. static float AxisDelta( int flags, const QAngle &angle1, const QAngle &angle2 );
  45. string_t m_sMaster; // If this button has a master switch, this is the targetname.
  46. // A master switch must be of the multisource type. If all
  47. // of the switches in the multisource have been triggered, then
  48. // the button will be allowed to operate. Otherwise, it will be
  49. // deactivated.
  50. };
  51. #endif // BASETOGGLE_H