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.

98 lines
2.2 KiB

  1. //--------------------------------------------------------------------------------------------------------
  2. // Copyright (c) 2007 Turtle Rock Studios, Inc.
  3. #if !defined( C_BASETOGGLE_H )
  4. #define C_BASETOGGLE_H
  5. #ifdef _WIN32
  6. #pragma once
  7. #endif
  8. #include "c_baseentity.h"
  9. //copy/paste from server subs.cpp
  10. enum togglemovetypes_t
  11. {
  12. MOVE_TOGGLE_NONE = 0,
  13. MOVE_TOGGLE_LINEAR = 1,
  14. MOVE_TOGGLE_ANGULAR = 2,
  15. };
  16. //--------------------------------------------------------------------------------------------------------
  17. class C_BaseToggle: public C_BaseEntity
  18. {
  19. public:
  20. DECLARE_CLASS( C_BaseToggle, C_BaseEntity );
  21. DECLARE_CLIENTCLASS();
  22. DECLARE_PREDICTABLE(); //elevators
  23. virtual void GetGroundVelocityToApply( Vector &vecGroundVel );
  24. virtual bool ShouldPredict( void );
  25. virtual C_BasePlayer *GetPredictionOwner( void );
  26. virtual void PhysicsSimulate( void );
  27. virtual bool PredictionErrorShouldResetLatchedForAllPredictables( void ) { return false; }
  28. virtual bool PredictionIsPhysicallySimulated( void );
  29. virtual void PostDataUpdate( DataUpdateType_t updateType );
  30. Vector PredictPosition( float fCurTime );
  31. EHANDLE m_hPredictionOwner;
  32. Vector m_vLastNetworked;
  33. float m_fLastNetworkedTime;
  34. Vector m_vecFinalDest;
  35. int m_movementType;
  36. float m_flMoveTargetTime;
  37. bool m_bWasPredictingMotion;
  38. };
  39. //--------------------------------------------------------------------------------------------------------
  40. class C_BaseButton: public C_BaseToggle
  41. {
  42. public:
  43. DECLARE_CLASS( C_BaseButton, C_BaseToggle );
  44. DECLARE_CLIENTCLASS();
  45. C_BaseButton()
  46. {
  47. }
  48. virtual bool IsPotentiallyUsable( void );
  49. private:
  50. bool m_usable;
  51. };
  52. //--------------------------------------------------------------------------------------------------------
  53. //
  54. // CButtonTimed - func_button_timed
  55. //
  56. //--------------------------------------------------------------------------------------------------------
  57. class C_ButtonTimed: public C_BaseButton
  58. {
  59. public:
  60. DECLARE_CLASS( C_BaseButton, C_BaseButton );
  61. DECLARE_CLIENTCLASS();
  62. C_ButtonTimed();
  63. const char * GetUseString( void ) const
  64. {
  65. return m_sUseString;
  66. }
  67. const char * GetUseSubString( void ) const
  68. {
  69. return m_sUseSubString;
  70. }
  71. private:
  72. char m_sUseString[64];
  73. char m_sUseSubString[64];
  74. };
  75. #endif // C_BASETOGGLE_H