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.

26 lines
1.5 KiB

  1. //========= Copyright � 1996-2008, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: System to generate events as specified entities become visible to players.
  4. //
  5. // $NoKeywords: $
  6. //=====================================================================================//
  7. #include "cbase.h"
  8. // memdbgon must be the last include file in a .cpp file!!!
  9. #include "tier0/memdbgon.h"
  10. // A callback which will automatically be used instead of generating the generic
  11. // 'on_entity_visible' game event. Often used so that the entity can generate
  12. // its own, more unique game event.
  13. // Return TRUE if you want the generic event generated after the callback
  14. // Return FALSE if you do not want the generic event generated
  15. typedef bool (*VisibilityMonitorCallback)( CBaseEntity *pVisibleEntity, CBasePlayer *pViewingPlayer );
  16. // This callback tells us which object is being seen, and by which client. The callback returns 'true'
  17. // to allow visibility monitor to acknowledge the event, or false to suppress the event.
  18. typedef bool (*VisibilityMonitorEvaluator)( CBaseEntity *pVisibleEntity, CBasePlayer *pViewingPlayer );
  19. extern void VisibilityMonitor_AddEntity( CBaseEntity *pEntity, float flMinDist, VisibilityMonitorCallback pfnCallback, VisibilityMonitorEvaluator pfnEvaluator );
  20. extern void VisibilityMonitor_AddEntity_NotVisibleThroughGlass( CBaseEntity *pEntity, float flMinDist, VisibilityMonitorCallback pfnCallback, VisibilityMonitorEvaluator pfnEvaluator );
  21. extern void VisibilityMonitor_RemoveEntity( CBaseEntity *pEntity );