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.

49 lines
1.3 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef ENV_PLAYER_SURFACE_TRIGGER_H
  7. #define ENV_PLAYER_SURFACE_TRIGGER_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "baseentity.h"
  12. #include "entityoutput.h"
  13. //-----------------------------------------------------------------------------
  14. // Purpose: Entity that fires outputs whenever the player stands on a different surface
  15. //-----------------------------------------------------------------------------
  16. class CEnvPlayerSurfaceTrigger : public CPointEntity
  17. {
  18. DECLARE_CLASS( CEnvPlayerSurfaceTrigger, CPointEntity );
  19. public:
  20. DECLARE_DATADESC();
  21. ~CEnvPlayerSurfaceTrigger( void );
  22. void Spawn( void );
  23. void OnRestore( void );
  24. // Main interface to all surface triggers
  25. static void SetPlayerSurface( CBasePlayer *pPlayer, char gameMaterial );
  26. void UpdateMaterialThink( void );
  27. private:
  28. void PlayerSurfaceChanged( CBasePlayer *pPlayer, char gameMaterial );
  29. void InputDisable( inputdata_t &inputdata );
  30. void InputEnable( inputdata_t &inputdata );
  31. private:
  32. int m_iTargetGameMaterial;
  33. int m_iCurrentGameMaterial;
  34. bool m_bDisabled;
  35. // Outputs
  36. COutputEvent m_OnSurfaceChangedToTarget;
  37. COutputEvent m_OnSurfaceChangedFromTarget;
  38. };
  39. #endif // ENV_PLAYER_SURFACE_TRIGGER_H