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.

155 lines
4.5 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef GLOBALSTATE_H
  8. #define GLOBALSTATE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. typedef enum { GLOBAL_OFF = 0, GLOBAL_ON = 1, GLOBAL_DEAD = 2 } GLOBALESTATE;
  13. void GlobalEntity_SetState( int globalIndex, GLOBALESTATE state );
  14. void GlobalEntity_SetMap( int globalIndex, string_t mapname );
  15. int GlobalEntity_Add( const char *pGlobalname, const char *pMapName, GLOBALESTATE state );
  16. int GlobalEntity_GetIndex( const char *pGlobalname );
  17. GLOBALESTATE GlobalEntity_GetState( int globalIndex );
  18. const char *GlobalEntity_GetMap( int globalIndex );
  19. const char *GlobalEntity_GetName( int globalIndex );
  20. int GlobalEntity_GetCounter( int globalIndex );
  21. void GlobalEntity_SetCounter( int globalIndex, int counter );
  22. int GlobalEntity_AddToCounter( int globalIndex, int delta );
  23. int GlobalEntity_GetFlags( int globalIndex );
  24. void GlobalEntity_SetFlags( int globalIndex, int flags );
  25. void GlobalEntity_AddFlags( int globalIndex, int flags );
  26. void GlobalEntity_RemoveFlags( int globalIndex, int flags );
  27. int GlobalEntity_GetNumGlobals( void );
  28. void GlobalEntity_EnableStateUpdates( bool bEnable );
  29. inline int GlobalEntity_Add( string_t globalname, string_t mapName, GLOBALESTATE state )
  30. {
  31. return GlobalEntity_Add( STRING(globalname), STRING(mapName), state );
  32. }
  33. inline int GlobalEntity_GetIndex( string_t globalname )
  34. {
  35. return GlobalEntity_GetIndex( STRING(globalname) );
  36. }
  37. inline int GlobalEntity_IsInTable( string_t globalname )
  38. {
  39. return GlobalEntity_GetIndex( STRING(globalname) ) >= 0 ? true : false;
  40. }
  41. inline int GlobalEntity_IsInTable( const char *pGlobalname )
  42. {
  43. return GlobalEntity_GetIndex( pGlobalname ) >= 0 ? true : false;
  44. }
  45. inline void GlobalEntity_SetState( string_t globalname, GLOBALESTATE state )
  46. {
  47. GlobalEntity_SetState( GlobalEntity_GetIndex( globalname ), state );
  48. }
  49. inline void GlobalEntity_SetMap( string_t globalname, string_t mapname )
  50. {
  51. GlobalEntity_SetMap( GlobalEntity_GetIndex( globalname ), mapname );
  52. }
  53. inline GLOBALESTATE GlobalEntity_GetState( string_t globalname )
  54. {
  55. return GlobalEntity_GetState( GlobalEntity_GetIndex( globalname ) );
  56. }
  57. inline GLOBALESTATE GlobalEntity_GetState( const char *pGlobalName )
  58. {
  59. return GlobalEntity_GetState( GlobalEntity_GetIndex( pGlobalName ) );
  60. }
  61. inline int GlobalEntity_GetCounter( string_t globalname )
  62. {
  63. return GlobalEntity_GetCounter( GlobalEntity_GetIndex( globalname ) );
  64. }
  65. inline int GlobalEntity_GetCounter( const char *pGlobalName )
  66. {
  67. return GlobalEntity_GetCounter( GlobalEntity_GetIndex( pGlobalName ) );
  68. }
  69. inline void GlobalEntity_SetCounter( string_t globalname, int counter )
  70. {
  71. GlobalEntity_SetCounter( GlobalEntity_GetIndex( globalname ), counter );
  72. }
  73. inline void GlobalEntity_SetCounter( const char *pGlobalName, int counter )
  74. {
  75. GlobalEntity_SetCounter( GlobalEntity_GetIndex( pGlobalName ), counter );
  76. }
  77. inline int GlobalEntity_AddToCounter( string_t globalname, int delta )
  78. {
  79. return GlobalEntity_AddToCounter( GlobalEntity_GetIndex( globalname ), delta );
  80. }
  81. inline int GlobalEntity_AddToCounter( const char *pGlobalName, int delta )
  82. {
  83. return GlobalEntity_AddToCounter( GlobalEntity_GetIndex( pGlobalName ), delta );
  84. }
  85. inline int GlobalEntity_GetFlags( string_t globalname )
  86. {
  87. return GlobalEntity_GetFlags( GlobalEntity_GetIndex( globalname ) );
  88. }
  89. inline int GlobalEntity_GetFlags( const char *pGlobalName )
  90. {
  91. return GlobalEntity_GetFlags( GlobalEntity_GetIndex( pGlobalName ) );
  92. }
  93. inline void GlobalEntity_SetFlags( string_t globalname, int flags )
  94. {
  95. GlobalEntity_SetFlags( GlobalEntity_GetIndex( globalname ), flags );
  96. }
  97. inline void GlobalEntity_SetFlags( const char *pGlobalName, int flags )
  98. {
  99. GlobalEntity_SetFlags( GlobalEntity_GetIndex( pGlobalName ), flags );
  100. }
  101. inline void GlobalEntity_AddFlags( string_t globalname, int flags )
  102. {
  103. GlobalEntity_AddFlags( GlobalEntity_GetIndex( globalname ), flags );
  104. }
  105. inline void GlobalEntity_AddFlags( const char *pGlobalName, int flags )
  106. {
  107. GlobalEntity_AddFlags( GlobalEntity_GetIndex( pGlobalName ), flags );
  108. }
  109. inline void GlobalEntity_RemoveFlags( string_t globalname, int flags )
  110. {
  111. GlobalEntity_RemoveFlags( GlobalEntity_GetIndex( globalname ), flags );
  112. }
  113. inline void GlobalEntity_RemoveFlags( const char *pGlobalName, int flags )
  114. {
  115. GlobalEntity_RemoveFlags( GlobalEntity_GetIndex( pGlobalName ), flags );
  116. }
  117. inline GLOBALESTATE GlobalEntity_GetStateByIndex( int iIndex )
  118. {
  119. return GlobalEntity_GetState( iIndex );
  120. }
  121. void ResetGlobalState( void );
  122. #endif // GLOBALSTATE_H