Counter Strike : Global Offensive Source Code
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.

75 lines
2.2 KiB

  1. //========= Copyright � 1996-2005, 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. class CBaseEntity;
  11. class CBaseToggle : public CBaseEntity
  12. {
  13. DECLARE_CLASS( CBaseToggle, CBaseEntity );
  14. DECLARE_SERVERCLASS();
  15. public:
  16. CBaseToggle();
  17. virtual bool KeyValue( const char *szKeyName, const char *szValue );
  18. virtual bool KeyValue( const char *szKeyName, Vector vec ) { return BaseClass::KeyValue( szKeyName, vec ); };
  19. virtual bool KeyValue( const char *szKeyName, float flValue ) { return BaseClass::KeyValue( szKeyName, flValue ); };
  20. TOGGLE_STATE m_toggle_state;
  21. float m_flMoveDistance;// how far a door should slide or rotate
  22. float m_flWait;
  23. float m_flLip;
  24. Vector m_vecPosition1;
  25. Vector m_vecPosition2;
  26. QAngle m_vecMoveAng;
  27. QAngle m_vecAngle1;
  28. QAngle m_vecAngle2;
  29. float m_flHeight;
  30. EHANDLE m_hActivator;
  31. CNetworkVector( m_vecFinalDest );
  32. QAngle m_vecFinalAngle;
  33. CNetworkVar( int, m_movementType );
  34. CNetworkVar( float, m_flMoveTargetTime ); //absolute time, not local time
  35. DECLARE_DATADESC();
  36. virtual float GetDelay( void ) { return m_flWait; }
  37. // common member functions
  38. void LinearMove( const Vector &vecDest, float flSpeed );
  39. void LinearMoveDone( void );
  40. void AngularMove( const QAngle &vecDestAngle, float flSpeed );
  41. void AngularMoveDone( void );
  42. bool IsLockedByMaster( void );
  43. virtual void MoveDone( void );
  44. virtual void GetGroundVelocityToApply( Vector &vecGroundVel );
  45. static float AxisValue( int flags, const QAngle &angles );
  46. void AxisDir( void );
  47. static float AxisDelta( int flags, const QAngle &angle1, const QAngle &angle2 );
  48. string_t m_sMaster; // If this button has a master switch, this is the targetname.
  49. // A master switch must be of the multisource type. If all
  50. // of the switches in the multisource have been triggered, then
  51. // the button will be allowed to operate. Otherwise, it will be
  52. // deactivated.
  53. };
  54. #endif // BASETOGGLE_H